home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / BASIC / TSRBAS20.ZIP / TSRBASIC.DOC < prev    next >
Encoding:
Text File  |  1991-04-03  |  74.0 KB  |  2,245 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.           TsrBasic, a Terminate and Stay Resident BASIC Interpreter
  8.           Version 2.0, Copyright 1990-1991 Anthony F. Stuart
  9.  
  10.  
  11.           1.   Introduction
  12.  
  13.           TsrBasic lets you write Terminate and Stay Resident (TSR)
  14.           programs in BASIC. It supports:
  15.  
  16.                1) Pop up applications that are recalled with a
  17.                user defined hotkey sequence.
  18.  
  19.                2) Background tasks that are recalled after a
  20.                specified period of time has elapsed.
  21.  
  22.                3) Screen savers that are recalled after a specified
  23.                period of keyboard inactivity.
  24.  
  25.           The entire interpreter can be recalled as well, giving you a
  26.           powerful programmable calculator at your fingertips.
  27.  
  28.           TsrBasic simplifies BASIC programming by relaxing data type
  29.           checking restrictions. This means you do not have to use special
  30.           suffixes like $ and # to specify the type of data a variable will
  31.           hold. Any variable can hold any type of data, either textual or
  32.           numeric. Conversions are performed when necessary.
  33.  
  34.           Structured programming is a snap with TsrBasic's IF/THEN/ELSE/
  35.           END IF statement, which supports multiline THEN and ELSE clauses
  36.           and nested IF's. The conventional form of the IF/THEN/ELSE
  37.           statement is supported as well.
  38.  
  39.           TsrBasic's powerful screen handling functions let you select
  40.           video attributes, define text windows for input and output, and
  41.           save and restore portions of the screen. TsrBasic supports direct
  42.           video access for speed or ROM-BIOS/DOS mode for compatibility
  43.           with nonstandard video adapters.
  44.  
  45.           TsrBasic lets you execute the contents of a character string so
  46.           that you can evaluate arithmetic expressions on the fly. You can
  47.           also use this feature to construct powerful user defined
  48.           functions.
  49.  
  50.           TsrBasic compiles your program into intermediate code and
  51.           interprets the intermediate code. This results in fast and
  52.           efficient program execution. You can display the intermediate
  53.           code if you wish. TsrBasic also lets you convert your BASIC
  54.           program into an executable (.exe) file that can be invoked from
  55.           DOS.
  56.  
  57.           Version 2.0 of TsrBasic features even better video support,
  58.           including graphics, as well as many new and improved functions
  59.  
  60.  
  61.           TsrBasic Reference Manual                                  Page 1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.           and statements. If you are familiar with TsrBasic, version 1.0,
  75.           see the file named changes.doc on the distribution disk for more
  76.           information on the new features and bug fixes for version 2.0.
  77.  
  78.  
  79.           2.   About this Document...
  80.  
  81.           The remainder of this document provides you with the information
  82.           you need to know to take advantage of the special features of
  83.           TsrBasic. It is intended for people who have some experience with
  84.           the BASIC programming language. If you do not have any experience
  85.           with BASIC, you may wish to consult a more detailed book on
  86.           programming in BASIC before reading this document.
  87.  
  88.  
  89.           3.   Variables and Arrays
  90.  
  91.           TsrBasic variables consist of a letter followed by zero or more
  92.           letters, digits, underscores, periods, dollar signs, number
  93.           signs, percent signs or exclamation marks. Variable names are
  94.           case sensitive, e.g. LastName and lastname are two separate
  95.           variables.
  96.  
  97.           Arrays must be declared using the DIM statement before they are
  98.           referenced. Arrays may have an arbitrary number of dimensions.
  99.           The extent of each dimension is from zero to the value(s)
  100.           specified in the DIM statement.
  101.  
  102.           The TsrBasic SORT and SHIFT statements make working with arrays
  103.           easier and more efficient. The SORT statement sorts a one
  104.           dimensional array into ascending or descending order. The SHIFT
  105.           statement shifts the elements of an array up or down one or more
  106.           positions.
  107.  
  108.           Arrays and variables must be initialized before they are used,
  109.           i.e. a value must be stored in the variable or array element
  110.           before it is read. Failure to do so will generate an
  111.           uninitialized variable error message. Note that PARSE,
  112.           SCREENSAVE, SCREENRESTORE and SUSPEND do not support storing into
  113.           an array.
  114.  
  115.  
  116.           4.   Constants
  117.  
  118.           Numeric constants may be written using any of the following
  119.           formats:
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.           Page 2                                  TsrBasic Reference Manual
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.                Format         Example
  144.                ------         -------
  145.  
  146.                integer        42
  147.                decimal        3.14
  148.                exponential    314e-2
  149.                hexadecimal    0x1b
  150.                octal          033
  151.  
  152.           TsrBasic boolean logical operations use zero for false and
  153.           nonzero (usually 1) for true.
  154.  
  155.           String constants are written as sequences of characters enclosed
  156.           by double quotes. The closing double quote is required. A double
  157.           quote may be included in a character string by concatenating the
  158.           double quote character, chr(34), to it.
  159.  
  160.  
  161.           5.   Operators
  162.  
  163.           TsrBasic supports the standard set of BASIC operators, plus some
  164.           operators for doing bitwise operations on 16 bit quantities. The
  165.           following list of operators is organized from lowest precedence
  166.           to highest precedence. Operators of the same precedence are
  167.           evaluated from left to right.
  168.  
  169.                Operator       Precedence     Description
  170.  
  171.                and            1              logical and
  172.                or             1              logical or
  173.  
  174.                =              2              equal
  175.                <>             2              not equal
  176.                <              2              less than
  177.                <=             2              less than or equal
  178.                >              2              greater than
  179.                >=             2              greater than or equal
  180.  
  181.                -              3              subtract
  182.                +              3              add (or concatenate
  183.                                                   if strings)
  184.  
  185.                *              4              multiply
  186.                /              4              divide
  187.                mod            4              modulo
  188.                \              4              integer divide
  189.  
  190.                |              5              bitwise or     (16 bits)
  191.                &              5              bitwise and    (16 bits)
  192.                `              5              bitwise xor    (16 bits)
  193.  
  194.  
  195.  
  196.  
  197.           TsrBasic Reference Manual                                  Page 3
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.                ~              6              bitwise negate (16 bits)
  212.                -              6              arithmetic negate
  213.                not            6              logical negate
  214.  
  215.                ^              7              power
  216.  
  217.           The plus operator (+) performs addition if both operands are
  218.           numeric or concatenation if either operand is a string. This
  219.           means that you cannot use the plus operator to concatenate two
  220.           numbers. Use the CAT function for this purpose.
  221.  
  222.  
  223.           6.   Editor and Environment
  224.  
  225.           TsrBasic provides a simple interactive command mode that allows
  226.           you to enter and execute statements and commands. Program
  227.           statements are entered with line numbers, which must be in the
  228.           range 1-32767. Commands and immediate mode statements are entered
  229.           without line numbers. The backspace key can be used to delete the
  230.           last character entered. The escape key can be used to delete the
  231.           entire line.
  232.  
  233.           Note: Type control-c to terminate a runaway TsrBasic program.
  234.  
  235.           For more complex editing needs, the TsrBasic EDIT command can be
  236.           used to invoke an editor of your choice. The syntax of the EDIT
  237.           command is as follows:
  238.  
  239.                edit [line-number-spec]
  240.  
  241.           The EDIT command lets you use your favorite DOS editor to edit
  242.           the current program. Here's how it works:
  243.  
  244.           TsrBasic writes the current file, or the part specified by
  245.           line-number-spec to a temporary file. It then invokes the editor
  246.           specified by the EDITOR environment variable on the temporary
  247.           file. After you exit the editor, TsrBasic loads (if no
  248.           line-number-spec was used) or merges (if a line-number-spec was
  249.           used) the temporary file. See your DOS reference manual for more
  250.           information on environment variables.
  251.  
  252.           Because DOS is not reentrant, the EDIT command will not work when
  253.           you have recalled a suspended TsrBasic from the DOS shell. In
  254.           this case it will return a "DOS is busy" error. You can, however,
  255.           use the EDIT command when you have recalled TsrBasic from most
  256.           other applications, provided there is sufficient memory.
  257.  
  258.           Note that no default editor is supplied with TsrBasic.
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.           Page 4                                  TsrBasic Reference Manual
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.           7.   Suspend Statement
  280.  
  281.           The SUSPEND statement provides access to TsrBasic's terminate and
  282.           stay resident capabilities. Executing the SUSPEND statement will
  283.           cause TsrBasic to return to the environment from which it was
  284.           invoked. TsrBasic can be recalled by hotkey sequence, timer
  285.           expiration, or a period of keyboard inactivity, depending on
  286.           parameters specified in the SUSPEND statement. After recall,
  287.           TsrBasic executes the statement following the SUSPEND statement,
  288.           if one exists, or returns to command level.
  289.  
  290.           The syntax for SUSPEND is:
  291.  
  292.           suspend screen, key-code, key-flags, interval, inactivity, status
  293.  
  294.           All parameters are optional. Parameters to the right of the one
  295.           you wish to specify may be omitted. The parameters have the
  296.           following functions and defaults:
  297.  
  298.                screen - boolean, if true (1) save the contents of the
  299.                screen when the hotkey sequence is entered or the timer
  300.                interval expires so that the screen may be restored by
  301.                the next SUSPEND statement. The default is true.
  302.  
  303.                key-code - keyboard scan code that, when combined with
  304.                the key-flags parameter, will recall the interpreter.
  305.                This key-code should be selected from the list of
  306.                keyboard scan codes in Appendix D. The default is 0x30
  307.                (the b key).
  308.  
  309.                key-flags - keyboard flags for control, shift and alt
  310.                keys that, when combined with the key-code parameter,
  311.                will recall the interpreter. Possible values for the
  312.                keyboard flags are:
  313.  
  314.                     0x80 = insert on
  315.                     0x40 = caps lock on
  316.                     0x20 = num lock on
  317.                     0x10 = scroll lock on
  318.                     0x08 = alt key down
  319.                     0x04 = control key down
  320.                     0x02 = left shift down
  321.                     0x01 = right shift down
  322.  
  323.                These flags may be OR'd together, i.e. 0x02 | 0x04
  324.                represents shift+control, so that shift and control and
  325.                the key-code specified above must be held down 
  326.                simultaneously to recall the interpreter. The default 
  327.                is 0x06 (shift+control).
  328.  
  329.                interval - amount of time, in clock ticks, to wait 
  330.                before recalling the interpreter. This is used for 
  331.  
  332.  
  333.           TsrBasic Reference Manual                                  Page 5
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.                background tasks. Since there are approximately 18 
  347.                clock ticks per second, multiply the number of seconds
  348.                you want to wait by 18 to get the interval. A value of
  349.                0 disables the interval timer and the interpreter is 
  350.                recalled using the hotkey sequence (or keyboard timer,
  351.                if specified). The default is zero (disabled).
  352.  
  353.                inactivity - amount of time, in clock ticks, to wait
  354.                after last keystroke is entered before recalling the 
  355.                interpreter. This is used for screen savers. The 
  356.                default is zero (disabled).
  357.  
  358.                status - a variable which is used to hold an integer
  359.                value returned by SUSPEND. This variable is set to 0 
  360.                if the program was recalled by the hotkey sequence, 1 
  361.                if recalled by the interval timer and 2 if recalled by 
  362.                the keyboard inactivity timer.
  363.  
  364.           Note: the combined defaults for SUSPEND are:
  365.  
  366.                suspend 1, 0x30, 0x06, 0, 0
  367.  
  368.           So, if you enter SUSPEND without options, the interpreter will
  369.           suspend and you can return to it by entering ctrl-shift-b.
  370.  
  371.           Here is a simple terminate and stay resident program that
  372.           executes in the background to print the time in the upper right
  373.           hand corner of the screen every second. Note how the status
  374.           argument is used to distinguish between timer and hotkey events:
  375.  
  376.                100 print "Press ctrl-shift-b to terminate clock."
  377.                110 suspend 0, 0x30, 0x06, 18, 0, timer
  378.                120 if not timer then cls : end
  379.                130 display 0, 72, time()
  380.                140 goto 110
  381.  
  382.  
  383.           8.   Lookup Function
  384.  
  385.           Sometimes it is useful to be able to specify things like colors
  386.           by meaningful names, and other times it is useful to be able to
  387.           specify them by numbers. TsrBasic avoids this conflict by
  388.           providing a LOOKUP function to convert meaningful names to
  389.           numbers.
  390.  
  391.           The LOOKUP function can be used in instances where names are more
  392.           appropriate, such as:
  393.  
  394.                100 foreground lookup ("red")
  395.                110 background lookup ("black")
  396.                120 print "The time is "; time()
  397.  
  398.  
  399.  
  400.  
  401.           Page 6                                  TsrBasic Reference Manual
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.           and numbers can be used when they are more appropriate:
  415.  
  416.                100 for i = 1 to 15
  417.                110    foreground i
  418.                120    print "This is color "; i
  419.                130 next i
  420.  
  421.           The following table summarizes the names that LOOKUP can map to
  422.           numbers.
  423.  
  424.                black     0         hres2     6         fill      3
  425.                blue      1         text      7         or        0
  426.                green     2         herc      8         and       1
  427.                cyan      3         mres16    13        reset     2
  428.                red       4         hres16    14        set       3
  429.                magenta   5         eres2     15        xor       4
  430.                yellow    6         eres16    16        mda       1
  431.                white     7         vres2     17        cga       2
  432.                low       0         vres16    18        ega       4
  433.                high      8         mres256   19        vga       8
  434.                bw40      0         default   -1        mga       16
  435.                co40      1         direct    0         hgc       32
  436.                bw80      2         bios      1
  437.                co80      3         dos       2             
  438.                mres4     4         graphics  3
  439.                mres0     5         outline   2
  440.  
  441.           The LOOKUP function provides name to number mapping for the
  442.           following statements:
  443.  
  444.                background          config              mode
  445.                box                 foreground          put
  446.                circle              get                 type
  447.                color               intensity
  448.  
  449.           See the detailed description of the statement for more
  450.           information on the LOOKUP mappings that can be used.
  451.  
  452.  
  453.           9.   Text Windows
  454.  
  455.           The following TsrBasic statements and functions provide support
  456.           for TsrBasic text windows:
  457.                                  
  458.                background          foreground          savescreen
  459.                blank               getscreen           scroll
  460.                border              init                type
  461.                column              intensity           winbottom
  462.                csroff              locate              winleft
  463.                csron               page                winright
  464.                csrbottom           refresh             wintop
  465.                csrtop              restorescreen
  466.                display             row
  467.  
  468.  
  469.           TsrBasic Reference Manual                                  Page 7
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.           TsrBasic text windows are created using the WINBOTTOM, WINLEFT,
  485.           WINRIGHT and WINTOP statements to define the edges of the window.
  486.           Subsequent text input/output using the INPUT and PRINT statements
  487.           is directed to the window. The DISPLAY statement is used as an
  488.           alternative to PRINT to display text anywhere on the screen.
  489.  
  490.           The LOCATE statement positions the cursor relative to the top
  491.           left corner of the current window. Absolute cursor positioning is
  492.           accomplished using the COLUMN and ROW statements.
  493.  
  494.           The BORDER statement draws a border around the window.
  495.  
  496.           The FOREGROUND and BACKGROUND statements set the foreground and
  497.           background colors for text output. Colors are represented by
  498.           numbers in the range 0 to 7. The LOOKUP function can be used to
  499.           convert the following color names into color numbers:
  500.  
  501.                0 - black      4 - red
  502.                1 - blue       5 - magenta
  503.                2 - green      6 - yellow
  504.                3 - cyan       7 - white
  505.  
  506.           Note that the range of colors that can be displayed depends on
  507.           the video adapter in your PC.
  508.  
  509.           The INTENSITY statement selects the brightness of text
  510.           characters. Intensity is specified as either 0 or 1. The LOOKUP
  511.           function can be used to convert the following intensity names
  512.           into intensity numbers:
  513.  
  514.                0 - low
  515.                8 - high
  516.  
  517.           The contents of the current text window are saved into a TsrBasic
  518.           variable using the SAVESCREEN statement and restored using the
  519.           RESTORESCREEN statement.
  520.  
  521.           The CSRBOTTOM and CSRTOP statements set the size and shape of the
  522.           cursor. Each character position on the screen is composed of a
  523.           number of video scan lines. The number of scan lines depends on
  524.           the video adapter. The scan lines are numbered top down and range
  525.           from 0 to 6 for cga adapters and from 0 to 13 for other adapters.
  526.           If CSRTOP is set to 0 and CSRBOTTOM is set to the last scan line
  527.           in the cell (say 13 for an ega adapter) then the cursor will
  528.           occupy the whole cell. The CSROFF and CSRON statements can be
  529.           used to turn the cursor off (i.e. hide it) or back on.
  530.  
  531.           The TYPE statement selects the output mode for text. It is 
  532.           normally set to direct mode (0) for fast output. Other options
  533.           are 1 for BIOS access, 2 for BIOS/DOS access, and 3 for text in
  534.           graphics mode. The default is 0. Use 1 if you have any video
  535.  
  536.  
  537.           Page 8                                  TsrBasic Reference Manual
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.           problems with 0, use 2 if you want to redirect output using DOS
  551.           redirection capability. Use 3 for mixed text and graphics in
  552.           graphics modes (see MODE). The LOOKUP function can be used to map
  553.           the following type names to numbers:
  554.  
  555.                0 - direct
  556.                1 - bios
  557.                2 - dos
  558.                3 - graphics
  559.  
  560.  
  561.           10.  Graphics
  562.  
  563.           TsrBasic provides graphics support for CGA, EGA, VGA and Hercules
  564.           compatible video adapters. The following statements and functions
  565.           provide support for TsrBasic graphics:
  566.                                  
  567.                box            fill           mode
  568.                circle         get            moveto
  569.                clip           lineto         pixel
  570.                color          mapload        put
  571.                config         mapsave
  572.  
  573.           The MODE statement selects a graphics mode. The set of graphics
  574.           modes you may use is dependent on the type of video adapter that
  575.           is installed in your PC. The graphics mode is specified as an
  576.           integer number in the range -1 to 19. The LOOKUP function can be
  577.           used to convert a mode name into a mode number. The following
  578.           modes are supported:
  579.  
  580.           Name      Number    Res       Type      Colors       Adapter
  581.  
  582.           bw40      0         40x25     text      16    gray   cga,ega,vga
  583.           co40      1         40x25     text      16/8  color  cga,ega,vga
  584.           bw80      2         80x25     text      16    gray   cga,ega,vga
  585.           co80      3         80x25     text      16/8  color  cga,ega,vga
  586.           mres4     4         320x200   graph     4     color  cga,ega,vga
  587.           mres0     5         320x200   graph     4     gray   cga,ega,vga
  588.           hres2     6         640x200   graph     2     bw     cga,ega,vga
  589.           text      7         80x25     text      2     bw     mda,hgc
  590.           hgc       8         720x348   graph     2     bw     hgc
  591.           mres16    13        320x200   graph     16    color  ega,vga
  592.           hres16    14        640x200   graph     16    color  ega,vga
  593.           eres2     15        640x350   graph     2     bw     ega, vga
  594.           eres16    16        640x350   graph     16    color  ega, vga
  595.           vres2     17        640x480   graph     2     bw     vga
  596.           vres16    18        640x480   graph     16    color  vga
  597.           mres256   19        320x200   graph     256   color  vga
  598.  
  599.           In addition, the following mode is defined to let you exit
  600.           graphics mode and return to the default mode:
  601.  
  602.           default   -1        n/a       n/a       n/a   n/a    all
  603.  
  604.  
  605.           TsrBasic Reference Manual                                  Page 9
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.           You can determine the type of video adapter that is installed in
  620.           your PC, along with the x and y resolution, the number of colors,
  621.           and the current mode by using the CONFIG statement. The syntax
  622.           is:
  623.  
  624.             config xpix, ypix, colors, adapter, mode
  625.  
  626.           where xpix, ypix, colors, adapter and mode are variables. Xpix,
  627.           ypix and colors are the number of x pixels, y pixels and colors,
  628.           respectively, for the current mode. Adapter is the type of video
  629.           adapter and is one of the following:
  630.  
  631.                1    mda (monochrome display adapter)
  632.                2    cga (color graphics adapter)
  633.                4    ega (enhanced graphics adapter)
  634.                8    vga (video gate array)
  635.                16   mga (multicolor graphics array)
  636.                32   hgc (hercules graphics card)
  637.  
  638.           The graphics coordinate system is layed out like the text
  639.           coordinate system with the origin (0,0) at the top left corner of
  640.           the screen. The bottom right corner varies, depending on the
  641.           graphics mode. In mode 14, for example, the bottom right corner
  642.           is 639, 199.
  643.  
  644.           If you want to display text and graphics on the same screen you
  645.           must use the TYPE statement to select the text in graphics mode
  646.           (type 3). After you exit graphics mode set the text type back to
  647.           0 for improved performance.
  648.  
  649.           The foreground and background colors for TsrBasic graphics modes
  650.           are specified using the COLOR statement.  Graphics colors are
  651.           independent of text colors.  Colors are represented by numbers in
  652.           the range 0 to 15. The LOOKUP function can be used to convert a
  653.           color name into a color number as described in the section on
  654.           text windows.
  655.  
  656.           The BOX and CIRCLE statements draw boxes and circles using a
  657.           "bounding" rectangle which describes the top left and bottom
  658.           right corners of the image. These statements also take an
  659.           argument that controls whether the image is to be filled or not.
  660.           The LOOKUP function can be used to map these control names to
  661.           numbers. The following control names are supported by the lookup
  662.           function:
  663.  
  664.                2 - outline
  665.                3 - fill
  666.  
  667.           Graphics images can be transferred from the screen to memory
  668.           using the GET statement and from memory to the screen using the
  669.           PUT statement. They can also be transferred from memory to a file
  670.  
  671.  
  672.  
  673.           Page 10                                 TsrBasic Reference Manual
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.           in bitmap form using the MAPSAVE statement and transferred from a
  687.           file to memory using the MAPLOAD statement.
  688.  
  689.           The PUT statement uses a control parameter to describe the method
  690.           for adding the image to the screen. The lookup function can be
  691.           used to map the following control names to numbers:
  692.  
  693.                name      number    effect
  694.  
  695.                or        0         superimpose image
  696.                and       1         intersection of images
  697.                reset     2         negative of image
  698.                set       3         normal image
  699.                xor       4         invert image
  700.  
  701.           The xor control value can be used twice in succession to add and
  702.           remove objects without modifying the background. This is useful
  703.           for animation.
  704.  
  705.           TsrBasic conserves DOS memory by using a graphics dynamic link
  706.           library (DLL) for graphics operations. This library is loaded
  707.           automatically when necessary and is freed when you exit graphics
  708.           mode using the mode -1 (default) statement. The graphics library
  709.           requires about 40 kb of memory. If you do not have at least 40 kb
  710.           of free memory you will not be able to load the graphics library
  711.           or do graphics operations.
  712.  
  713.           The image transfer statements allocate memory for the bitmap
  714.           directly from DOS. Note that multi-color high resolution images
  715.           produce large bitmaps and require larges amounts of memory. A
  716.           320x200 16 color bitmap requires about 64 kb. A 640x486 16 color
  717.           bitmap takes up more memory than you are likely to have in your
  718.           PC and will therefore need to be transferred in pieces (to
  719.           separate files), using multiple GET/MAPSAVE statements.
  720.  
  721.           The memory for image bitmaps is automatically freed when you exit
  722.           graphics mode with the mode -1 (default) statement. It may also
  723.           be explicitly freed by using PUT 0,0,0,0 to save a zero length
  724.           bitmap.
  725.  
  726.           If you have a Hercules compatible video adapter you will need to
  727.           execute MSHERC.EXE from DOS prior to entering graphics mode. 
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.           TsrBasic Reference Manual                                 Page 11
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.           11.  String Handling
  756.  
  757.           TsrBasic supports the usual set of BASIC string handling
  758.           functions, as well as PARSE, STRINS and STROVR, which are
  759.           specific to TsrBasic. The following list summarizes the string
  760.           handling functions available with TsrBasic:
  761.  
  762.                asc            left           space
  763.                cat            len            strins
  764.                chr            mid            strovr
  765.                copy           parse
  766.                instr          right
  767.  
  768.  
  769.           11.1      Parse Function
  770.  
  771.           The PARSE function breaks a string into pieces called tokens. The
  772.           syntax of the PARSE function is as follows:
  773.  
  774.           parse (buffer,literals,connectors,discards,delimiters,specials)
  775.  
  776.                buffer         - string to parse
  777.                literals       - grouping characters to discard
  778.                connectors     - grouping characters to save   
  779.                discards       - leading characters to discard
  780.                delimiters     - delimiters to discard
  781.                specials       - delimiters to save
  782.  
  783.           The buffer parameter is a variable containing the string to be
  784.           parsed. The PARSE function splits a token off the front end of
  785.           the buffer and returns it as the function value. The resulting
  786.           string, less the first token, is returned via the buffer
  787.           parameter. The returned buffer will be equal to the null string
  788.           when all the tokens have been parsed from it. The buffer
  789.           parameter should not be an array reference.
  790.  
  791.           The parameters represented by literals, connectors, discards,
  792.           delimiters and specials control the way the parsing is performed.
  793.           Each parameter is a character string or variable containing one
  794.           or more characters.
  795.  
  796.           The default for literals is double and single quote. The default
  797.           for discards is space and tab. The default for delimiters is
  798.           comma. The default for all other parameters is the null string.
  799.           These defaults give PARSE a default behavior equivalent to the
  800.           processing done by the INPUT statement.
  801.  
  802.           All parameters except for buffer are optional. Parameters to the
  803.           right of the one you wish to specify may be omitted. Here is an
  804.           example:
  805.  
  806.                after executing the following:
  807.  
  808.  
  809.           Page 12                                 TsrBasic Reference Manual
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.                     a = "one, two, three"
  824.                     b = parse (a)
  825.                     c = parse (a)
  826.                     d = parse (a)
  827.  
  828.                a is equal to "one"
  829.                b is equal to "two"
  830.                c is equal to "three"
  831.  
  832.           Literals and connectors are used to quote sequences of characters
  833.           so they are not affected by other parse actions. The difference
  834.           between literals and connectors is that characters in the list of
  835.           literals are not returned as part of the token whereas characters
  836.           from the list of connectors are. Note the difference in the
  837.           following example, where single quote is used first as a literal
  838.           and then as a connector:
  839.  
  840.                after executing the following:
  841.  
  842.                     a = "'hello world'"
  843.                     b = parse (a, "'")
  844.  
  845.                     a = "'hello world'"
  846.                     c = parse (a, "", "'")
  847.  
  848.                b is equal to "hello world"
  849.                c is equal to "'hello world'"
  850.  
  851.           Discards are a list of characters to strip from the beginning of
  852.           the token. They are normally used to strip preceding spaces or
  853.           tabs.
  854.  
  855.           Delimiters and Specials are characters that mark the end of a
  856.           token. The difference between them is that delimiters are not
  857.           returned as part of the token whereas specials are returned as
  858.           the next token. Here is an example:
  859.  
  860.                after executing the following:
  861.  
  862.                     a = "execute 3 + 4 * 5"
  863.                     b = parse (a, "", "", "", " ", "+*")
  864.                     c = parse (a, "", "", "", " ", "+*")
  865.                     d = parse (a, "", "", "", " ", "+*")
  866.                     e = parse (a, "", "", "", " ", "+*")
  867.                     f = parse (a, "", "", "", " ", "+*")
  868.                     g = parse (a, "", "", "", " ", "+*")
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.           TsrBasic Reference Manual                                 Page 13
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.                b is equal to execute
  892.                c is equal to 3
  893.                d is equal to +
  894.                e is equal to 4
  895.                f is equal to *
  896.                g is equal to 5
  897.  
  898.           The PARSE function is well suited to being used in a loop to
  899.           initialize an array of tokens, as follows:
  900.  
  901.                100 tokcnt = 0
  902.                110 dim token(30)
  903.                120 print "enter text: ";
  904.                130 line input text
  905.                140 if text = "" then goto 180
  906.                150    token(tokcnt) = parse (text)
  907.                160    tokcnt = tokcnt + 1
  908.                170 goto 140
  909.                180 print "done"
  910.  
  911.  
  912.           11.2      Strins Function
  913.  
  914.           The STRINS function inserts a string into the middle of another
  915.           string. Here is its syntax:
  916.  
  917.           newstr = strins (oldstr, start, midstr)
  918.  
  919.           The string represented by midstr is inserted into oldstr starting
  920.           at an offset of start into oldstr to produce newstr. For example:
  921.  
  922.                after executing the following:
  923.  
  924.                     oldstr = "advance"
  925.                     midstr = "THANKS"
  926.                     newstr = strins (oldstr, 4, midstr)
  927.  
  928.               newstr is equal to "advTHANKSance"
  929.  
  930.  
  931.           11.3      Strovr Function
  932.  
  933.           The STROVR function overlays a string onto the middle of another
  934.           string. Here is the syntax for STROVR:
  935.  
  936.           newstr = strovr (oldstr, start, midstr)
  937.  
  938.           The string represented by midstr is overlayed onto oldstr
  939.           starting at an offset of start into oldstr to produce newstr, as
  940.           follows:
  941.  
  942.  
  943.  
  944.  
  945.           Page 14                                 TsrBasic Reference Manual
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.                after executing the following:
  960.  
  961.                     oldstr = "The quick fox jumps over the lazy dog"
  962.                     midstr = "cat"
  963.                     newstr = strovr (oldstr, 11, midstr)
  964.  
  965.                newstr is equal to "The quick cat jumps over the lazy dog"
  966.  
  967.           This function is roughly equivalent to the MID statement in other
  968.           versions of BASIC.
  969.  
  970.  
  971.           12.  File Operations
  972.  
  973.           TsrBasic supports simple file operations on standard ASCII files.
  974.           The following operations are supported:
  975.  
  976.                access              input               print
  977.                close               line input          tab
  978.                eof                 open
  979.  
  980.           The OPEN statement opens a file. The mode parameter describes the
  981.           access mode for the file. Possible values of mode are:
  982.  
  983.                "r"  open existing file for reading
  984.                "w"  truncate or create for writing
  985.                "a"  write to end of existing file
  986.                "r+" open existing file for reading and writing
  987.                "w+" truncate or create new file for reading and writing
  988.                "a+" allow reading and writing at end of file
  989.  
  990.           Append "b" to any of the above modes to access the file in binary
  991.           mode. This prevents carriage return/newline and control-z
  992.           mapping. 
  993.  
  994.           13. Execute Statement
  995.  
  996.           The EXECUTE statement translates and executes its single string
  997.           expression argument. This argument can be either a TsrBasic
  998.           statement-list or a command. Here is an example of how it can be
  999.           used to implement a simple calculator:
  1000.  
  1001.                100 print "enter expression: ";
  1002.                110 line input expression
  1003.                120 if expression = "quit" then end
  1004.                130 execute "print " + expression
  1005.                140 goto 100
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.           TsrBasic Reference Manual                                 Page 15
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.           14.  If Statement
  1028.  
  1029.           The TsrBasic IF statement takes two forms. One is the
  1030.           conventional:
  1031.  
  1032.           if expression then statement-list [else statement-list]
  1033.  
  1034.           where statement-list is a list of colon separated statements.
  1035.  
  1036.           The other form of the TsrBasic IF statement is designed to
  1037.           simplify structured programming. It is coded as follows:
  1038.  
  1039.               if expression
  1040.                  then
  1041.                     statement-list
  1042.                     ...
  1043.                 [else
  1044.                     statement-list
  1045.                     ...]
  1046.               end if
  1047.  
  1048.           Any number of lines of statement-lists can appear in the THEN and
  1049.           ELSE clauses, and they may include nested IF statements. The only
  1050.           requirement for this form of the IF statement is that the THEN,
  1051.           ELSE and END IF keywords appear on separate lines. Note that the
  1052.           ELSE clause is optional.
  1053.  
  1054.  
  1055.           15.  Link Command
  1056.  
  1057.           The LINK command links the TsrBasic interpreter with the current
  1058.           program to create a DOS executable file. The TsrBasic program can
  1059.           then be invoked just like any other DOS program. It can even get
  1060.           access to command line arguments using the ARGC and ARGV
  1061.           functions. Here is an example of a simple program that will get
  1062.           the name of a file from the DOS command line and list it to the
  1063.           console. See the description of file operations in section 12 for
  1064.           more information.
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.           Page 16                                 TsrBasic Reference Manual
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.                100 if argc() <> 1
  1096.                110    then
  1097.                120       print "usage: list <file>"
  1098.                130       end
  1099.                140 end if
  1100.                150 open #1, "r", argv (1)
  1101.                160 if not eof (1)
  1102.                170    then
  1103.                180       line input #1, buf
  1104.                190       print buf
  1105.                200       goto 160
  1106.                210 end if
  1107.                220 close #1
  1108.  
  1109.           This program can be converted into an executable file using the
  1110.           LINK command. The resulting .exe file can then be executed from
  1111.           the DOS command line with a single argument specifying a file to
  1112.           list.
  1113.  
  1114.           Note: the LINK command writes the current settings of the command
  1115.           line options for data area, program and symbol table size to the
  1116.           .exe file. These sizes do not need to be specified again when the
  1117.           resulting .exe file is executed.
  1118.  
  1119.  
  1120.           16.  Command Line Options
  1121.  
  1122.           TsrBasic supports the following command line options. Note that
  1123.           they are case sensitive and must be specified using lower case.
  1124.  
  1125.                tsrbasic [-d<n>] [-p<n>] [-s<n>] [files]
  1126.  
  1127.           The -d<n> option defines the amount of storage allocated for the
  1128.           data defined in DATA statements. The <n> parameter specifies the
  1129.           number of data elements that can be defined in your program. The
  1130.           default is -d100, which provides storage for 100 elements.
  1131.           Increase this parameter if you see a "Too many data items" error
  1132.           message.
  1133.  
  1134.           The -p<n> option defines the amount of storage allocated for the
  1135.           intermediate code program. The <n> parameter is specified in
  1136.           units of intermediate code instructions. The default is -p750
  1137.           which represents 750 intermediate code instructions and is
  1138.           roughly equivalent to 300 lines of TsrBasic source code. Increase
  1139.           this parameter if you see a "Program too long" error message.
  1140.  
  1141.           The -s<n> option defines the amount of storage allocated for the
  1142.           symbol table. The <n> parameter specifies the maximum number of
  1143.           symbols. A symbol table entry is required for each variable,
  1144.           array and literal, including those defined in immediate mode. The
  1145.           default is -s150. Increase this parameter if you see a "Too many
  1146.           symbols" error message.
  1147.  
  1148.  
  1149.           TsrBasic Reference Manual                                 Page 17
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.           One or more TsrBasic source files can be specified on the command
  1164.           line. These files are processed in the order they are specified.
  1165.           In order to be executed, a file must have a RUN command in it.
  1166.           The interactive command processor is entered after the last file
  1167.           is processed.
  1168.  
  1169.  
  1170.           17. Error Handling
  1171.  
  1172.           TsrBasic errors fall into two categories: compilation errors and
  1173.           runtime errors.
  1174.  
  1175.           Compilation errors reflect errors in your source code that must
  1176.           be corrected before the program can be executed. The most common
  1177.           compilation error is "syntax error." If you get a syntax error,
  1178.           and the cause of the error is not immediately obvious, look very
  1179.           carefully at the statement and compare the syntax you specified
  1180.           to that which is listed in the summary of statements and
  1181.           functions. Be especially careful to check for invalid or missing
  1182.           operators.
  1183.  
  1184.           Runtime errors are errors that could not be detected at
  1185.           compilation time, like "Cannot open file." They may be trapped
  1186.           using an ON ERROR GOTO statement. The ERL, ERR and ERM functions
  1187.           can be used within an error handler to identify the line number
  1188.           on which the error occured as well as the error code and the
  1189.           error message text. An error handler can use the RESUME statement
  1190.           to retry the statement that caused the error, return control to
  1191.           the statement following the line that caused the error, or return
  1192.           control to some other location.
  1193.  
  1194.           See Appendix C for a complete list of error codes and messages.
  1195.  
  1196.  
  1197.           18. Using Keyboard Scan Codes
  1198.  
  1199.           When you press a key on the keyboard, the keyboard sends a scan
  1200.           code to the CPU indicating the key that was pressed. These scan
  1201.           codes are usually translated into characters to be used by your
  1202.           program. Several TsrBasic statements deal directly with raw scan
  1203.           codes.
  1204.  
  1205.           The SUSPEND statement, for instance, uses a scan code value to
  1206.           specify the hotkey that is used to recall the interpreter. The
  1207.           scan code values are taken from the list in Appendix D.
  1208.  
  1209.           The GETKEY and INKEY functions both return combinations of
  1210.           scancodes and characters. The return value consists of two bytes.
  1211.           The high order byte is the scan code and the low order byte is
  1212.           the character value, or zero for keys that do not have character
  1213.           values, such as function keys. To get the high order byte, or
  1214.  
  1215.  
  1216.  
  1217.           Page 18                                 TsrBasic Reference Manual
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.           scan code, right shift the returned value by 8 bits. This is
  1231.           equivalent to integer division by 2^8 or 256:
  1232.  
  1233.                scan_code = inkey () \ 256
  1234.  
  1235.           To get the low order byte, or character value, zero the high
  1236.           order byte by ANDing with 0xff or 255:
  1237.  
  1238.                char_code = inkey () & 255
  1239.  
  1240.           The following TsrBasic program will tell you the scan code and
  1241.           character associated with any key:
  1242.  
  1243.                100 print "Enter key, or q to stop";
  1244.                110 key = getkey ()
  1245.                120 scan_code = key \ 256
  1246.                130 char_code = key & 0xff
  1247.                140 print
  1248.                150 print "scan code = "; scan_code
  1249.                160 print "char code = "; char_code;
  1250.                170 print " ("; chr (char_code); ")"
  1251.                180 if char_code <> asc ("q") then goto 100
  1252.  
  1253.           Note that control-c will not terminate a program that is using
  1254.           GETKEY to read a scancode. Instead, GETKEY will return the
  1255.           scancode for control-c.
  1256.  
  1257.  
  1258.           Appendix A.    Summary of Statements and Functions
  1259.  
  1260.           A TsrBasic program is made up of statements and functions. When
  1261.           the RUN command is entered, the statements and functions are
  1262.           compiled into intermediate code and then executed. Commands
  1263.           differ from statements in that they are not compiled into
  1264.           intermediate code.
  1265.  
  1266.           Statements can be entered without a line number, in which case
  1267.           they are executed immediately, or with a line number, in which
  1268.           case they are stored as part of the current program. Multiple
  1269.           statements can be entered on a single line, separated by colons.
  1270.  
  1271.           Functions return values. They are passed an argument list
  1272.           consisting of zero or more expressions, separated by commas.
  1273.  
  1274.           Statements, functions and commands in TsrBasic are not case
  1275.           sensitive. They may be entered in any combination of lower and
  1276.           upper case.
  1277.  
  1278.           In the following summary, functions are indicated by an equal
  1279.           sign:
  1280.  
  1281.                n = abs (m)
  1282.  
  1283.  
  1284.  
  1285.           TsrBasic Reference Manual                                 Page 19
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.           and statements are indicated merely by the presence of the
  1299.           statement name:
  1300.  
  1301.                beep
  1302.  
  1303.           Some TsrBasic keywords can be referenced as both statements and 
  1304.           functions to get and/or set values. Keywords that can be used as
  1305.           both statements and functions have syntax specifications for each
  1306.           form.
  1307.  
  1308.           The following summary uses the letter b to represent boolean
  1309.           values, the letters n and m to represent integers, the letters r,
  1310.           s and t to represent strings and the letters x and y to represent
  1311.           real numbers. Values are converted to the appropriate type when
  1312.           necessary.
  1313.  
  1314.           Note: The trigonometric functions expect arguments expressed in
  1315.           radians. To convert degrees to radians, multiply by pi/180.
  1316.  
  1317.           y = abs(x)
  1318.                Return absolute value of x.
  1319.  
  1320.           b = access(s)
  1321.                Return true if file s exists.
  1322.  
  1323.           n = argc()
  1324.                Return number of arguments on dos command line.
  1325.  
  1326.           s = argv(n)
  1327.                Return argument number n from dos command line.
  1328.  
  1329.           n = asc(s)
  1330.                Return ascii code of first character of s.
  1331.  
  1332.           y = atn(x)
  1333.                Return arctangent of x, where x is in radians.
  1334.  
  1335.           background n
  1336.                Set background color for subsequent text output to n. Use
  1337.                the lookup function to map color names to numbers. Use the
  1338.                refresh statement to make the color change occur
  1339.                immediately.
  1340.  
  1341.           s = background ([n])
  1342.                Return current text background color, optionally set new
  1343.                background color to n.
  1344.  
  1345.           beep
  1346.                Generate tone through speaker.
  1347.  
  1348.           blank
  1349.                Clear entire screen, differs from cls in that cls clears
  1350.                just the current text window.
  1351.  
  1352.  
  1353.           Page 20                                 TsrBasic Reference Manual
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.           border
  1368.                Shrink the text area of the window by one row or column on
  1369.                each side and draw a border around it.
  1370.  
  1371.           box x1, y1, x2, y2, f
  1372.                Draw a box with top left corner at x1, y1 and bottom right
  1373.                corner at x2, y2. Outline the box if f is 2 and fill the box
  1374.                if f is 3. The lookup function may be used to map "outline"
  1375.                and "fill" to 2 and 3. Available in graphics mode only.
  1376.  
  1377.           s = cat(t[,u...])
  1378.                Return the concatenation of strings t, u, etc, see also: +.
  1379.  
  1380.           chain s
  1381.                Load file specified by s and run it, see also: common.
  1382.  
  1383.           s = chr(n)
  1384.                Return the character equivalent for ascii code n.
  1385.  
  1386.           n = cint(x)
  1387.                Return x rounded up to next integer.
  1388.  
  1389.           circle x1, y1, x2, y2, f
  1390.                Draw a circle within the bounding rectangle specified by a
  1391.                top left corner at x1, y1 and a bottom right corner at x2,
  1392.                y2. Outline the circle if f is 2 and fill the circle if f is
  1393.                3. The lookup function may be used to map "outline" and
  1394.                "fill" to 2 and 3. Available in graphics mode only.
  1395.  
  1396.           clip x1, y1, x2, y2
  1397.                Define a graphics view port with a top left corner at x1, y1
  1398.                and a bottom right corner at x2, y2. Subsequent graphics
  1399.                output beyond this rectangle will be clipped. Available in
  1400.                graphics mode only.
  1401.  
  1402.           close #n
  1403.                Close file opened with file number n, see also: open, input,
  1404.                print.
  1405.  
  1406.           cls
  1407.                Clear current text window, see also: blank.
  1408.  
  1409.           color n, m
  1410.                Set graphics foreground color to n and background color to
  1411.                m. The graphics color is maintained independently of the
  1412.                text color. The lookup function may be used to map color
  1413.                names to color numbers. Available in graphics mode only.
  1414.  
  1415.           column n
  1416.                Move cursor to absolute column n, where the leftmost column
  1417.                is 0 and the rightmost column is usually 79. See also
  1418.  
  1419.  
  1420.  
  1421.           TsrBasic Reference Manual                                 Page 21
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.                locate, which positions the cursor relative to the origin of
  1435.                the current text window.
  1436.  
  1437.           n = column ([m])
  1438.                Return current cursor column, optionally moving cursor to
  1439.                column m.
  1440.  
  1441.           common variable [,variable]...
  1442.                Define common variables for chained programs, see also:
  1443.                chain.
  1444.  
  1445.           config xpix, ypix, colors, adapter, mode
  1446.                Get the current graphics configuration.
  1447.  
  1448.           cont
  1449.                Continue program execution after stop, see also: stop.
  1450.  
  1451.           s = copy(t,n)
  1452.                Return a string consisting of n copies of t.
  1453.  
  1454.           y = cos(x)
  1455.                Return the cosine of x, where x is in radians.
  1456.  
  1457.           csroff
  1458.                Turn the cursor off.
  1459.  
  1460.           csron
  1461.                Turn the cursor on and set it to a default size.
  1462.  
  1463.           csrbottom n
  1464.                Change the size of the cursor by setting the bottom of the
  1465.                cursor to scan line number n. Must be 0 to 6 for cga and 0
  1466.                to 12 for ega. The bottom scan line should be numerically
  1467.                greater than the top scan line.
  1468.  
  1469.           n = csrbottom ([m])
  1470.                Get the current bottom scan line of the cursor, and
  1471.                optionally set it to scan line m.
  1472.  
  1473.           csrtop n
  1474.                Change the size of the cursor by setting the top of the
  1475.                cursor to scan line number n. Must be 0 to 6 for cga and 0
  1476.                to 12 for ega. The top scan line should be numerically less
  1477.                than the top scan line.
  1478.  
  1479.           n = csrtop ([m])
  1480.                Get the current top scan line of the cursor, and optionally
  1481.                set it to scan line m.
  1482.  
  1483.           s = date()
  1484.                Return the current date in mm:dd:yy format.
  1485.  
  1486.  
  1487.  
  1488.  
  1489.           Page 22                                 TsrBasic Reference Manual
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.           data value [,value]...
  1504.                Define numeric and string values, see also: read.
  1505.  
  1506.           m = dec(n)
  1507.                Return the decimal equivalent of hex or octal n, see also:
  1508.                hex, oct.
  1509.  
  1510.           dim array(n[,n]...) [,array(n[,n]...)]...
  1511.                Define array with index zero to n, see also: erase, shift,
  1512.                sort.
  1513.  
  1514.           display n,m,s
  1515.                Display string s at absolute row n and column m, without 
  1516.                moving the cursor.
  1517.  
  1518.           end
  1519.                Terminate program execution.
  1520.  
  1521.           s = environ(t)
  1522.                Return value of environment variable t.
  1523.  
  1524.           b = eof(n)
  1525.                Return true if end of file reached on file n.
  1526.  
  1527.           erase array [,array]..
  1528.                Free array, see also: dim.
  1529.  
  1530.           n = erl()
  1531.                Return line number on which error occurred. Valid in error
  1532.                handler only. See also: erm, err, on error.
  1533.  
  1534.           s = erm()
  1535.                Return error message associated with error. Valid in error
  1536.                handler only. See also erl, err, on error.
  1537.  
  1538.           n = err()
  1539.                Return error number associated with error. Valid in error
  1540.                handler only. See also erl, erm, on error.
  1541.  
  1542.           error n
  1543.                Simulate occurrence of error n, see also: on error, resume.
  1544.  
  1545.           execute s
  1546.                Execute string expression s as a TsrBasic statement.
  1547.  
  1548.           y = exp(x)
  1549.                Return natural log (e) to the power of x.
  1550.  
  1551.           fill x1, y1, n
  1552.                Fill the graphics image that has border color n and
  1553.                surrounds the point x1, y1. Use lookup to map color names to
  1554.                numbers. Available in graphics mode only.
  1555.  
  1556.  
  1557.           TsrBasic Reference Manual                                 Page 23
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.           n = fix(x)
  1572.                Return x truncated to an integer.
  1573.  
  1574.           n = fre()
  1575.                Return amount of free TsrBasic memory in bytes.
  1576.  
  1577.           for variable = expression to expression [step expression]
  1578.                For...next loop, see also: next.
  1579.  
  1580.           foreground c
  1581.                Set foreground color for subsequent text output to n. Use
  1582.                the lookup function to map color names to numbers. Use the 
  1583.                refresh statement to make the color change occur
  1584.                immediately.
  1585.  
  1586.           d = foreground ([c])
  1587.                Return current text foreground color, optionally set new
  1588.                foreground color to c.
  1589.  
  1590.           get x1, y1, x2, y2
  1591.                Transfer a graphics image from the screen to memory. The
  1592.                image is bounded by a rectangle with a top left corner of
  1593.                x1, y1, and a bottom right corner of x2, y2. The image may
  1594.                then be transferred to a file using mapsave or back to the
  1595.                screen using put. Available in graphics mode only.
  1596.  
  1597.           n = getkey ()
  1598.                Wait for a key to be entered and return the scan code. See
  1599.                Appendix D for more information on scan codes.
  1600.  
  1601.           n = getscreen ()
  1602.                Return the attributes and ascii code of the character at the
  1603.                current cursor position. The attributes are returned in the
  1604.                high order byte and the ascii code is returned in the low
  1605.                order byte.
  1606.  
  1607.           goto n
  1608.                Goto line number n, also valid in immediate mode after run.
  1609.  
  1610.           gosub n
  1611.                Call subroutine at line number n, see also: return.
  1612.  
  1613.           m = hex(n)
  1614.                Return hexadecimal equivalent of decimal or octal n. See
  1615.                also: dec, oct.
  1616.  
  1617.           if expression then statement-list [else statement-list]
  1618.                If...then...else statement, see detailed description.
  1619.  
  1620.           init
  1621.                Set current text window and cursor to default size and
  1622.                color. In the normal text video mode there are 25 rows and
  1623.  
  1624.  
  1625.           Page 24                                 TsrBasic Reference Manual
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.                80 columns. The top-left corner is 0, 0 and the bottom right
  1639.                corner is 24, 79.
  1640.  
  1641.           n = inkey()
  1642.                Return scan code if key entered else zero, see detailed
  1643.                description of scan codes.
  1644.  
  1645.           m = inp(n)
  1646.                Return byte read from hardware port n.
  1647.  
  1648.           input [#file-number] variable [,variable]...
  1649.                Input one or more items into variables, see also: line
  1650.                input, parse.
  1651.  
  1652.           s = instr([n,]r,t)
  1653.                Return first occurrence of s in r optionally starting at n.
  1654.  
  1655.           n = int(x)
  1656.                Return x truncated to an integer and rounded down if
  1657.                negative.
  1658.  
  1659.           intensity n
  1660.                Set text intensity (brightness) attribute to n. Use lookup
  1661.                function to map intensity names "low" and "high" to
  1662.                intensity numbers 0 and 8.
  1663.  
  1664.           s = left(t,n)
  1665.                Return leftmost n characters of s.
  1666.  
  1667.           n = len(s)
  1668.                Return number of characters in s.
  1669.  
  1670.           [let] variable = expression
  1671.                Assign expression to variable or array.
  1672.  
  1673.           line input [#file-number] variable
  1674.                Input an entire line of text into a variable or array.
  1675.  
  1676.           lineto x1, y1
  1677.                Draw a line in the current graphics color to point x1, y1.
  1678.                Valid only in graphics mode. See also: mode, moveto.
  1679.  
  1680.           locate n, m
  1681.                Set cursor to row n and column m relative to the current
  1682.                text window (0,0 is top left). See also: screen.
  1683.  
  1684.           mapload n
  1685.                Load a graphics image bitmap, previously saved by mapsave,
  1686.                from file IMAGE.n where n is a number. The bitmap may then
  1687.                be transferred to the screen using put.
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.           TsrBasic Reference Manual                                 Page 25
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.           mapsave n
  1708.                Save a graphics image bitmap to file IMAGE.n where n is a
  1709.                number. The bitmap must have previously been transferred
  1710.                from the screen to memory using get.
  1711.  
  1712.           mode n
  1713.                Set video/graphics mode to n. See detailed description of
  1714.                graphics modes for more information.
  1715.  
  1716.           moveto x1, y1
  1717.                Move to point x1, y1 for subsequent graphics output. Valid
  1718.                only in graphics mode. See also: mode, lineto.
  1719.  
  1720.           next variable
  1721.                For...next loop, see also: for
  1722.  
  1723.           y = log(x)
  1724.                Return natural logarithm of x.
  1725.  
  1726.           s = mid(t,n[,m])
  1727.                Return m characters from t starting at n, return remainder
  1728.                of string t if m is omitted.
  1729.  
  1730.           m = oct(n)
  1731.                Return octal equivalent of decimal or hexadecimal n. See
  1732.                also: dec, hex.
  1733.  
  1734.           on error goto n
  1735.                Call error handler at line number n. Return from it with
  1736.                resume. See also: erl, erm, err.
  1737.  
  1738.           open #n, s, t
  1739.                Open file with access mode s and pathname t, and associate
  1740.                it with file number n. See detailed description for
  1741.                information on access modes.
  1742.  
  1743.           out port, expression
  1744.                Output integer byte value to port, see also: inp.
  1745.  
  1746.           page n
  1747.                Set current video text page for video adapters capable of
  1748.                supporting multiple text pages.
  1749.  
  1750.           n = page ([m])
  1751.                Get the current video text page and optionally set it to
  1752.                page m.
  1753.  
  1754.           s = parse(t[,v...])
  1755.                Return a token parsed from t, see detailed description.
  1756.  
  1757.           i = peek(j,k)
  1758.                Return byte located at segment j, offset k.
  1759.  
  1760.  
  1761.           Page 26                                 TsrBasic Reference Manual
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.           pixel x1, y1
  1776.                Turn on graphics pixel at point x1, y1. Available only in
  1777.                graphics mode.
  1778.  
  1779.           poke segment, offset, expression
  1780.                Set byte at segment and offset to integer value, see also:
  1781.                peek.
  1782.  
  1783.           print [#n] expression [, or ; expression]...
  1784.                Print to file number n or console, semicolon causes print
  1785.                items to be adjacent, comma causes them to be separated by
  1786.                tabs.
  1787.  
  1788.           put x1, y1, n
  1789.                Transfer a graphics image from memory to the screen. The
  1790.                image must have previously been captured using get, or read
  1791.                from a disk file using mapload. The top left corner is put
  1792.                at x1, y1 and the control argument n describes how the image
  1793.                is transferred to the screen. See the detailed description
  1794.                of graphics for more information.
  1795.  
  1796.           randomize
  1797.                Seed random number generator.
  1798.  
  1799.           read variable [,variable]...
  1800.                Read values into variables or arrays, see also: data,
  1801.                restore.
  1802.  
  1803.           refresh
  1804.                Refresh the text screen. This can be used after the
  1805.                foreground and background statements to change the color of
  1806.                text that is already on the screen.
  1807.  
  1808.           rem
  1809.                Remark, i.e. this line is a comment, equivalent to single
  1810.                quote.
  1811.  
  1812.           restore
  1813.                Restore data list to beginning, see also: data, read.
  1814.  
  1815.           restorescreen s
  1816.                Restore screen contents to previous value, see savescreen.
  1817.                In addition to restoring the contents of the screen, this
  1818.                statement also restores the text window dimensions that were
  1819.                in effect when the corresponding savescreen was executed.
  1820.  
  1821.           resume
  1822.                Return from error handler and retry statement that caused
  1823.                error. See also: on error.
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.           TsrBasic Reference Manual                                 Page 27
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.           resume n
  1844.                Return from error handler to line-number n. See also: on
  1845.                error.
  1846.  
  1847.           resume next
  1848.                Return from error handler to statement following the one
  1849.                that caused the error. See also: on error.
  1850.  
  1851.           return
  1852.                Return from subroutine entered via gosub.
  1853.  
  1854.           row n
  1855.                Move cursor to absolute row n, where the top row is 0 and
  1856.                the bottom row is usually 24. See also locate, which
  1857.                positions the cursor relative to the origin of the current
  1858.                text window.
  1859.  
  1860.           n = row ([m])
  1861.                Return current cursor row and optionally move cursor to row
  1862.                m.
  1863.  
  1864.           s = right(t,n)
  1865.                Return rightmost n characters of t.
  1866.  
  1867.           m = rnd([n])
  1868.                Return random number, optionally based on seed n.
  1869.  
  1870.           savescreen s
  1871.                Save screen contents in variable s for a subsequent
  1872.                restorescreen. This function saves the text window defined
  1873.                using the wintop, winleft, winbottom and winright
  1874.                statements. To save the entire screen, use the init
  1875.                statement first to set the text window size back to the
  1876.                entire screen.
  1877.                  
  1878.           screen "command", parameters
  1879.                Not supported in Version 2.0. See setailed description of
  1880.                text windows for alternate statements and functions.
  1881.  
  1882.           scroll n
  1883.                Scroll screen up n rows if n is positive or down n rows if
  1884.                rows is negative.
  1885.  
  1886.           m = sgn(x)
  1887.                Return -1 if x is negative, 0 if x is 0, +1 if x is
  1888.                positive.
  1889.  
  1890.           shell s
  1891.                Pass string expression s to DOS shell to execute as a
  1892.                command. Because DOS is not reentrant, this statement will
  1893.                not work when you have recalled a suspended TsrBasic session
  1894.                from the DOS shell. In this case it will return a "DOS is
  1895.  
  1896.  
  1897.           Page 28                                 TsrBasic Reference Manual
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.                busy" error. You can, however, use the SHELL statement when
  1911.                you have recalled TsrBasic from most other applications,
  1912.                provided there is sufficient memory.
  1913.  
  1914.           shift a, n
  1915.                Shift one dimensional array a by n elements. If n is
  1916.                negative elements are shifted down and extra elements are
  1917.                discarded from the low end. If n is positive then elements
  1918.                are shifted up and extra elements are discarded from the
  1919.                high end.
  1920.  
  1921.           y = sin(x)
  1922.                Return sine of x, where x is in radians.
  1923.  
  1924.           sort a, n
  1925.                Sort one dimensional array a into ascending order if n is
  1926.                positive and into descending order if n is negative.
  1927.  
  1928.           sound frequency, duration
  1929.                Generate tone, use a frequency of zero for a delay.
  1930.  
  1931.           s = space(n)
  1932.                Return string of n spaces, see also: copy
  1933.  
  1934.           y = sqr(x)
  1935.                Return square root of x.
  1936.  
  1937.           stop
  1938.                Stop execution. Useful for debugging. See also: cont.
  1939.  
  1940.           suspend screen, key-code, key-flags, interval, status
  1941.                Terminate and stay resident. See detailed description of
  1942.                suspend statement for more information.
  1943.  
  1944.           swap variable-a, variable-b
  1945.                Swap the contents of variable-a and variable-b.
  1946.  
  1947.           tab(n)
  1948.                Position cursor to column n (as print argument only).
  1949.  
  1950.           y = tan(x)
  1951.                Return tangent of x, where x is in radians.
  1952.  
  1953.           s = time()
  1954.                Return current time in hh:mm:ss format.
  1955.  
  1956.           troff
  1957.                Disable statement tracing.
  1958.  
  1959.           tron
  1960.                Enable statement tracing.
  1961.  
  1962.  
  1963.  
  1964.  
  1965.           TsrBasic Reference Manual                                 Page 29
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.           type n
  1980.                Set type of video access to n, where n is 0 for direct
  1981.                (fast) access, 1 for BIOS access, 2 for BIOS/DOS access, and
  1982.                3 for text in graphics mode. The default is 0. Use 1 if you
  1983.                have any video problems with 0, use 2 if you want to
  1984.                redirect output using DOS redirection capability. Use 3 for
  1985.                mixed text and graphics in graphics modes (see mode).
  1986.  
  1987.           winbottom n
  1988.                Set the bottom row of the text window to n, where n is in
  1989.                the range of 0 (top) to 24 (bottom). See detailed
  1990.                description of text windows for more information.
  1991.  
  1992.           n = winbottom ([m])
  1993.                Return the current bottom row of the text window and
  1994.                optionally set it to m.
  1995.  
  1996.           winleft n
  1997.                Set the left column of the text window to n, where n is in
  1998.                the range of 0 (left) to 79 (right). 
  1999.  
  2000.           n = winleft ([m])
  2001.                Return the current left column of the text window and
  2002.                optionally set it to m.
  2003.  
  2004.           winright n
  2005.                Set the right column of the text window to n, where n is in
  2006.                the range of 0 (left) to 79 (right). 
  2007.  
  2008.           n = winright ([m])
  2009.                Return the current right column of the text window and
  2010.                optionally set it to m.
  2011.  
  2012.           wintop n
  2013.                Set the top row of the text window to n, where n is in the
  2014.                range of 0 (top) to 24 (bottom). 
  2015.  
  2016.           n = wintop ([m])
  2017.                Return the current top row of the text window and optionally
  2018.                set it to m.
  2019.  
  2020.  
  2021.           Appendix B.    Summary of Commands
  2022.  
  2023.  
  2024.           Commands are usually entered without a line number and
  2025.           are executed immediately. They may, however, be included in
  2026.           programs if they are passed as arguments to the EXECUTE
  2027.           statement. In this case, they are processed when the EXECUTE
  2028.           statement is executed.
  2029.  
  2030.  
  2031.  
  2032.  
  2033.           Page 30                                 TsrBasic Reference Manual
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.           In the following list of commands, the phrase line-number-spec
  2047.           refers to an optional specification of line numbers. The
  2048.           specification may take the following forms:
  2049.  
  2050.                -    all lines
  2051.                n    line n
  2052.                n-   line n through end
  2053.                n-m  line n through m
  2054.                -n   beginning through n
  2055.  
  2056.           If the specification is omitted, all lines are processed.
  2057.  
  2058.           clear
  2059.                Free all variables.
  2060.  
  2061.           chdir pathname
  2062.                Make pathname the current directory.
  2063.  
  2064.           delete [line-number-spec]
  2065.                Delete lines from current program, use caution when entering
  2066.                this command without a line-number-spec,  because it will
  2067.                delete the entire program.
  2068.  
  2069.           dis [line-number-spec]
  2070.                Disassemble intermediate code.
  2071.  
  2072.           edit [line-number-spec]
  2073.                Invoke editor specified by EDITOR environment variable on
  2074.                line-number-spec.
  2075.  
  2076.           kill pathname
  2077.                Delete file specified by pathname.
  2078.  
  2079.           link pathname
  2080.                Translate current program into an executable called
  2081.                pathname.
  2082.  
  2083.           list [line-number-spec]
  2084.                List current program
  2085.  
  2086.           load pathname
  2087.                Clear current program and load new program, default
  2088.                extension is ".bas". Append a period if the filename does
  2089.                not have an extension.
  2090.  
  2091.           merge pathname
  2092.                Merge new program with current program.
  2093.  
  2094.           mkdir pathname
  2095.                Create a directory specified by pathname.
  2096.  
  2097.           new
  2098.                Erase the current program.
  2099.  
  2100.  
  2101.           TsrBasic Reference Manual                                 Page 31
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.           quit
  2116.                Terminate TsrBasic and unload from memory if resident.
  2117.  
  2118.           renum new-first-line line-increment
  2119.                Renumber current program.
  2120.  
  2121.           rmdir pathname
  2122.                Remove directory specified by pathname.
  2123.  
  2124.           run [line-number]
  2125.                Execute current program, optionally starting at line-number.
  2126.  
  2127.           save pathname
  2128.                Save current program to file specified by pathname, default
  2129.                extension is ".bas". Append a period if you do not want the
  2130.                filename to have an extension.
  2131.  
  2132.  
  2133.           Appendix C.   Error Codes and Messages
  2134.  
  2135.  
  2136.           The following list describes TsrBasic error codes and messages:
  2137.  
  2138.               Code  Message
  2139.  
  2140.                0    Internal error
  2141.                1    Syntax error
  2142.                2    Uninitialized variable
  2143.                3    Missing left paren
  2144.                4    Missing right paren
  2145.                5    Missing comma or right paren
  2146.                6    Missing factor
  2147.                7    Expression too complex
  2148.                8    Too many symbols
  2149.                9    Program too long
  2150.                10   Too many nested calls
  2151.                11   Too many nested GOSUB's
  2152.                12   RETURN without GOSUB
  2153.                13   Duplicate definition
  2154.                14   Invalid subscript
  2155.                15   Too many data items
  2156.                16   Out of data
  2157.                17   FOR loops nested too deep
  2158.                18   Missing NEXT
  2159.                19   Missing FOR
  2160.                20   Cannot open file
  2161.                21   File not open
  2162.                22   File in use
  2163.                23   Undefined line number
  2164.                24   Break
  2165.                25   Cannot continue
  2166.                26   File or dir not found
  2167.  
  2168.  
  2169.           Page 32                                 TsrBasic Reference Manual
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.                27   Assignment to constant
  2183.                28   Cannot locate tsrbasic
  2184.                29   i/o error
  2185.                30   DOS is busy
  2186.                31   Missing END IF
  2187.                32   Cannot load GRAPHICS.DLL
  2188.                33   Floating point exception
  2189.                34   Missing THEN
  2190.                35   Use of keyword as variable
  2191.                36   Graphics error
  2192.                37   Cannot terminate TSR
  2193.  
  2194.  
  2195.           Appendix D.   Keyboard Scan Codes
  2196.  
  2197.           The following table lists the key and the corresonding scan code,
  2198.           in decimal (and in parenthesis). Note that some keys, such as
  2199.           control and shift cannot be processed by getkey and inkey.
  2200.  
  2201.  
  2202.           Characters
  2203.  
  2204.                a (30)              k (37)              u (22)
  2205.                b (48)              l (38)              v (47)
  2206.                c (46)              m (50)              w (17)
  2207.                d (32)              n (49)              x (45)
  2208.                e (18)              o (24)              y (21)
  2209.                f (33)              p (25)              z (44)
  2210.                g (34)              q (16)
  2211.                h (35)              r (19)
  2212.                i (23)              s (31)
  2213.                j (36)              t (20)
  2214.                 
  2215.                 
  2216.           Digits
  2217.                 
  2218.                1 (2)               5 (6)               9 (10)
  2219.                2 (3)               6 (7)               0 (11)
  2220.                3 (4)               7 (8)
  2221.                4 (5)               8 (9)
  2222.                 
  2223.  
  2224.           Function Keys  
  2225.                 
  2226.                f1 (59)             f5 (63)             f9 (67)
  2227.                f2 (60)             f6 (64)             f10 (68)
  2228.                f3 (61)             f7 (65)
  2229.                f4 (62)             f8 (66)
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.           TsrBasic Reference Manual                                 Page 33
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.           Special Keys
  2252.  
  2253.                alt (56)            equals (13)         page down (81)
  2254.                arrow down (80)     enter (28)          page up (73)
  2255.                arrow left (75)     escape (1)          period (52)
  2256.                arrow right (77)    home (71)           prt sc / * (55)
  2257.                arrow up (72)       insert (82)         right bracket (27)
  2258.                back quote (41)     keypad + (78)       right shift (54)
  2259.                back space (14)     keypad - (74)       semicolon (39)
  2260.                back slash (43)     keypad 5 (76)       scroll lock (70)
  2261.                caps lock (58)      keypad enter (78)   single quote (40)
  2262.                comma (51)          left bracket (26)   slash (53)
  2263.                control (29)        left shift (42)     space (57)
  2264.                delete (83)         minus (12)          tab (15)
  2265.                end (79)            num lock (69)
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.           Page 34                                 TsrBasic Reference Manual
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.