"Expected: GOSUB" Error with Basic 7.0/7.1 ON KEY Trap Example (76516)



The information in this article applies to:

  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0

This article was previously published under Q76516

SUMMARY

The following corrections apply to pages 312 and 313 of the "Microsoft Basic 7.0: Programmer's Guide," specifically to the code examples illustrating the use of event traps. These incorrect code examples give an "Expected: GOSUB" error at compile time.

To correct the examples, change the four occurrences of
   ON KEY (x) GOTO...
				
to
   ON KEY (x) GOSUB...
				
This information applies to Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2.

MORE INFORMATION

The correct syntax for ON event statements is explained beginning on page 225 in "Microsoft Basic 7.0: Language Reference" for versions 7.0 and 7.1.

Modification Type:MajorLast Reviewed:10/20/2003
Keywords:KB76516