OpenResFile; Resources May Save Incorrectly in Interpreter (42464)
The information in this article applies to:
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
This article was previously published under Q42464 SUMMARY
If you are using the OpenResFile statement (to open external resource
files) when developing a program in the interpreter in Macintosh
QuickBASIC, you must invoke CloseResFile whenever the program ends.
This includes when Stop is selected from the File menu or COMMAND+PERIOD
is pressed. (Using CloseResFile like this is not required in compiled
programs.)
If external resource files are left open in an interpreted program,
the QuickBASIC environment may place resources in the wrong files when
you Compile or Save. For example, the MBCO resource, the compiler
options specific to a source file, may be attached to the wrong file
(as discussed in a separate article in this KnowledgeBase; query for
MBCO).
This behavior is a negative side effect of the designed feature to
leave the resource file open during single-stepping (debugging) in the
interpreter.
You should invoke an ON BREAK GOSUB handler to make sure CloseResFile
is performed when the program breaks, as shown at the bottom of this
article. (An alternative is to always manually execute CloseResFile in
the COMMAND window before doing a Save or Compile in the QuickBASIC
environment.)
| Modification Type: | Minor | Last Reviewed: | 1/9/2003 |
|---|
| Keywords: | KB42464 |
|---|
|