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



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple 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:

  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:
...
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%)
...
				

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:kbbug KB47751