NBASIC
Peeks and Pokes
Introduction
What's New
About NBASIC
Downloads
Screenshots
Hints and Tips
Peeks and Pokes
Inside NBASIC
FAQs
Support
Contact Us
Links
Español
PEEKs

PEEK(23) Returns 1 if this version of NBASIC is a shareware version, otherwise returns 0
PEEK(36) Release number of NBASIC
PEEK(149) AND 1 Result is 1 if this version of NBASIC supports printing, otherwise 0
PEEK(149) AND 4 Result is 1 if this version of NBASIC supports wildcards, otherwise 0
PEEK(586) Event trapping handler status: bit 0-ON ERROR, bit 1-ON BREAK, bit 2-ON TIMER (0-not set, 1-set)
PEEK(631) Zone width (Version 1.2 or later)
PEEK(677) Returns 1 if the NBASIC window is minimized, 8 if maximized and 0 otherwise
PEEK(704) Active event trapping handler status: bit 0-ON ERROR, bit 1-ON BREAK, bit 2-ON TIMER (0-not active, 1-active)
PEEK(706) Returns 1 if a file is attached to screen output, otherwise returns 0 (Version 1.5 or later)
PEEK(788) Returns 1 if this program is being run as the startup program specified in the startup options dialog, otherwise returns 0 (Version 1.0.1 or later, standard edition only)
PEEK(828) Installed printers (Version 1.5 or later)
PEEK(872) Printer font size (0-default, 6-24 font size)
PEEK(875) Print style of line numbers when a program is printed (0-default, 1-right justifed with leading spaces, 2-right justified with leading 0s, 3-left justified with trailing spaces)
PEEK(919) Returns 32 if the NBASIC window is in full screen mode, otherwise returns 0 (standard edition only)
PEEK(1107) Returns 255 if Num Lock is on, 0 if Num Lock is off
PEEK(1210) Returns 255 if Scroll Lock is on, 0 if Scroll Lock is off
PEEK(1967) Returns 0 if key autorepeat is on, 18 if key autorepeat is off
PEEK(1994) Current foreground color
PEEK(1995) Current background color
PEEK(3943)*256+PEEK(3944) Current value of the 32767 millisecond timer (high byte of the 16bit millisecond timer) (Version 1.4 or later)
PEEK(3944) Current value of the 255 millisecond timer (low byte of the 16bit millisecond timer) (Version 1.4 or later)
PEEK(3998) Returns 255 if inverse mode is on, 0 if inverse mode is off
PEEK(5025) Returns 1 if a key is in the type-ahead buffer, otherwise returns 0
PEEK(5776) Returns 255 if Caps Lock is on, 0 if Caps Lock is off
PEEK(5794) If no BREAK key event handler set, returns 255 if BREAK key trapping on, otherwise 0
If BREAK key event handler set, returns &H80 if disabled, &H81 if enabled or &H8F if stopped
PEEK(6911) Returns 0 if OK was selected in the VOLUME? statement dialog, 255 if Cancel was selected (Version 1.6 or later)
PEEK(7695) Returns 255 if tracing is on, 0 if tracing is off
PEEK(8334) Length of command buffer text in memory locations 8335-8590 (255 bytes)
PEEK(9575)*256+PEEK(9576) Printer columns (if more than 255) (Version 1.1 or later, standard edition only)
PEEK(9576) Printer columns (Version 1.1 or later, standard edition only)
PEEK(9587)*256+PEEK(9588) Printer rows (if more than 255) (Version 1.1 or later, standard edition only)
PEEK(9588) Printer rows (Version 1.1 or later, standard edition only)
PEEK(9591) Last error number
PEEK(10836) Returns 1 if Windows clipboard text available or 0 if not available (Version 1.6 or later)
PEEK(11799) Returns 0 if the PAUSE key is enabled, 128 if the PAUSE key is disabled
PEEK(14963) Returns 0 if OK was selected in the PRINTER? statement dialog, 255 if Cancel was selected (Version 1.4 or later, standard edition only)
PEEK(17654) Command level (Version 1.0 to 1.6)
(Note: not used, Version 2.0 or later)
PEEK(19140) Returns 1 if the program was loaded by the system, otherwise returns 0
PEEK(19408) Returns 1 if a printer is open, otherwise returns 0 (Version 1.1 or later, standard edition only)
PEEK(19920) Returns 255 if automatic line numbering is on, 0 if automatic line numbering is off (Version 1.0 to 1.6, standard edition only)
(Note: not used, Version 2.0 or later)
PEEK(21148) Printer minimum left margin (1/100") (Version 1.2 or later, standard edition only)
PEEK(21149) Printer minimum top margin (1/100") (Version 1.2 or later, standard edition only)
PEEK(21150) Printer minimum right margin (1/100") (Version 1.2 or later, standard edition only)
PEEK(21151) Printer minimum bottom margin (1/100") (Version 1.2 or later, standard edition only)
PEEK(21998) Screen rows
PEEK(21999) Screen columns
PEEK(22469) Returns 255 if upper case only is enabled, 0 if upper case only is disabled
PEEK(23792) Returns 255 if confirmations are on, 0 if confirmations are off
PEEK(27523) Returns 255 if profiling is on, 0 if profiling is off (standard edition only)
PEEK(27616) Default foreground color (0-15)
PEEK(27617) Default background color (0-15)
PEEK(29520) Returns 1 if the printer is at the beginning of a page, otherwise returns 0 (Version 1.5 or later, standard edition only)
PEEK(29538) Current character set (0-ANSI, 161-Greek, 162-Turkish, 177-Hebrew, 178-Arabic, 186-Baltic, 204-Russian, 238-East Europe, 255-OEM) (Version 1.2 to 1.6)
(Note: not used, Version 2.0 or later)
PEEK(29560) Current printer page or pages printed (Version 1.5 or later, standard edition only)
PEEK(29620)*256+PEEK(29621) Current year (Version 1.6 or later)
PEEK(29622) Current month (1-12) (Version 1.6 or later)
PEEK(29623) Current day (1-31) (Version 1.6 or later)
PEEK(29624) Current hour (0-23) (Version 1.6 or later)
PEEK(29625) Current minute (0-59) (Version 1.6 or later)
PEEK(29626) Current second (0-59) (Version 1.6 or later)
PEEK(29627) Current day of week (0-6) (Version 1.6 or later)
PEEK(29628) AM (0) or PM (1) (Version 1.6 or later)
PEEK(31567) Returns 255 if debugging is on, 0 if debugging is off (standard edition only)
PEEK(32148) Graphics foreground (drawing) color (standard edition only)
PEEK(32149) Graphics background color (standard version only)
PEEK(33307) Number of screens currently backed up (Version 1.4 to 1.6)
(Note: not used, Version 2.0 or later)
PEEK(33957) Is system time currently in daylight savings time (1-yes, 0-no, 255-unknown) (Version 2.0 or later)
PEEK(38360) Returns 1 if there is data available to be read, otherwise returns 0
PEEK(39038) Current tab size
PEEK(39336) Character output delay (Version 2.2 or later)
PEEK(41223) Returns 214 if control character sequences are disabled, otherwise returns 0
PEEK(42510) Returns 4 if a log file is open, otherwise returns 0 (standard edition only)
PEEK(44638) Returns 128 if a printer is available, otherwise returns 0
PEEK(46090) Returns 214 if escape sequences are disabled, otherwise returns 0
PEEK(46966) Current printer character set (0-ANSI, 161-Greek, 162-Turkish, 177-Hebrew, 178-Arabic, 186-Baltic, 204-Russian, 238-East Europe, 255-OEM) (Version 1.2 to 1.6, standard edition only)
(Note: not used, Version 2.0 or later)
PEEK(49549) Cross reference option (0-line numbers, 1-labels, 2-variables, 3-user-defined functions, 5-statements, 6-functions) used by EXEC &HD3F8
PEEK(49565) Returns 1 if the cursor is on, 0 if the cursor is off
PEEK(51520) Returns 1 if timer event trapping is enabled, 0 if timer event trapping is disabled, or 255 if there is no timer event trapping
PEEK(54336) Open files
PEEK(58875) Returns 1 if a log file is open and logging is on, 0 if logging is off, or 255 if there is no log file open (standard edition only)
PEEK(59125) Returns 128 if the screen is locked (LOCK #0), otherwise returns 0
PEEK(59400) Returns 255 if graphics have been enabled with the GRAPH statement, otherwise returns 0 (standard edition only)
PEEK(61345) Returns 1 if the NBASIC application window has focus, otherwise returns 0
PEEK(61803) Current font size
PEEK(65104) Random number from 0 to 255
PEEK(65260) Current graphics font size (standard edition only)

POKEs

POKE 847,n Sets the style of page numbers when a program is printed (0-no page numbers, 1-p, 2-Page p)
POKE 869,n Alias the DIR statement to XDIR (0-disable, 1-enable) (Version 1.6 or later, standard edition only)
POKE 872,n Sets the printer font size (0-default, 6-24 font size)
POKE 875,n Sets the style of line numbers when a program is printed (0-default, 1-right justifed with leading spaces, 2-right justified with leading 0s, 3-left justified with trailing spaces)
POKE 1032,n:EXIT Performs a cold reboot (3)
POKE 1032,n:NEW Performs a warm reboot (3)
POKE 1107,n Turns Num Lock on (255) or off (0)
POKE 1210,n Turns Scroll Lock on (255) or off (0)
POKE 1221,n Shows syntax errors when program lines are added or edited (255) or default (0) (standard edition only)
POKE 1966,n Shows the prompt after every command event (34) or default (0)
POKE 1967,n Turns the key autorepeat on (0) or off (18)
POKE 1969,n Restores a program erased by the NEW statement (224) (Version 1.3 or later)
POKE 1993,n Causes a beep in the GETALNUM$, GETALPHA$, GETDIGIT$ and GETYN$ functions if an invalid character is pressed on the keyboard (255) or default (0) (standard edition only)
POKE 1994,n Sets the foreground color (0-15) or resets the foreground color to the default (255)
POKE 1995,n Sets the background color (0-15) or resets the background color to the default (255)
POKE 1999,n Clears the type-ahead buffer (117)
POKE 2821,n Direct print (0-disable, 15 enable)
POKE 3080,n Adjusts cursor blink speed (0-255,128-default) (Version 2.0 or later)
POKE 3800,n Sets the case (64-lowercase, 128-uppercase) used by EXEC &HDA83 (change program case)
POKE 3998,n Turns inverse mode on (255) or off (0)
POKE 4879,n Disables all statement compatibility modes (5) (Version 1.4 or later)
POKE 5072,n Show volume folder in VOLUMES statement (0-disable, 37-enable) (Version 1.6 or later)
POKE 5382,n Adjusts cursor style (0-10,0-default) (Version 2.0 or later)
POKE 5776,n Turns Caps Lock on (255) or off (0)
POKE 5794,n BREAK key trapping:
If no event handler set with ON BREAK (0-disable, 255-enable) (Version 1.0 or later)
If event handler set with ON BREAK (0-clear, &H81-enable, &H80-disable, &H8F-stop) (Version 2.0 or later)
POKE 6023,n Temporarily disables the carriage return on the last row (scrolling) (128)
POKE 6732,n Performs a warm reboot (4) (Version 1.4 or later)
POKE 6809,n Always recompile program on load (0-disable, 2-enable)
POKE 6817,n Causes the LIST statement to pause after each screenful of information (255) or disables pausing (0)
POKE 7695,n Turns tracing on (255) or off (0)
POKE 7822,n Show file count in file statements (0-disable, 238-enable) (Version 1.5 or later)
POKE 8204,n Scrolls the screen (2)
POKE 8655,n Show file names in file statements (0-disable, 15-enable) (Version 1.5 or later)
POKE 9305,n Busy idle enable (0-enable, 5-disable)
POKE 9388,n Sets the window state (1-minimize, 6-restore, 8-maximize, 15-resize, 32 (standard edition only)-toggle full screen) used by EXEC &H092E (set window state)
POKE 10131,n Clears the screen when a program ends (8) (Version 1.4 or later)
POKE 10516,n Enables (2) or disables (0) the LOCATE statement compatibility mode (LOCATE column,row) (Version 1.4 or later)
POKE 10483,n Enables (0) or disables (5) the ATTRIB statement (Version 2.0 or later)
POKE 11266,n Sets the screen border color (0-15 color, 255-default)
POKE 11799,n Enables (0) or disables (128) the PAUSE key
POKE 12393,n Causes the DIR statement to sort the directory list (255) or disables sorting (0) (NOTE: directory lists on Windows® NTFS and HPFS volumes are always sorted)
POKE 12420,n Enables (15) or disables (0) the CLEAR statement compatibility mode (clears all variables) (Version 1.4 or later)
POKE 12454,n Enables (0) or disables (5) the APPEND statement
POKE 12857,n Enables (0) or disables (127) the MERGE statement (Version 2.0 or later)
POKE 13141,n Causes the DIR statement to pause after each screenful of information (255) or disables pausing (0)
POKE 15041,n Enables (7) or disables (0) the GET statement compatibility mode (does not wait for a keypress) (Version 1.4 or later)
POKE 16814,n Enables (0) or disables (9) the SEARCH statement showing volumes with no matching files (Version 2.3 or later, standard edition only)
POKE 17984,n Enables (0) or disables (2) clearing of the area saved by the SCREEN BACKUP statement (Version 1.4 to 1.6)
(Note: not used, Version 2.0 or later)
POKE 18320,n Volume format for VOLUMES statement (0-details on right, 1-details on right/use dashes, 2-details on left, 3-details on left/use dashes) (Version 1.0.1 or later)
POKE 18450,n Sets the $XREF statement output to uppercase (0) or lowercase (4) (Version 1.4 or later)
POKE 19096,n Causes the PROFILE statement to pause after each screenful of information (255) or disables pausing (0) (standard edition only)
POKE 19335,n Restores the default prompt (252) (standard edition only)
POKE 19920,n Enables (255) or disables (0) automatic line numbering (Version 1.0 to 1.6, standard edition only)
(Note: not used, Version 2.0 or later)
POKE 19941,n Enables (0) or disables (5) the COPY statement
POKE 20240,n Enables clearing keyboard buffer prior to user input (1) or disables clearing (0) (Version 2.0 or later)
POKE 20417,n Enables (0) or disables (5) the KILL statement
POKE 20604,n Causes a formfeed (12) or a linefeed (13) on an open printer (Version 1.1 or later, standard edition only)
POKE 21493,n Restores the foreground and background colors when a program ends (128)
POKE 21505,n Causes the KILL statement to us the recycle bin when deleting files (1), or disables using the recycle bin (0) (Version 1.0.1 or later)
POKE 21568,n Causes the log file to be flushed to disk (1) (Version 1.5 or later)
POKE 21840,n Configures where File|Load... and File|Save... show file name (0-status bar, 128-screen) (Version 2.2 or later)
POKE 22469,n Enables upper case only (255) or disables upper case only (0)
POKE 23028,n Causes the VOLUMES statement to pause after each screenful of information (255) or disables pausing (0)
POKE 23168,n Sets cursor to blinking cursor (0) or non-blinking cursor (224)
POKE 23613,n Sets MIDDLE statement default option to center (0), after (1) or before (2) (Version 2.3 or later)
POKE 23792,n Turns confirmations on (255) or off (0)
POKE 24352,n Clears the recall history (128)
POKE 24795,n Enables (0) or disables (5) the MOVE statement
POKE 25422,n Enables (0) or disables (5) the RENAME statement
POKE 26435,n Shows syntax errors if error trapping is enabled (197) or traps syntax errors (0)
POKE 26892,n Sets printer left margin (1/100")
POKE 26893,n Sets printer top margin (1/100")
POKE 26894,n Sets printer right margin (1/100")
POKE 26895,n Sets printer bottom margin (1/100")
POKE 27217,n Lists the destination line when a line is split (92) or default (0) (Version 1.0 to 1.6, 2.2 or later, standard edition only)
POKE 27468,n Specifies case to use in FORMAT statement (0-detect case, 1-upper case, 2-lower case) (Version 2.2 or later, standard edition only)
POKE 27523,n Turns profiling on (255) or off (0) (standard version only)
POKE 28368,n Enables (0) or disables (5) the CREATE statement
POKE 28779,n Enables (0) or disables (32) the LIST statement
POKE 29538,n Selects character set (0-ANSI, 161-Greek, 162-Turkish, 177-Hebrew, 178-Arabic, 186-Baltic, 204-Russian, 238-East Europe, 255-OEM) (Version 1.2 to 1.6)
(Note: not used, Version 2.0 or later)
POKE 30471,n Enables (0) or disables (32) the BACKUP statement
POKE 30809,n Sets the initial graphics foreground and background colors to the default graphics colors (0) or the current text foreground and background colors (5) (Version 1.4 or later, standard version only)
POKE 31160,n Sets the initial graphics drawing position to the top left of the screen (0) or the center of the screen (127) (Version 1.4 or later, standard version only)
POKE 31567,n Turns debugging on (255) or off (0) (standard version only)
POKE 32148,n Sets the graphics foreground (drawing) color (0-15 color, 255-default) (standard version only)
POKE 32149,n Sets the graphics background color (0-15 color, 255-default) (standard version only)
POKE 32783,n Shows (0) or hides (5) the cursor in EXEC &H9305 (press any key to continue)
POKE 34122,n Enables (0) or disables (32) the VOLINI statement
POKE 34352,n Initializes the random number generator (5)
POKE 34364,n Enables (0) or disables (5) the SAVE statement
POKE 37960,n Sets the format (0-auto, 1-"REM ", 2-"rem ", 14-"'", 15-"' ") used by the REMARK statement (Version 1.0.1 or later)
POKE 38140,n Sets the fill color (0-15 color, 255-default) for the BOX, CHORD, CIRCLE, LINE and PIE statements (standard version only)
POKE 38829,n Restores the default startup colors (4)
POKE 39072,n Enables (1) or disables (0) renumbering of only numbered lines in the current program (Version 1.5 or later)
POKE 39336,n Sets character output delay (Version 2.2 or later)
POKE 41223,n Enables (0) or disables (214) control character sequences
POKE 41307,n Displays the default volume as the prompt (10) or default (0)
POKE 42302,n Causes the DIR statement to use wide list format (255) or disables wide list format (0)
POKE 43113,n Causes a carriage return to be printed after the prompt (0) or disables printing a carriage return after the prompt (127)
POKE 45254,n Enables (20) or disables (0) extended information in the ABOUT statement
POKE 46090,n Enables (0) or disables (214) escape sequences
POKE 46966,n Selects printer character set (0-ANSI, 161-Greek, 162-Turkish, 177-Hebrew, 178-Arabic, 186-Baltic, 204-Russian, 238-East Europe, 255-OEM) (Version 1.2 to 1.6, standard version only)
(Note: not used, Version 2.0 or later)
POKE 47104,n Causes a space to be printed (1) after numbers in the PRINT statement or disables printing a space after a number (0) (Version 2.1 or later)
POKE 47952,n Enables (80) or disables (0) the VOLUMES statement verbose mode
POKE 49452,n Sets a delay (in milliseconds) between statements during execution (0-255)
POKE 49549,n Sets the option (0-line numbers, 1-labels, 2-variables, 3-user-defined functions, 5-statements, 6-functions) used by EXEC &HD3F8 (cross reference)
POKE 49565,n Turns the cursor on (1) or off (0)
POKE 49864,n Enables (0) or disables (5) the BUILD statement (Version 1.5 or later, standard edition only)
POKE 49956,n Causes the READ statement to read data from the first line in the current program that contains a DATA statement (2)
POKE 51408,n Enable tracing of REM statements (64), or disable tracing (0) (Version 2.0 or later)
POKE 51520,n Timer event trapping:
(0-disable, 1-enable, 255-stop) (Version 1.0 or later)
(0-clear, &H81-enable, &H80-disable, &H8F-stop) (Version 2.0 or later)
POKE 51816,n Causes editing to start at the beginning (1) or the end (0) of the line in the EDIT statement (Version 2.1 or later)
POKE 53904,n Causes the DUMP statement to pause after each screenful of information (255) or disables pausing (0)
POKE 54144,n Restores the default application window title (83) (standard edition only)
POKE 54801,n Displays the current time in the prompt (0-disable, 119-enable (am/pm), 239-enable (24 hour))
POKE 56136,n Sets recall history limit (0-no limit)
POKE 58175,n Causes the cursor to be moved (0) to the row,column specified in the FRAME or BAR statements or not to be moved at all (22) (Version 2.1 or later)
POKE 58875,n If a log file is open, turns logging on (1), turns logging off (0), or stops logging and closes the log file (255) (standard version only)
POKE 59250,n Sets the color (0-15) used by EXEC &H4812 (clear screen)
POKE 59325,n If multiple screens are restored by the SCREEN RESTORE statement, updates screen after each restore (0) or updates screen only after last restore (255) (Version 1.4 to 1.6)
(Note: not used, Version 2.0 or later)

EXECs

EXEC &H092E Changes the window state using the value in memory location 9388, if 1-minimize, 6-restore, 8-maximize, 15-resize, 32 (standard edition only)-toggle full screen
EXEC &H44D0 Lists available printers
EXEC &H4812 Clears the screen using the color in memory location 59250
EXEC &H52BC Displays the startup message if specified (standard edition only)
EXEC &H611A Performs memory garbage collection (Version 2.0 or later)
EXEC &H612C Clears cached code objects (Version 2.0 or later)
EXEC &H77F6 Resets and initializes runtime
EXEC &H9305 Displays "Press any key to continue" and waits for a keypress
EXEC &HD1C8 Updates status indicators in main window
EXEC &HD3F8 Cross references the current program using the option in memory location 49549
EXEC &HDA83 Changes the current program to uppercase if the value in memory location 3800 is 128 or lowercase if the value is 64

USRs

DEF USR=15615:A=USR(time#) Determines if year is leap year from time (-1-yes,0-no) (Version 2.0 or later)
A$="TEST":DEF USR=12129:A=USR(VARPTR(A$)) Gets width of string using graphics font (Version 2.3 or later, standard edition only)
DEF USR=12288:A=USR(0) Gets height of graphics font (Version 2.3 or later, standard edition only)
DEF USR=17968:A=USR(ASC("A")) Gets currently defined (DEF DBL/SNG/INT/STR) variable type (Version 2.3 or later)
DEF USR=20366:A=USR(row*256+column) Gets foreground color at row,column (Version 2.0 or later)
DEF USR=20367:A=USR(row*256+column) Gets background color at row,column (Version 2.0 or later)
DEF USR=20384:A=USR(row*256+column) Is extended character at row,column (1-yes, 0-no) (Version 2.0 or later)
DEF USR=21080:A$="ACCOUNT42":A=USR(VARPTR(A$)) Calculates CRC32 of string (Version 2.0 or later)
DEF USR=21148:F$="PROGRAMS:TEST.BAS":A=USR(VARPTR(F$)) Checks volume and filename for validity (Version 1.5.2 or later)
DEF USR=21182:A=USR(time#) Gets day of month from time (Version 2.0 or later)
DEF USR=21190:A=USR(time#) Gets last day of month from time (Version 2.0 or later)
DEF USR=24120:A=USR(row*256+column) Gets ascii code of character at row,column (Version 2.0 or later)
DEF USR=24894:A$="PROGRAMS":C=USR(VARPTR(A$)) Determines if volume exists (-1-yes,0-no) (Version 2.0 or later)
DEF USR=24912:A$="PROGRAMS":C=USR(VARPTR(A$)) Determines if volume is mapped to a valid Windows folder (-1-yes,0-no) (Version 2.0 or later)
DEF USR=24930:A$="PROGRAMS":C=USR(VARPTR(A$)) Determines if volume is the default volume (-1-yes,0-no) (Version 2.0 or later)
DEF USR=24948:A$="PROGRAMS":C=USR(VARPTR(A$)) Determines if volume is writable (-1-yes,0-no) (Version 2.0 or later)

Check back frequently for updated PEEKs, POKEs, EXECs and USRs.
Copyright © 2003-2019 SylvaWare