Microsoft KB Archive/42463

= How Macintosh QuickBASIC Uses Resource and Data Forks of Files =

Article ID: 42463

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft QuickBasic Compiler for Macintosh 1.0

-



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 &quot;resource file.&quot;

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:

&quot;Technical Introduction to the Macintosh Family,&quot; 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 &quot;Statement Mover&quot; 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.

Additional query words: MQuickB

Keywords: KB42463

-

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

© Microsoft Corporation. All rights reserved.