home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!netnews!bandy
- From: bandy@netnews.jhuapl.edu (Mike Bandy)
- Subject: Re: Does opening libraries require a fixed varname?
- Message-ID: <BzGwBB.JBC@netnews.jhuapl.edu>
- Organization: JHU/Applied Physics Laboratory
- References: <BzDnFz.FM5@usenet.ucs.indiana.edu>
- Date: Fri, 18 Dec 1992 18:21:10 GMT
- Lines: 34
-
- shulick@navajo.ucs.indiana.edu (Sam Hulick) writes:
-
-
- >If I wanted, for instance, to open intuition.library, does the line
- >*HAVE* to be:
-
- >IntuitionBase = OpenLibr.......
-
- >Can it be something like "IBase = OpenLibrary(.." or "blech = Open..."
- >In other words, does it matter what you call the variable?
- >GadToolsBase, ExecBase, GfxBase, etc.
-
- Yes it matters. Name is *exactly* like you see it described in the texts.
-
- I tried the following - it took me several hours to figure out why my
- A3000 kept crashing!
-
- LONG init()
- {
- static APTR IntuitionBase; /* *** WRONG *** */
- IntuitionBase = OpenLibr....
- }
-
- The return value is important and must be stored in a *global* variable
- for reference by the stubs (see other replies for a description of the
- AmigaDOS library mechanism). No compile or run time error message results
- in calling a routine with an unitialized or undefined base variable - your
- Amiga just crashes.
-
- --
-
- Mike Bandy
- bandy@aplcomm.jhuapl.edu
- Johns Hopkins University / Applied Physics Lab
-