Article ID: 47751
Article Last Modified on 1/9/2003
APPLIES TO
- Microsoft QuickBasic Compiler for Macintosh 1.0
This article was previously published under Q47751
SYMPTOMS
In Microsoft QuickBasic 1.00 for the Macintosh, the "Alert->New File..." option in the File menu of the AlertMover sample program fails to create a file. Three lines of code can be added and one line deleted in AlertMover to correct this problem, so that you can then create a new file.
MORE INFORMATION
The following are the steps needed to add the three new lines:
- Run QuickBasic (b) and open the AlertMover program, which is found in the Tools folder.
- Choose the List option in the Windows menu.
- Select the Jump To... option from QuickBasic's Search menu.
- Enter line number 91, and the cursor will be located after the doMenu label and on the CASE 2 line of the SELECT CASE statement.
Enter the following two lines, which will be part of CASE 1:
OPEN res$ FOR OUTPUT AS #1 CLOSE #1
- Again select the Jump To... option from QuickBasic's Search menu.
Enter line number 111 and the cursor will be located at the line that reads as follows:
TOOLBOX "WQ",&H997",dest$,rf%
- Delete that line.
In its place, add the following line:
OpenResFile dest$,rf%
- Select QuickBasic's File menu and Save the program.
Code Example
The following is what the finished code should look like in the areas changed in AlertMover:
... doMenu: MENU menu.id=MENU(1) SELECT CASE menu.id CASE 1 :res$=FILES$(0,"Name of New File") OPEN res$ FOR OUTPUT AS #1 ' 1. These two lines CLOSE #1 ' 2. need to be added. CASE 2 :res$=FILES$(1) CASE 4 :END CASE ELSE END SELECT ... SUB moveRes(source%,dest$,type$,id%) STATIC handle&=0 : rf%=0 GetRes source%,type$,id%,handle& LockRes handle& DetachRes handle& OpenResFile dest$,rf% ' 3. This line needs to be added. me%=PEEKW(&H900):Toolbox "PQ",&H998,(me%) ...
Additional query words: MQuickB
Keywords: kbbug KB47751