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



The information in this article applies to:

  • Microsoft QuickBASIC 3.0
  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 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%
				

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB43563