home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12711 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.4 KB  |  64 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!gatech!concert!sas!mozart.unx.sas.com!walker
  3. From: walker@twix.unx.sas.com (Doug Walker)
  4. Subject: Re: SAS/C 6.0 Details (LONG!)
  5. Originator: walker@twix.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <BtLEyn.2I8@unx.sas.com>
  8. Date: Wed, 26 Aug 1992 13:32:47 GMT
  9. References: <BsxCu2.5A7@unx.sas.com> <1992Aug18.203629.22286@fcom.cc.utah.edu> <Bt8H7F.BL8@unx.sas.com> <hemmer.01sx@hemmer.adsp.sub.org> <1992Aug26.124301.22998@email.tuwien.ac.at>
  10. Nntp-Posting-Host: twix.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 50
  13.  
  14.  
  15. In article <1992Aug26.124301.22998@email.tuwien.ac.at>, mjl@newton.auto.tuwien.ac.at (Martin J. Laubach) writes:
  16. |> |> So, when I switch to V6.0 I'll have to set all my library pointers to NULL
  17. |> |> after CloseLibrary(), in order to avoid autoterm() to close it again ?
  18. |> 
  19. |>   No. You'd only need to do this if your code opens and closes the libraries
  20. |> yet does not define the library base -- quite unlikely, I'd say.
  21. |> 
  22. |>     mjl
  23.  
  24. No, his code would still work even if he doesn't define the library
  25. base.  It would just open the library redundantly.
  26.  
  27. I'll quote myself here (this was a posting from a couple of days ago):
  28. |> 
  29. |> The autoinit code does this:
  30. |> 
  31. |>    static struct Library *libbase;
  32. |>    tmpbase = IntuitionBase = OpenLibrary("intuition.library",__oslibversion);
  33. |>    ...
  34. |> 
  35. |> The autoterm code does this:
  36. |> 
  37. |>    CloseLibrary(libbase);
  38. |> 
  39. |> This means that, no matter what your code does with IntuitionBase, the library
  40. |> is still closed the same number of times that it is opened.  Many people do
  41. |> this when they close the library:
  42. |> 
  43. |>    CloseLibrary(IntuitionBase);
  44. |>    IntuitionBase = NULL;
  45. |> 
  46. |> The reason we use the static variable 'libbase' is so we can still close the
  47. |> library the correct number of times if you set the library base to NULL in
  48. |> your own code.
  49.  
  50. Hmm, looks like there is an error there - that "tmpbase = " should
  51. be "libbase = ".  That's what comes of typing in code on the fly.
  52.  
  53. In any event, no existing code will break.
  54.  
  55. -- 
  56.   *****
  57. =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
  58.  *|. o.| ||                                          1200/2400/9600 Dual
  59.   | o  |//     For all you do, this bug's for you!
  60.   ====== 
  61. usenet: walker@unx.sas.com                            bix: djwalker 
  62. Any opinions expressed are mine, not those of SAS Institute, Inc.
  63.  
  64.