How Macintosh QuickBASIC Uses Resource and Data Forks of Files (42463)
The information in this article applies to:
- Microsoft QuickBASIC Compiler for the Apple Macintosh
This article was previously published under Q42463 SUMMARY
Any file stored on a Macintosh disk has two parts or forks: a resource
fork and a data fork.
The resource fork is also known as a "resource file."
Resources are specially formatted pieces of data stored in the
resource fork. An application file, for example, may keep resources
such as fonts, icons, menus, and application code in its resource
fork.
The application can keep anything it wishes in the data fork (often
nothing). The data fork is often used for the contents of data files.
Chapters 4 and 8 of the following book give more technical details
about Macintosh files:
"Technical Introduction to the Macintosh Family," by Apple Computer
(published by Addison-Wesley, 1987)
MORE INFORMATION
The QuickBASIC (b) or (d) application itself has an empty data fork,
and just uses its resource fork.
The code for your program is located in the data fork in the disk
files for compiled and interpreted programs.
Files created with the OPEN statement in a QuickBASIC program store
data in the data fork. They have an empty resource fork, unless you
perform OpenResFile on that file and write some resources.
You can place resources into the resource fork of any file by using
ResEdit, the "Statement Mover" program, or your own program that
invokes Toolbox routines (such as OpenResFile, AddRes, SaveArray,
SaveCursor, SaveIcon, SavePicture, and SaveString).
Use SYSTEM(7) (instead of OpenResFile) to get the file reference
number of resources stored in a running source file or compiled
application. OpenResFile should only be used for accessing resource
files that are external to the program.
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | KB42463 |
---|
|