home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l075 / 1.ddi / TBHELP.TBH (.txt) < prev    next >
Encoding:
Turbo BASIC Help  |  1988-11-05  |  40.1 KB  |  1,113 lines

  1. TURBO BASIC HELP FILE.
  2. $*$* &&&&$*$
  3. Index
  4.  Help on Help
  5. Directory option
  6.  Bounds option
  7.     Editing commands
  8.  Chain files
  9. Edit window
  10.  Change dir option
  11. 8087 option
  12.  Changing colors
  13. Environment variables
  14.  Character set
  15.     Environment windows
  16.  Close option
  17. Error messages
  18.  Colors option
  19.     Executable option
  20.  Communications opt
  21. EXE file setting
  22.  Compile command
  23. File command
  24.  Debugging
  25. File names
  26.  Directories option
  27. Goto option
  28. 'Go on...
  29. Index
  30.  Hotkeys
  31. Miscellaneous option
  32.  Include directories
  33. Moving windows
  34.  Include files
  35.     Music buffer setting
  36.  Keyboard break option New option
  37.  Load option
  38. Next option
  39.  Load setup options
  40. Open option
  41.  Main file option
  42. Options command
  43.  Main menu
  44. OS shell option
  45.  Memory setting
  46. Overflow option
  47.  Message window
  48. Palette box
  49.  Metastatements
  50. Parameter line option
  51.  Metastatements option Quitting Turbo
  52. 'Go on...
  53. Index
  54.  Rounding numbers
  55. Syntax
  56.  Running a program
  57. Tile option
  58.  Run-time error option Trace option
  59.  Save option
  60. Trace window
  61.  Saving setup options  Turbo directory opt
  62.  Setup command
  63.     Window command
  64.  Stacking windows
  65. Windows
  66.  Stack size setting
  67. Write to option
  68.  Stack test option
  69. Zoom option
  70.  Welcome to Turbo Basic's Help.  Use the arrow
  71.  keys to move the selection bar to any of the
  72.  highlighted items.  The Home key takes you to
  73.  the first item on the screen; End takes you to
  74.  the last.  The 25th line gives you help on how
  75.  to move around.  Note that if you press F1
  76.  while you're in the Help system, it will bring
  77.  up the Help index.
  78.  Here's some general topics to get you started
  79.  using Turbo Basic.
  80. Character set
  81. Editing
  82. Hotkeys
  83. Main Menu
  84.     Windows
  85.  The Turbo Basic menu system is both logical
  86.  and intuitive.  You'll find that several of
  87.  the main menu commands have both pull-down and
  88.  pop-up menus, offering you many programming
  89.  options.  Here's what the main menu has to
  90.  offer:
  91.  File
  92. Compile
  93.  Options
  94. Setup
  95. Window
  96. Debug
  97.  You can either press an arrow key to move to
  98.  the desired option and then press Enter or
  99.  simply press the highlighted capital letter
  100.  of the option you want.
  101. Go on...
  102.  Use the arrow keys to select which part of a
  103.  menu item, window, or system box you want to
  104.  change, then press Enter.  The palette box
  105.  of colors will be displayed on your screen.
  106.  You can restore the original colors by
  107.  selecting "Restore defaults."
  108.  Keep in mind that any colors you change will
  109.  be lost once you exit Turbo Basic unless you
  110.  save them using the Save Options/Window/Setup
  111.  in the Setup menu.
  112.  Turbo Basic has a number of hotkeys you can
  113.  use no matter where you are in the main menu.
  114.  Two of the most important are probably Esc,
  115.  which takes you back to the main menu, and
  116.  Alt-X, which exits you to DOS.
  117. Function
  118. --------------------------------------------
  119.     Takes you to context-sensitive
  120.     Saves your file
  121.     Creates a new file
  122.     Zooms the active window (only Run
  123. and Edit are zoomable)
  124. 'Go on...
  125. Function
  126. ------------------------------------------
  127. Switches to the next active
  128. window
  129. Goes to the active window
  130. (in the editor, F7 functions
  131. differently)
  132. Scroll Lock
  133. With the arrow keys, sizes
  134. and moves the active window
  135. Returns you to the main menu
  136. Alt-F5
  137. Zooms the active window at
  138. runtime
  139. Alt-F6
  140. Switches to the next active
  141. window at runtime
  142. 'Go on...
  143.     Function
  144. -----------------------------------------
  145. Alt-F9
  146. Toggles between tracing and
  147. executing your program
  148. Alt-F10
  149. When tracing, single-steps to
  150. next line number, label, etc.
  151. Alt-C
  152. Compiles the currently loaded
  153. program
  154. Alt-D
  155. Takes you to the Debug menu
  156. Alt-E
  157. Takes you to the Edit window
  158. 'Go on...
  159.  After selecting the Colors option, use the
  160.  arrow keys to move to and select which part
  161.  of the screen you'd like to redefine the
  162.  colors for.
  163.  Any colors you change will be lost once you
  164.  exit Turbo Basic unless you save them using
  165.  the Save Options/Window/Setup in the Setup
  166.  menu.
  167.  For example, use the Right arrow key to move
  168.  to the Edit command from the File command, or
  169.  else just press E from anywhere in the main
  170.  menu. Pressing the Alt key and the letter of
  171.  any of the main menu options will get you to
  172.  the option (or action) desired.
  173.     Function
  174. --------------------------------------------
  175. Alt-F
  176. Takes you to the File menu
  177. Alt-O
  178. Takes you to the Options menu
  179. Alt-R
  180. Runs currently loaded program
  181. Alt-S
  182. Takes you to the Setup menu
  183. Alt-X
  184. Exits the Turbo Basic system
  185.  The File command provides a number of options.
  186.  This is where you'll spend a lot of time--
  187.  naming files, doing saves, writing to disk,
  188.  and more.  Select an option that you want to
  189.  know more about:
  190.  Load
  191.     Save
  192.  Write to
  193. Main file
  194. Directory
  195.  Change dir  OS shell
  196.  Use Load to select a work file to
  197. Compile
  198.  At the prompt, you can enter any legal file
  199.  name.  Choose unique file names and avoid the
  200.  extension names .EXE, .BAK, .COM, and .BAT.
  201.  Pressing Enter after the prompt for a file
  202.  name or entering wildcards (* and ?)  followed
  203.  by Enter will bring up the directory facility.
  204.  Use the arrow keys to move around and then
  205.  press Enter when you reach the file you want.
  206.  The New option erases any text that is
  207.  currently in the editor and gives the
  208.  default name NONAME.BAS to the file.
  209.  Use Save to save your current work file to
  210.  disk.  An old version will be given a .BAK
  211.  extension unless you toggle off the option
  212.  Backup source files (in the Miscellaneous
  213.  pop-up window of the Setup command).
  214.  If you attempt to save a NONAME.BAS work file,
  215.  you are prompted to rename it first.  Pressing
  216.  Enter will save your file as NONAME.BAS.
  217.  Use Save to save your current work file to
  218.  disk.  An old version will be given a .BAK
  219.  extension unless you toggle off the option
  220.  Backup source files (in the Miscellaneous
  221.  pop-up window of the Setup command).
  222.  If you attempt to save a NONAME.BAS work file,
  223.  you are prompted to rename it first.  Pressing
  224.  Enter will save your file as NONAME.BAS.
  225.  After editing, use the Write to option to
  226.  write the current edit file to disk under a
  227.  new name.  You are prompted for a file name
  228.  to write to.
  229.   Miscellaneous Commands con't
  230.   -------------------------------------
  231.   Find
  232. Ctrl-QF
  233.   Find & replace
  234. Ctrl-QA
  235.   Repeat last find
  236. Ctrl-L
  237.   Control character prefix
  238. Ctrl-P
  239.   Abort operation
  240. Ctrl-U
  241.   Restore error message
  242.     Ctrl-QW
  243. 'Go on...
  244.   Search Options
  245.   ------------------------------------------
  246.     Searches backwards
  247.     Searches globally
  248.     n = any number; searches n times
  249.     Replaces without asking
  250.     Ignores uppercase/lowercase
  251.     Searches for whole words only
  252.  The Directory option is handy when you
  253.  want to get a directory listing, to search
  254.  subdirectories, and to change the mask on
  255.  the fly.  You can specify a mask using the
  256.  wildcard characters * and ?, following the
  257.  usual DOS rules.
  258.  You can use the arrow keys to move around
  259.  the directory listing and subdirectories.
  260.  Select another directory with the Change dir
  261.  option.  At the prompt, type in the directory
  262.  path that will become your current directory.
  263.  You can use any legal path name.
  264.  As a note, the Executable directory contains
  265.  .EXE and .TBC files generated by the Turbo
  266.  Basic system.  The Include directories
  267.  hold files that contain the Include compiler
  268.  directive.  The Turbo directory file is
  269.  where Turbo Basic expects to find system
  270.  files: TB.EXE, the config files (.TB), and
  271.  the help files (.TBH).
  272.  Choose the OS option when you want to call the
  273.  DOS operating system--Turbo Basic will remain
  274.  resident in memory.  Once DOS has been loaded,
  275.  you can execute any DOS commands.  Type EXIT
  276.  to return to Turbo Basic.
  277.  Use the Quit option to exit from the Turbo
  278.  Basic system to DOS.  If you've modified a
  279.  work file without saving it, you are prompted
  280.  to do so now.  (Alternatively, you can exit
  281.  Turbo Basic by pressing Alt-X from anywhere
  282.  in the menu system.)
  283.  If you're at all familiar with SideKick's
  284.  Notepad, this editor should be a breeze.
  285.  Press E to get into the Edit window and enter
  286.  text just as if you were typing at a
  287.  typewriter.  When you want to end a line,
  288.  simply press the Enter key.  To exit from the
  289.  editor, press Esc.
  290.  The editor's status line indicates the drive,
  291.  name, and extension of the file being edited,
  292.  which line and column number contain the
  293.  cursor, whether you're in Insert or Overwrite
  294.  mode, and whether the auto-indent and tab
  295.  features are on.
  296. 'Go on...
  297.  After you finish writing or editing your file,
  298.  press Esc to get back to the main menu.  Your
  299.  file will still be displayed onscreen, but
  300.  you won't be able to do anything to it until
  301.  you press E to return to the editor.
  302.  The next screen gives you a summary of some
  303.  of the most commonly used commands (take a
  304.  look at Chapter 3 in the manual for the more
  305.  complex ones).
  306. 'Go on...
  307.   Cursor Movement Commands
  308.   ------------------------------------------
  309.   Character left
  310. Ctrl-S or Left arrow
  311.   Character right
  312. Ctrl-D or Right arrow
  313.   Word left
  314. Ctrl-A
  315.   Word right
  316. Ctrl-F
  317.   Line up
  318. Ctrl-E or Up arrow
  319.   Line down
  320. Ctrl-X or Down arrow
  321.   Scroll up
  322. Ctrl-W
  323.   Scroll down
  324. Ctrl-Z
  325.   Page up
  326. Ctrl-R or PgUp
  327.   Page down
  328. Ctrl-C or PgDn
  329. 'Go on...
  330.   Insert & Delete Commands
  331.   ------------------------------------------
  332.   Insert mode on/off
  333. Ctrl-V or Ins
  334.   Insert line
  335. Ctrl-N
  336.   Delete line
  337. Ctrl-Y
  338.   Delete to end of line  Ctrl-QY
  339.   Delete character left  Ctrl-H or Backspace
  340.   Delete character
  341. Ctrl-G or Del
  342.   Delete word right
  343. Ctrl-T
  344. 'Go on...
  345.   Block Commands
  346.   -----------------------------------
  347.   Mark block begin
  348. Ctrl-KB or F7
  349.   Mark block end
  350. Ctrl-KK or F8
  351.   Mark single word
  352. Ctrl-KT
  353.   Copy block
  354. Ctrl-KC
  355.   Move block
  356. Ctrl-KV
  357.   Delete block
  358. Ctrl-KY
  359.   Read block from disk  Ctrl-KR
  360.   Write block from disk Ctrl-KW
  361.   Hide/display block
  362. Ctrl-KH
  363.   Print block
  364. Ctrl-KP
  365. 'Go on...
  366.   Miscellaneous Commands
  367.   ------------------------------------------
  368.   Quit edit, no save
  369. Ctrl-KD, Ctrl-KQ, or
  370.   Save and edit
  371.     Ctrl-KS or F2
  372.   New file
  373.   Tab
  374. Ctrl-I or Tab
  375.   Tab mode
  376. Ctrl-OT
  377.   Auto indent on/off
  378. Ctrl-OI
  379.   Restore line
  380. Ctrl-QL
  381.   Set place marker
  382. Ctrl-KN
  383.   Find place marker
  384. Ctrl-QN
  385. 'Go on...
  386.  Once you open the window of your choice, it
  387.  becomes the active window.  From that point
  388.  on, all other window commands will only affect
  389.  the active window.
  390.  The Close option hides, or makes "invisible,"
  391.  the currently selected window.  Note, however,
  392.  that you can still write to the "closed"
  393.  window.
  394.  Use the Next option to select another window
  395.  as the active window without returning to the
  396.  Open option.  If you press Next repeatedly,
  397.  you'll cycle through the windows.  When you're
  398.  in a window or main menu, pressing the F6 key
  399.  will accomplish the same thing.
  400.  After you've Opened a window, use Goto to
  401.  enter that window without returning to the
  402.  main menu.
  403.  Tiling makes all of the active windows occupy
  404.  an equal portion of the screen.  The F6 key
  405.  switches the active window.
  406.  Stack layers all active windows to the largest
  407.  possible size.  Pressing F6 will bring the
  408.  last screen in the stack to the top of the
  409.  screen.
  410.  The Zoom option zooms to full size the Run
  411.  and Edit windows.  Toggle Zoom again to
  412.  restore your original screen setup.
  413.  The Turbo directory is where Turbo Basic
  414.  expects to find the system files:  TB.EXE,
  415.  the configuration files (.TB), and the help
  416.  file (TBHELP.TBH).
  417.  After selecting this directory, you are
  418.  prompted for a drive and a path.  Type it
  419.  in and then press Enter.
  420.  If you change your mind about the directory
  421.  you've selected and want to reselect, you
  422.  can press Esc any time prior to leaving the
  423.  system box and before pressing Enter.  This
  424.  will return you to the directory selections.
  425.  The Colors option lets you define the colors
  426.  of any window, menu, or system box and their
  427.  respective items by using the arrow keys and
  428.  pressing Enter.
  429.  Any colors you change will be lost once you
  430.  exit Turbo Basic unless you save them using
  431.  the Save Options/Window/Setup in the Setup
  432.  menu.
  433.  The Directories option lets you define a drive
  434.  and path to the three directories used by the
  435.  system:
  436.  Include
  437. for files containing Include
  438. compiler directive
  439.  Executable  for .EXE and .TBC (chain) files
  440.  Turbo
  441. for Turbo Basic system files
  442.  The default directory is whatever directory
  443.  you happen to be in when you start up Turbo
  444.  Basic.
  445.  The Load Options/Window/Setup lets you load
  446.  a .TB file from the Turbo directory and
  447.  reset the system with the parameters in that
  448.  file.  After entering the file name, press
  449.  Enter to have Turbo Basic accept it.
  450.  The Save Options/Window/Setup lets you save
  451.  the current configuration file in a .TB file
  452.  in the Turbo directory.  No matter what
  453.  extension is used, it will be stripped off
  454.  and .TB appended.  The default file name
  455.  TBCONFIG.TB is automatically used at startup.
  456.  The Window option lets you resize and move any
  457.  active environment window using the following
  458.  commands:
  459.  Open
  460. Close
  461.  Tile
  462. Stack
  463.  By default, all environment windows are active
  464.  until closed.
  465.  To move a window, use the Scroll Lock and
  466.  arrow keys; resize using Scroll Lock and the
  467.  Shift and arrow keys.
  468.  To enter a directory name, type the drive name
  469.  and then the directory path: C:\TURBO
  470.  The backslash indicates the path starts from
  471.  the root.
  472.  To enter a subdirectory name for the drive
  473.  you're currently in, type a backslash and
  474.  then the subdirectory name.  To reach the
  475.  subdirectory of another drive, enter the
  476.  complete path name: C:\BASIC\GRAPHICS
  477. 'Go on...
  478.  When you're in the palette, you can use the
  479.  arrow keys to move around in the palette box.
  480.  Notice that as you move through each color,
  481.  the item you've selected to change takes on
  482.  the color you're currently positioned on.
  483.  Once you've found a color you like, press
  484.  Enter to accept it and Esc to exit from the
  485.  palette box.
  486.  Any colors you change will be lost once you
  487.  exit Turbo Basic unless you save them using
  488.  the Save Options/Window/Setup in the Setup
  489.  menu.
  490.  You can use a combination of keystrokes to
  491.  resize and move an active environment window
  492.  (the one with the double bars around it).
  493.  To resize a window, first toggle on the Scroll
  494.  Lock key.  Then hold down the Shift key and
  495.  use any of the arrow keys to make the active
  496.  window as large or as small as desired.
  497.  To move a window, again toggle on the Scroll
  498.  Lock key and use any of the arrow keys to
  499.  move the window to a new position onscreen.
  500.  Every subdirectory listing has the . and ..
  501.  special files.  The single period (.)  file
  502.  name identifies the directory being listed
  503.  as a subdirectory.  The double period (..)
  504.  file name refers to the parent of the
  505.  subdirectory.
  506.  There are four environment windows:
  507.   Edit
  508. Message
  509. Trace
  510.  An active window is the one that has a double
  511.  border around it.  You can only have one
  512.  active window at a time.
  513.  You can resize and move these windows or make
  514.  them invisible.  Go to the Window command in
  515.  the main menu to perform these actions or use
  516.  some of the hotkeys available.
  517.  The Trace window lists any program line
  518.  numbers, labels, and procedure and function
  519.  names as your program runs.  To trace your
  520.  program, you can do one of two things:
  521.  1.  You can toggle on Trace in the Debug
  522. command.
  523.  2.  You can place the TRON/TROFF commands
  524. within your program.  Using these commands
  525. in your program overrides the system Trace
  526. switch.
  527.  In the Edit window, you can create and edit
  528.  any of your programs using Turbo Basic's
  529.  built-in screen editor.  Press F5 to Zoom
  530.  the Edit window.
  531.  The Turbo Basic Editor works much like editors
  532.  in the world-at-large (go to the editing help
  533.  screen for the commonly used commands).  If
  534.  you don't name your work file (using the Load
  535.  command in the Files pull-down menu), the
  536.  default file name NONAME.BAS will be assigned.
  537.  The Message window acts as a program status
  538.  window.
  539.  After compiling a program, the window will
  540.  display the total number of lines and
  541.  statements in the program, and the amount of
  542.  free space left.
  543.  After running a program, the Message window
  544.  shows in hexadecimal the size of the code
  545.  segments, the stack, and the data area of the
  546.  generated program.
  547.  The Run window simply displays your program
  548.  output.  You can Zoom the Run window prior
  549.  to running your program by pressing F5.  To
  550.  Zoom the window while running your program,
  551.  press Alt-F5.
  552.  After you've run your program, you can also
  553.  pan the contents of the Run window. Notice
  554.  that the Run window is the active window
  555.  (it has a double border). Press F7 to go to
  556.  it and then use the arrow keys to move left,
  557.  right, up, or down to review the window's
  558.  contents.
  559.  Toggle on Backup source files to automatically
  560.  back up (append the extension .BAK to) your
  561.  files.  Toggle it off when you don't want to
  562.  create a backup file each time you do a save.
  563.  When working with large programs, you may need
  564.  or choose to break the source into manageable
  565.  sections.  Used in conjunction with $INCLUDE
  566.  metastatements, the Main file selection lets
  567.  you compile multiple source file programs.
  568.  The source module defined as the Main file
  569.  should be the one with the $INCLUDE directive.
  570.  To edit any module of the program, always make
  571.  it the currently loaded file.
  572.  After you select the Compile option from the
  573.  main menu, Turbo Basic determines whether the
  574.  current work file is different from the Main
  575.  file.
  576. !Go on...
  577.  If the files are not different (or if Main
  578.  file has not been selected), then the file
  579.  is compiled.  If the files are different,
  580.  you are prompted to save the work file (if
  581.  it has changed), and then the Main file is
  582.  loaded into memory.
  583.  If any errors are found during compilation,
  584.  the file containing the error is loaded so
  585.  that you can correct it.  Once the error has
  586.  been corrected and compilation restarted, you
  587.  are prompted to save the work file and the
  588.  Main file is then reloaded.
  589.  Turbo Basic's character set includes A to Z,
  590.  a to z, and 0 to 9.  The numbers 0 to 9; the
  591.  symbols ., +, and -; and the letters E, e, D,
  592.  and d can all be used to form numeric
  593.  constants.
  594.  These symbols have specific meaning in Turbo
  595.  Basic:
  596.  Symbol
  597. Function
  598.  ----------------------------------------------
  599. assignment operator
  600. addition and string concatenation
  601. operator
  602. 'Go on...
  603.  Symbol
  604. Function
  605.  ------------------------------------------
  606. subtraction and negation operator
  607. multiplication operator
  608. division operator
  609. integer division operator
  610. exponentiation operator
  611. integer-type declaration operator
  612. long-integer-type declaration
  613. character and nondecimal base
  614. descriptor
  615. single-precision-type declaration
  616. character
  617. 'Go on...
  618.  Symbol
  619. Function
  620.  ------------------------------------------
  621. double-precision-type declaration
  622. character
  623. string type declaration character
  624. and metastatement prefix
  625. function/procedure arguments,
  626. arrays, expression prioritizing
  627. valid only for arrays
  628. (space) separator
  629. all-purpose delimiter
  630. decimal point and file name
  631. extension separator
  632. 'Go on...
  633.  Symbol
  634. Function
  635.  ------------------------------------
  636. remark delimiter
  637. all-purpose delimiter
  638. statement delimiter
  639. PRINT substitute
  640. relational operator
  641. relational operator
  642. string delimiter
  643. line continuation character
  644. %Topic menu
  645.  When your compiler begins executing or when a
  646.  generated .EXE file starts executing, it will
  647.  actually search the environment variable space
  648.  for these variables.
  649.  Though you don't need to set these variables,
  650.  they're available if you need them.  If you
  651.  choose not to set them, the current directory
  652.  searches for files, creating temporary ones
  653.  in which to store to default variables.
  654.   Once you've written and compiled your
  655.   program, use Run to execute it.
  656.   Ctrl-Break interrupts your program and
  657.   returns to the main menu.  Note, however,
  658.   that this only works if you've toggled on
  659.   the Keyboard break option in the Options
  660.   menu.
  661. 'Go on...
  662.   When an error occurs, you're placed in the
  663.   editor at the point of error.  An error
  664.   description appears on the status line;
  665.   correct the error and then recompile.
  666.   If you've made changes to the source, when
  667.   recompiling your program, the Message
  668.   window will show in increments of 20 the
  669.   number of lines and statements processed.
  670.   The Run window shows your program's output;
  671.   while running it, use Alt-F5 to Zoom this
  672.   window.
  673.   The Compile command compiles the currently
  674.   loaded program.  Set the Compile to switch
  675.   in the Options menu to compile to an .EXE
  676.   file, to a .TBC file, or to memory (the
  677.   default).
  678.   If a Main file is not specified, then the
  679.   loaded file is compiled.  If you select Main
  680.   file, you are prompted to save the current
  681.   work file.
  682. 'Go on...
  683.   When compiling, the number of lines and
  684.   statements processed are recorded in the
  685.   Message window.
  686.   When an error occurs, you are placed in the
  687.   editor at the point of error.  The status
  688.   line displays the error's description;
  689.   correct your file and recompile.
  690.  Enter the size of the receive buffer for your
  691.  communications port (1 or 2).  The minimum is
  692.  0; the maximum is 32767; the default is 256.
  693.  Use the $COMn metastatement in programs to
  694.  allocate space for either of the two serial
  695.  receive buffers.
  696.  Use the Stack size option to enter a new
  697.  stack size within the interval 1024 to 32K
  698.  (400 Hex to 7FFE Hex).  The default size is
  699.  1024 bytes (one paragraph equals 16 bytes).
  700.  Enter the size of the background music buffer.
  701.  When you're not using the SOUND or PLAY
  702.  statements, set this to zero so your resulting
  703.  code will be smaller.
  704.  The minimum is 0; the maximum is 4096 notes;
  705.  the default is 32 notes (or 256 bytes; 1 note
  706.  equals 8 bytes).The $SOUND metastatement
  707.  can also be used to declare the buffer's
  708.  capacity.
  709.  You can use the Communications option to
  710.  specify the size of the receive buffer for
  711.  your communications port (1 or 2).  The
  712.  minimum is 0; the maximum is 32767; the
  713.  default is 256.  Use the $COMn metastatement
  714.  in some programs to allocate space for either
  715.  serial receive buffer.
  716.  Compiling to memory produces the fastest
  717.  results when you're in a development
  718.  environment.  So use this setting when
  719.  you're debugging and testing your program.
  720.  The EXE setting is usually used after you've
  721.  already debugged your program.  It creates
  722.  files that are runnable from the operating
  723.  system.  The file extension .EXE is appended
  724.  to these files.
  725.  Use this setting when you want to produce
  726.  files that can be chained or run from a Turbo
  727.  Basic-created .EXE file.  These files do not
  728.  include library routines and thus cannot be
  729.  run independently.  The files produced with
  730.  this option have the extension .TBC appended
  731.  to their names.
  732.  When compiling a program, you can choose from
  733.  three different file settings:
  734.  Memory
  735. EXE file
  736. Chain
  737.  Use the arrow keys to move to the desired
  738.  option or press the key that corresponds to
  739.  that option.
  740.  Turn on the 8087 required option when you're
  741.  using an 8087 coprocessor chip for program
  742.  execution.  When you have this option on,
  743.  Turbo Basic generates the best possible code
  744.  for floating-point operations, both fast and
  745.  compact, using inline 8087 statements.  The
  746.  disadvantage is that a program generated with
  747.  this option on won't run on a machine without
  748.  an 8087.
  749.  With the 8087 option off (the default),
  750.  programs can go both ways; that is, if an
  751.  8087 is available, the program will use it.
  752.  If not, the program will use software routines
  753.  to accomplish the same thing (only slower).
  754.  Turn on the keyboard break option in order to
  755.  stop a program with a Ctrl-Break sequence.
  756.  (This only applies to Ctrl-Break, not Ctrl-C).
  757.  Keep in mind that Ctrl-Break doesn't take
  758.  effect until your program outputs text (not
  759.  graphics) to the screen or printer or performs
  760.  keyboard input.  What this means is that you
  761.  cannot interrupt sequences that don't perform
  762.  I/O.
  763.  Toggle on the Auto save edit option in the
  764.  Setup menu so that your program is saved
  765.  automatically in case you crash or hang.
  766.  Toggle on Bounds to get the compiler to
  767.  generate array subscript-checking code.
  768.  Subscript-checking code ensures that a
  769.  subscript is appropriate (given the size of
  770.  the array it is to be used on) before reading
  771.  or writing the indicated element.  With Bounds
  772.  checking on, a subscript range error (error 9)
  773.  is reported whenever your program attempts to
  774.  use a subscript too large or too small for a
  775.  given array.
  776.  Note that the compiler always reports constant
  777.  out-of-range subscripts.
  778.  Compile your program with the Overflow option
  779.  on in order to detect the generation of any
  780.  overflow errors.  Overflow occurs when an
  781.  arithmetic operation produces a value beyond
  782.  the storage capacity of integers (-32,768 to
  783.  +32,767).
  784.  Turning off this option can cause the
  785.  assignment of an erroneous value(s).
  786.  Overflow checking occurs for integers, long
  787.  integers, or either of the floating-point
  788.  types (single precision and double precision);
  789.  however, integers have some exceptions (for
  790.  example, register calculations).
  791.  When compiling, toggle on Stack test if you
  792.  suspect your programs are running out of stack
  793.  space.  This switch causes Turbo Basic to
  794.  generate code that checks for stack collisions
  795.  upon entry to each subroutine, function, or
  796.  procedure.
  797.  If you want to allocate more stack space, use
  798.  the $STACK metastatement.
  799.  Select Parameter line to get Turbo Basic to
  800.  prompt for the string that the COMMAND$
  801.  function returns the next time a program is
  802.  run.  Type in your string and press Enter to
  803.  accept it.
  804.  This option lets you simulate command line
  805.  information to help you in debugging programs
  806.  from within Turbo Basic.
  807.  Metastatements control the compiler at compile
  808.  time (different from standard statements,
  809.  which control the program at runtime).  Called
  810.  compiler directives, they always begin with a
  811.  dollar sign ($).  Note, however, that your
  812.  source program can override these settings.
  813.  You can control three metastatements through
  814.  this option:
  815.  Stack size
  816. redefines the stack
  817.  Music buffer
  818. determines the size of
  819. the background music buffer
  820.  Communications
  821. changes the allocation of
  822. each serial receive buffer
  823.  Use the Trace option to globally set program
  824.  tracing.  You can override this switch with
  825.  embedded TRON and TROFF statements.
  826.  The Trace window will display statement
  827.  labels, line numbers, and procedure and
  828.  function names.
  829.  Use the key combo of Alt-F9 to toggle between
  830.  tracing and executing your program.  Alt-F10
  831.  single-steps to the next line number, label,
  832.  and so on.
  833.  Find errors in your .EXE and .TBC files by
  834.  using this option; no messages are given in
  835.  these cases.  Note, however, that when you're
  836.  running a program within the Turbo Basic
  837.  system, the following is automatic:
  838.  1.  Enter the program counter value in the box
  839. provided. Turbo Basic finds the correspond-
  840. ing point in your source code and places
  841. the cursor on the statement of error.
  842.  2.  When a run-time error occurs, Turbo Basic
  843. tells you the error number and its value
  844. in the processor's program counter at the
  845. time of error.
  846. Go on ...
  847.  The window you've selected is now the "active"
  848.  window (note the double border around it).
  849.  From now on, all other window commands will
  850.  affect this window.
  851.  If the selected window had been closed, it
  852.  will be created and will be brought to the
  853.  screen, or made "visible" again.
  854.  Environment variables are variables that
  855.  actually override compiler and/or program
  856.  options, and are determined by using the SET
  857.  command in DOS.  You may want to use these
  858.  variables if you have some special hardware
  859.  needs or if you're a developer who needs a
  860.  dynamic environment.
  861.  Environment variables affect the entire
  862.  environment in which a program is executed.
  863.  So once you set a variable, it's in effect
  864.  until you reset it to another value or turn
  865.  off your machine.
  866. 'Go on...
  867.  If you find yourself consistently setting
  868.  these values one way, you may want to enter
  869.  the SET command into a batch file or into your
  870.  AUTOEXEC.BAT file.
  871.  Turbo Basic's environment variables allow you
  872.  to override compiler and run-time options for
  873.  8087 support and Color/Graphics Adapter "snow"
  874.  checking.
  875. 'Go on...
  876.  The following example sets up an environment
  877.  for 8087 use by typing at the DOS prompt
  878.  SET 87=yes
  879.  where yes means you have an 8087; no means
  880.  even if you have an 8087, don't use it.  The
  881.  default setting is yes.
  882.  For CGA snow-checking, you could type
  883.  SET CGASNOWCHK=no
  884.  where no doesn't do snow-checking and yes does
  885.  snow-checking.
  886. Go on...
  887.  After selecting the Include directories,
  888.  you are prompted for a drive and a path.
  889.  Type it in and then press Enter.  You can
  890.  enter multiple directories in this option
  891.  by separating them with semicolons:
  892.   C:\TB; C:\DOS
  893.  If you change your mind about the directory
  894.  you've selected and want to reselect, you can
  895.  press Esc any time prior to leaving the system
  896.  box and before pressing Enter.  This will
  897.  return you to the directory selections.
  898.  After selecting the Executable directory, you
  899.  are prompted for a drive and a path.  Type it
  900.  in and then press Enter.
  901.  If you change your mind about the directory
  902.  you've selected and want to reselect, you can
  903.  press Esc any time prior to leaving the system
  904.  box and before pressing Enter.  This will
  905.  return you to the directory selections.
  906.  Toggle on Auto save edit when you want to
  907.  automatically save your current work file
  908.  before Running a program.
  909.  Toggle on Backup source files to automatically
  910.  back up (append the extension .BAK to) your
  911.  files.  Toggle it off when you don't want to
  912.  create a backup file each time you do a
  913.  Save.
  914.  The Miscellaneous option offers you access to
  915.  two handy options:
  916.  Auto save edit
  917. Backup source files
  918.  The Options command provides a number of
  919.  compile options that when chosen will have a
  920.  global effect.  These options control the
  921.  entire compilation unless overridden by
  922.  internal source program metastatements.
  923.  Compile to
  924. 8087 required
  925.  Keyboard break
  926. Bounds
  927.  Overflow
  928. Stack test
  929.  Parameter line
  930. Metastatements
  931.  The Setup command offers several options that
  932.  allow you to either inspect any of the setup
  933.  parameters, alter them, or permanently record
  934.  the current configuration in a .TB file.
  935.  Colors
  936. Directories
  937.  Miscellaneous
  938. Load Options/Window/Setup
  939.  Save Options/Window/Setup
  940.  Use Debug when you're trying to debug
  941.  your programs.  It offers these valuable
  942.  options:
  943.  Trace
  944.     Run-time error
  945.  By recompiling, Turbo Basic calculates the
  946.  point in a source program that corresponds to
  947.  a run-time address in an executable program.
  948.  Metastatements are compiler directives that
  949.  operate at a different level than regular
  950.  language statements, controlling the behavior
  951.  of the compiler at compile time.  All
  952.  metastatements always begin with a dollar sign
  953.  ($).  Turbo Basic's metastatements include:
  954.  $COM
  955. $INLINE
  956.  $DYNAMIC
  957. $SEGMENT
  958.  $EVENT
  959. $SOUND
  960.  $IF/$ELSE/$ENDIF
  961. $STACK
  962.  $INCLUDE
  963. $STATIC
  964.  $COM
  965. Syntax: $COMn size
  966.  Allocates space for the serial port receive
  967.  buffer.  The default is 256.  n indicates the
  968.  communications adapter and size is an integer
  969.  constant defining the capacity of the buffer
  970.  for that adapter.
  971.  $DYNAMIC
  972. Syntax: $DYNAMIC
  973.  Declares default array allocation to be
  974.  dynamic.  $DYNAMIC takes no argument.
  975.  $EVENT
  976. Syntax: $EVENT {ON|OFF}
  977.  Controls generation of event-trapping code.
  978.  $IF/$ELSE/$ENDIF
  979. Syntax: $IF const
  980. ... statements
  981. [$ELSE
  982. ... statements]
  983. $ENDIF
  984.  Define portions of a source program to skip
  985.  or compile.  const is a named constant or
  986.  constant value.  If const is nonzero (True),
  987.  then the statements between $IF and $ENDIF
  988.  are compiled and the statements between
  989.  $ELSE and $ENDIF are not. The $ELSE clause
  990.  is optional, but $ENDIF is required.
  991.  Conditional compilation statements can be
  992.  nested 256 deep.
  993.  $INCLUDE
  994. Syntax: $INCLUDE filespec literal
  995.  Includes a text file.  Use it to compile the
  996.  text of another file along with the current
  997.  file.  The $INCLUDE mechanism causes the
  998.  compiler to treat the included file as though
  999.  it were physically present in the original
  1000.  text.
  1001.  $INLINE
  1002.  Syntax: $INLINE [byte list]|[filespec literal]
  1003.  Declares inline machine code in an inline
  1004.  subprocedure.
  1005.  $SEGMENT
  1006. Syntax:  $SEGMENT
  1007.  Declares a new code segment.  Use this
  1008.  to break up your source program when
  1009.  the compiler reports that the 64K segment
  1010.  limitation has been exceeded.
  1011.  $SOUND
  1012. Syntax: $SOUND buffer size
  1013.  Declares the capacity of the background
  1014.  buffer.  buffer size is a numeric constant,
  1015.  indicating the capacity of the PLAY
  1016.  statement's background buffer (1 to 4096
  1017.  notes).
  1018.  $STACK
  1019. Syntax: $STACK count
  1020.  Declares the size of the run-time stack.
  1021.  count is a numeric constant from 1024 to 32K.
  1022.  The default is 1024 bytes (400H).
  1023.  $STATIC
  1024. Syntax: $STATIC
  1025.  Declares the default array allocation to be
  1026.  static.  $STATIC takes no arguments.  Space
  1027.  for static arrays is allocated at compile
  1028.  time.
  1029.  There are two types of errors in Turbo Basic:
  1030.  compile-time and run-time.  Compile-time
  1031.  errors are errors in syntax (missing symbols,
  1032.  misspelled commands, etc.)  discovered by the
  1033.  compiler.  Run-time errors are anomalies
  1034.  caught by error-detection mechanisms the
  1035.  compiler places in your executable programs.
  1036.  If a compile-time error occurs, you are placed
  1037.  in the editor, with the cursor positioned at
  1038.  the point of error.  You only need correct the
  1039.  error and recompile.  Turbo Basic lists the
  1040.  error number and a brief description of the
  1041.  error.  Compiler errors have error codes of
  1042.  256 and above.
  1043. Go on...
  1044.  Run-time errors occur when a compiled program
  1045.  is executed.  They can include file-system
  1046.  errors, improper function calls, memory
  1047.  errors, and a myriad of other problems.
  1048.  If a run-time error occurs in a program you're
  1049.  executing from within Turbo Basic, you'll also
  1050.  be placed at the point of error.  A run-time
  1051.  error occurring in a program run from DOS will
  1052.  simply be displayed in numeric form (not
  1053.  text).
  1054.  Refer to the ON ERROR and ERROR statements
  1055.  and the ERR, ERL, and ERADR functions for
  1056.  information about run-time error trapping.
  1057.  The program structure of a line of Turbo Basic
  1058.  source text consists of the following:
  1059.  [linenumber] statement[:statement]...['comment]
  1060.  label:
  1061.  $metastatement
  1062. 'Go on...
  1063.  linenumber is an integer in the range 0 to
  1064.  65535.
  1065.  statements are the building blocks that make
  1066.  up programs.  A line can contain none, one, or
  1067.  several statements, each separated by a colon.
  1068.  comment can be any text added to the end of a
  1069.  line and separated from the program itself by
  1070.  a single quote (').  REM can also be used as
  1071.  a comment delimiter.
  1072. 'Go on...
  1073.  label must appear on a line by itself, and
  1074.  serves to identify the statement immediately
  1075.  following it.  Labels must begin with a
  1076.  letter and be followed by a colon.  It can
  1077.  contain any number of letters and digits.
  1078.  $metastatements are statements that operate
  1079.  at a different level than standard statements,
  1080.  controlling the compiler at compile time.
  1081.  They are called compiler directives, and must
  1082.  always begin with a dollar sign ($).
  1083.  Unlike Interpretive BASIC, Turbo Basic doesn't
  1084.  always round the fractional part of a number
  1085.  up.  Turbo Basic treats in a special manner
  1086.  any number containing a 5 in its fractional
  1087.  part.  The number is always rounded toward the
  1088.  closest even number.  For example, 0.5 would
  1089.  be rounded down to 0; 9.005 would be rounded
  1090.  down to 9.00.
  1091.  When you save data, you are creating a file
  1092.  that can be used for input or output.  A file
  1093.  name consists of two parts, separated by a
  1094.  period:
  1095.  filename.ext
  1096.  where filename can be from one to eight
  1097.  characters, and ext is an optional type
  1098.  extension of up to three characters.  If a
  1099.  file name is longer than eight characters,
  1100.  Turbo Basic truncates the name and adds a
  1101.  period at its end.  An extension name longer
  1102.  than three characters is also truncated.
  1103. 'Go on...
  1104.  File names and extensions can contain the
  1105.  following characters:
  1106.  A-Z  0-9  ( ) { } @ # % ^ & ! - _ ' / ~
  1107.  The space character cannot be used and
  1108.  lowercase letters are automatically converted
  1109.  into uppercase.
  1110.  File names in Turbo Basic statements must be
  1111.  in string form; for example:
  1112.  KILL "MYFILE.BAK"
  1113.