Microsoft KB Archive/47751

From BetaArchive Wiki
Knowledge Base

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

Article ID: 47751

Article Last Modified on 1/9/2003


  • Microsoft QuickBasic Compiler for Macintosh 1.0

This article was previously published under Q47751


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.


The following are the steps needed to add the three new lines:

  1. Run QuickBasic (b) and open the AlertMover program, which is found in the Tools folder.
  2. Choose the List option in the Windows menu.
  3. Select the Jump To... option from QuickBasic's Search menu.
  4. 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.
  5. Enter the following two lines, which will be part of CASE 1:

        OPEN res$ FOR OUTPUT AS #1
        CLOSE #1
  6. Again select the Jump To... option from QuickBasic's Search menu.
  7. Enter line number 111 and the cursor will be located at the line that reads as follows:

        TOOLBOX "WQ",&H997",dest$,rf%
  8. Delete that line.
  9. In its place, add the following line:

        OpenResFile dest$,rf%
  10. 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:

  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)

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