Microsoft KB Archive/47751

= BUG: AlertMover's Alert->New File Option Doesn't Make New File =

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 &quot;Alert->New File...&quot; 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 &quot;WQ&quot;,&H997&quot;,dest$,rf% </li> Delete that line.</li>  In its place, add the following line: OpenResFile dest$,rf% </li> Select QuickBasic's File menu and Save the program.</li></ol>

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,&quot;Name of New File&quot;)

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 &quot;PQ&quot;,&H998,(me%) ...

Additional query words: MQuickB

Keywords: kbbug KB47751

-

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

© Microsoft Corporation. All rights reserved.