Microsoft KB Archive/43563

From BetaArchive Wiki
Knowledge Base


Function MENU%() Fails in Hergert's "QuickBasic, 2nd Edition"

Article ID: 43563

Article Last Modified on 11/21/2006



APPLIES TO

  • Microsoft QuickBasic 3.0
  • Microsoft QuickBasic 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBasic 4.5 for MS-DOS
  • Microsoft BASIC Professional Development System 7.0



This article was previously published under Q43563

SUMMARY

The MENU%() function in the Microsoft Press book "Microsoft QuickBasic, Second Edition" by Douglas Hergert will fail if it is coded without the variables "true%" and "false%" defined in the main program. If these lines are not included, the program will eventually enter an infinite loop that can only be exited with CTRL+BREAK.

The program can be found on Pages 68-71 in Hergert's book. This program, which is designed to be incorporated into your program, displays a menu box with menu options and returns a value equal to your selection. The book assumes that you have defined the variables "true%" and "false%" in the title of your main program. This is a documentation omission.

This information applies to Microsoft QuickBasic Versions 3.00, 4.00, 4.00b, and 4.50, to Microsoft Basic Compiler Versions 6.00 and 6.00b, and to Microsoft Basic PDS Version 7.00.

The workaround for this problem is to add one of the following lines of code to the beginning of the program:

   false% = 0 : true% = NOT false%
   true% = -1 : false% = NOT true%
                


Additional query words: QuickBas BasicCom

Keywords: KB43563