Definition of a Macintosh "Pure Code" Resource (45950)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0

This article was previously published under Q45950

SUMMARY

Microsoft QuickBASIC Version 1.00 for the Apple Macintosh can call "Pure Code" resource routines contained in a LIBRARY.

The following definition of a pure code resource is based on information from Page 82 of "Think's Lightspeed C: User's Manual":

Pure code resources do not have the complex structure of a device driver or application. They contain code which is called from an entry point. When CALLed from a QuickBASIC program, the BASIC program loads pure code resources into memory and CALLs them at their entry point.

MORE INFORMATION

Pure code resources have the following uses:

  1. Routines can be written in other languages, such as C, Pascal, or Assembly. These routines make the features of those languages available to a BASIC program. Pure code resources are stored in a LIBRARY as MBPC resources. When the LIBRARY statement is executed in a BASIC program, the external LIBRARY file is opened and the MBPC resources are loaded into memory. The BASIC program can then call each MBPC by its individual name. (If you store the MBPC routines in the resource fork of QuickBASIC itself, or of the compiled application, then the routines are automatically available and callable without executing a LIBRARY statement.)

    Libraries make it possible to develop a common set of routines, which can be used in many different BASIC programs.
  2. Pure code resources can be used to make INITs. This function of pure code resources does not involve the use of BASIC. This is because QuickBASIC 1.00 for the Macintosh cannot create pure code resources, it can only CALL them.
For information about using pure code resource libraries with QuickBASIC, please refer to Pages 446-451, Appendix E, of the "Microsoft QuickBASIC for Apple Macintosh: Language Reference" manual.

Additional information concerning pure code resources can be found in Macintosh reference material such as "Inside Macintosh" (by Apple Computer, published by Addison-Wesley) or "Macintosh Revealed" (by Stephen Chernicoff, published by Hayden Books, a division of Howard Sams & Company) under device drivers and code resources.

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB45950