SIGNAL - QB64 Wiki

SIGNAL

From QB64 Wiki

Jump to: navigation, search

The SIGNAL keyword was reserved for OS/2 systems (protected mode). See the example for more information about how and why it is used.


Syntax:

ON SIGNAL(number) GOSUB line
SIGNAL(number) ON


  • Currently NOT supported in QB64!
  • It will only work with compiler 6.00 and 6.00b and Basic PDS 7.00 when compiling in protected mode under OS/2. In all other situations, a SIGNAL statement results in an "Advanced feature unavailable" error message.


Example:

PRINT "This program traps CTRL+BREAK in OS/2. Try it." ON SIGNAL(4) GOSUB trap SIGNAL(4) ON 10 a$ = INKEY$ IF a$ = "" THEN GOTO 10 END trap: PRINT "CTRL+BREAK trapped. Press any key to quit" RETURN


Output: It returns the following when Ctrl-Break is pressed

This program traps CTRL+BREAK in OS/2. Try it. CTRL+BREAK trapped. Press any key to quit

Error message in QB4.5 if not using OS 2:

Advanced feature unavailable


Source: Microsoft KB41389 [[1]]


See also:

  • ON KEY (n)



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in
Toolbox
  • What links here
  • Related changes
  • Special pages
  • Printable version