Microsoft KB Archive/45950

= Definition of a Macintosh &quot;Pure Code&quot; Resource =

Article ID: 45950

Article Last Modified on 1/9/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



This article was previously published under Q45950



SUMMARY
Microsoft QuickBASIC Version 1.00 for the Apple Macintosh can call &quot;Pure Code&quot; resource routines contained in a LIBRARY.

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

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.
 * 1) 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 &quot;Microsoft QuickBASIC for Apple Macintosh: Language Reference&quot; manual.

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

Additional query words: MQuickB

Keywords: KB45950

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.