$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) '/*------------------------------------------------------------------*/ $CODE SEG "MLIB6" '/*------------------------------------------------------------------*/ SUB NUMON() PUBLIC NUM "ON" END SUB SUB NUMOFF() PUBLIC NUM "OFF" END SUB SUB NUM(BYVAL OPT AS STRING) PUBLIC Cmd$ = UCASE$(OPT) IF ( Cmd$ = "ON" ) THEN Stat = -1 ELSEIF ( Cmd$ = "OFF" ) THEN Stat = 0 END IF DEF SEG = 0 X = PEEK( &H417 ) 'get keyboard toggles IF Stat THEN BIT SET X, 5 'turn on num lock '/* PRINT "NUM LOCK is now ON" ELSE BIT RESET X, 5 'turn off num lock '/* PRINT "NUM LOCK is now OFF" END IF POKE &H417, X 'set keyboard toggles DEF SEG END SUB