home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / SNOB02.ZIP / USERMAN.DOC < prev   
Encoding:
Text File  |  1985-07-16  |  122.9 KB  |  3,191 lines

  1. .po 3
  2. .ll 72
  3. .op
  4. .in +3
  5. .sp 15
  6. .ce 2
  7. Snowcrest Specialties Multi User Basic
  8. for the IBM Personal Computer and compatibles.
  9. .sp 5
  10. .ce
  11. User's Manual
  12. .sp 10
  13. .ce 2
  14. Copyright 1984
  15. Snowcrest Computer Specialties
  16. .he           Snowcrest Specialties Multi User BASIC:  User's Guide
  17. .bp
  18. .sp 5
  19. .sp 3
  20. .ce
  21. TABLE OF CONTENTS
  22. .sp
  23. .li
  24.         1.    System Requirements ..............................
  25.                   What kind of hardware is needed?
  26.  
  27.         2.    Getting Started: .................................
  28.                   How to get SNOBASIC running.
  29.  
  30.         3.    Customizing SNOBASIC for your instalation ........
  31.                   Making SNOBASIC work for you.
  32.  
  33.         4.    Connecting Other Terminals to Your System ........
  34.                   How to wire the plugs.
  35.  
  36.         5.    System Maintenance: ..............................
  37.                   How to keep SNOBASIC running.
  38.  
  39.         6.    Differences Between SNOBASIC and Other BASICs: ...
  40.                   What is different?
  41.  
  42.         7.    SNOBASIC language manual: ........................
  43.                   A technical definition.
  44. .bp
  45. .pn 1
  46. .sp 3
  47. .ce
  48. System Requirements
  49. .sp 2
  50. Snowcrest Specialties Multi-User BASIC requires the following
  51. hardware for proper operation:
  52. .sp
  53. .ce
  54. Minimum System Requirements
  55. .li
  56.  
  57.         IBM PC or compatible system running DOS 2.0 and above.
  58.         Two floppy disk drives.
  59.         Minimum of 128K of memory for single user operation
  60. .sp 2
  61. .ce
  62. Recommended Additions
  63. .li
  64.  
  65.         One or Two double sided floppy disk drives, or a Hard disk.
  66.         An additional 16 to 48K additional memory per user.
  67.         A parallel line printer connected to lpt1:.
  68.         An asyncronous communications adapter for each additional user.
  69.         One terminal for each additional user.
  70. .ig
  71. Note: for serious multi user operation, a hard disk is
  72. highly recommended as it is several times faster than floppy
  73. disks.
  74. .he           Snowcrest Specialties Multi User BASIC:  Getting Started
  75. .bp
  76. .sp 3
  77. .ce
  78. Getting Started
  79. .sp 2
  80. SNOBASIC comes distributed on two single sided double density disks
  81. conforming to the IBM DOS 2.0 standard.  Disk one contains three files
  82. and one directory.  The file README.DOC contains the latest additions
  83. to this manual.  You should review README.DOC before you try to run
  84. SNOBASIC.  Disk two contains a version of SNOBASIC configured for use
  85. with the 8087 math co-processor, and miscellaneous support programs.
  86. .sp
  87. .ti -3
  88. 1. Make a copy of both distribution disks using the DOS DISKCOPY
  89. program. Place your original copies of SNOBASIC in a safe place.  These
  90. will be your backup copies in case something happens to your working copies.
  91. .sp
  92. .ti -3
  93. 2. Make your copy of disk one into a bootable disk by using the DOS SYS
  94. command.  This will allow you to boot directly on this disk.
  95. .sp
  96. .ti -3
  97. 3. Read the file README.DOC on disk one.  This file contains the latest
  98. additions to this manual and is intended to keep you up to date on any
  99. changes to the language.
  100. .sp
  101. .ti -3
  102. 4. If your system has the 8087 math co-processor installed, then copy
  103. the file SNOBAS87.EXE from disk two to SNOBASIC.EXE on disk one.  The
  104. 8087 version of SNOBASIC utilizes the math and trigonometric capabilities
  105. of the 8087 math co-processor and provides a significant speed increase
  106. for number crunching programs.
  107. .sp
  108. .ti -3
  109. 5. Type the command:  'startup'.  This will run the bat file named
  110. 'startup.bat' that loads up the initial system definition environment
  111. and runs SNOBASIC.  SNOBASIC will load into memory and and display
  112. a banner on the screen.  At this time SNOBASIC is loaded and you
  113. will be able to change disks to allow operation on a disk without
  114. having a large portion taken up by SNOBASIC.EXE.  Press any
  115. key to cause SNOBASIC to continue.
  116. NOTE:  you will not see any indication of operation until you press
  117. the 'ESC' key to begin logging in.
  118. .sp
  119. .ti -3
  120. 6. Press the 'ESC' key.  SNOBASIC will respond with a login message
  121. and prompt you for three items.  In the following, the single
  122. quotes are placed around user responses and should not
  123. be entered when typing.
  124. .sp
  125. The Terminal question is not currently
  126. used, but is included to allow future enhancements to SNOBASIC
  127. to communicate with various
  128. types of terminals.  When on the console, the correct response
  129. is 'console'.
  130. .sp
  131. The Account question is asking for the user account
  132. number.  The correct response is '9999'.  Note, the account will not
  133. print on the screen as you type.
  134. .sp
  135. The Password question is asking for
  136. the user password for the given account.  The correct response is 'start'.
  137. Again note, the password will not echo to the screen.
  138. Following is a sample signon.
  139. .li
  140.  
  141.             Snowcrest Computer Specialties
  142.             Multi-User Basic
  143.             Terminal? 'console'
  144.              Account? '____'
  145.             Password? '_____'
  146.             Hello, Friend
  147.  
  148.             Welcome to Snowcrest Basic!
  149.  
  150. .ig
  151. if either the account or the password were entered wrong, then SNOBASIC
  152. will sound the bell twice and print the message "Illegal Entries!".  If
  153. this happens, press the 'ESC' key and try again.  If you entered
  154. the account and password correctly, then SNOBASIC will greet you
  155. with a message and print "Ready".  At this time you are ready to
  156. proceed to the section on "adding user accounts"./
  157. .sp
  158. .ti -3
  159. 7. Once you have added your own accounts and passwords, you should
  160. sign off with the "Bye" command and sign in under your own account
  161. and change or delete the distribution sign on account to ensure
  162. the integrity of your system security.
  163. .he           Snowcrest Specialties Multi User BASIC:  Customizing
  164. .bp
  165. .sp 3
  166. .ce
  167. Customizing SNOBASIC for your system
  168. .sp 3
  169. SNOBASIC provides a mechanism to allow the system operator to tailor
  170. SNOBASIC to fit his particular needs.  The file startup.bat on the
  171. distribution disk one contains several DOS "SET" commands.  These
  172. are the user configurable parameters to SNOBASIC.  The available
  173. set commands are:
  174. .li
  175.  
  176.       NU -- Number of users.  Initialy 3
  177.       NB -- Number of system file buffers.  Initialy 10
  178.       SU -- Size of user memory area.  Initialy 24k bytes
  179.       U1 -- User port 1 definition. Initialy set for COM1:
  180.       U2 -- User port 2 definition. Initialy set for COM2:
  181.       U3 to Unn available for other port definitions.
  182.       D0 -- Disk number 1 path.  Initialy set to \dk0.
  183.       D1 to Dnnn available for other disk path definitions.
  184. .sp
  185. The environment variable NU defines the number of users SNOBASIC will
  186. recognize on the system at one time.  There must be one port definition
  187. for each user.  Each user beyond user 1 requires SU bytes + 3000 bytes
  188. of memory in addition to the 128K.
  189. .ti +5
  190. The form of the NU environment variable is NU=NN where NN is a decimal
  191. number from 1 to 11.  The NU variable allocates memory for each
  192. user according the the size of user memory specified by the SU variable.
  193. If there is not enough memory on the system, then an error will
  194. occur and SNOBASIC will return to DOS command mode.
  195. .sp
  196. The NB environment variable defines the
  197. number of system-wide file buffers.  Each buffer requires 512 bytes of memory.
  198. In general the more buffers, the better.  There is a point at which it takes
  199. more time to search the buffers for the desired record than it takes to 
  200. read it from the disk.  The actual number of buffers should be determined
  201. by what type of application is used.
  202. In an application where the processing is mostly sequential, a low number
  203. of buffers is best.  If the application does mostly random file access then
  204. a large number (10 to 30) of buffers is best.
  205. .ti +5
  206. The form of the NB variable is NB=NN where NN is a decimal number from 1
  207. to 40.  All file buffers reside in the same memory segment as the
  208. user memory image and SNOBASIC work variables, so SU + NB * 512
  209. cannot exceed 50K bytes, or an out of memory error will occur.
  210. .sp
  211. The SU environment
  212. variable defines the size of memory allocated to each user.  If there
  213. are many users, then this number may need to be set low to allow all users
  214. a block of memory.  If there is a lot of memory available and only a few
  215. users running large programs, then this variable may be set as large as
  216. 40 bytes.
  217. .ti +5
  218. The form of the SU variable is SU=NN where NN a decimal
  219. number from 1 to 40K bytes.  SU is the number of
  220. bytes to be allocated to each user.  This is the number of bytes available
  221. to load programs and hold variables.
  222. .sp
  223. The U1 thru Unn environment variables define the I/O port address, and
  224. baud rate for user ports 1 thru nn.  User port 0 is pre-defined as the
  225. system console.
  226. .ti +5
  227. The form of the Unn variables is:
  228. .li
  229.  
  230.       UN = Device address, Interrupt level, Baud rate
  231.  
  232. .ig
  233. Where 'Device address' is the i/o address of the communications
  234. adapter for that port.  The address must be in decimal.  'Interrupt level'
  235. defines what interrupt line the communications adapter uses to signal
  236. incoming data.  'Baud rate' is a decimal number 110, 300, 600 ... 9600
  237. specifying the communications baud rate, or 0 for automatic baud rate
  238. selection.  If automatic baud rate selction is used, then each time 
  239. break is sent then the system will change baud rates to another
  240. speed and "press" escape.  This is usually used for
  241. dial up modems using either 300 or 1200 baud communications.
  242. .ti +5
  243. Note: Adding more than 2 communications adapters requires that the
  244. adapter be modifed to interrupt on one of the unused interrupt lines.
  245. For COM1:, the interrupt level is 4.  For COM2:, the 
  246. interrupt level is 3.  Additional communications adapters must use
  247. interrupt level 2. If a hard disk is not installed, then level 5
  248. may be used.
  249. .sp
  250. The D0 thru Dnnn environment variables provide the mechanism for 
  251. referencing a DOS 2.0 directory path.  SNOBASIC does not limit
  252. the number of directories acessed through the disk directory
  253. environment variables.  The D0 directory must be defined, or
  254. SNOBASIC will not be able to run.  The D0 directory must contain
  255. the system support files.  (see appendix C).
  256. .ti +5
  257. The form of the Dnnn variables  is Dnnn='directory path'  Where
  258. 'directory path' is a full MS-DOS directory path name including
  259. a leading backslash.
  260. .sp
  261. The login banner and message are stored in the file
  262. fbasicme.sgs on the D0 directory.  This file contains the banner that
  263. is printed on the terminal when esc is pressed to begin the login
  264. procedure, and the message that is printed on the terminal
  265. when a user logs in sucessfully.  Both of these messages may be
  266. modified to suit the particular installation.  Any text editor
  267. such as "EDLIN" may be used.
  268. .ti +5
  269. See appendix C for more information on the basicmesgs file.
  270. .he     Snowcrest Specialties Multi User BASIC:  Connecting Terminals
  271. .bp
  272. .sp 3
  273. .ce
  274. Connecting Other Terminals to the system
  275. .sp 3
  276. The IBM asyncronous communications adapter is configured as DTE.  A DTE
  277. configured rs-232 connection is intended to connect to a modem, or other
  278. data communications device, this
  279. means that an ordinary terminal cannot connect directly to the system
  280. with a 'straight through' cable.  Following is a diagram how to connect
  281. a terminal to your system.
  282. .li
  283.  
  284.                    Terminal Connection
  285.  
  286.             db 25                        db 25  
  287.            female                         male
  288.        System Connector             Terminal Connector
  289.             +--+                          +--+
  290.             | 2|--------------------------|3 | 
  291.             | 3|--------------------------|2 |
  292.             |  |                          |  |
  293.             | 7|--------------------------|7 |
  294.             |  |                          |  |
  295.             +--+                          +--+
  296.  
  297. .ig
  298. Note that pins two and three are switched within the cable.  This effectivly
  299. changes the DTE configuration of the system into a DCE configuration.
  300. If you are connecting a modem to your system, then the following
  301. connection should be used.
  302. .li
  303.  
  304.                      Modem Connection
  305.  
  306.             db 25                        db 25  
  307.            female                         male
  308.        System Connector               Modem Connector
  309.             +--+                          +--+
  310.             | 2|--------------------------|2 |
  311.             | 3|--------------------------|3 |
  312.             | 4|--------------------------|4 |
  313.             | 5|--------------------------|5 |
  314.             | 6|--------------------------|6 |
  315.             | 7|--------------------------|7 |
  316.             | 8|--------------------------|8 |
  317.             |20|--------------------------|20|
  318.             +--+                          +--+
  319.  
  320. .ig
  321. It is possible to add up to two additional user ports by using the
  322. COM1 and COM2 communications adapters.  If more user ports are
  323. required, then another communications adapter may be modified
  324. to use interrupt level 2 and configured to use an unoccupied
  325. block of i/o addresses.  (each adapter occupies a block of 8
  326. i/o addresses). The startup.bat file must be modified
  327. to reflect addresses and interrupt levels of the additional ports.
  328. .sp
  329. As an alternative to modifying a standard communicatiions
  330. adapter, Snowcrest Computer Specialties supplies 4 or 8 line
  331. communications adapters that come pre-configured to allow up to
  332. 11 users on the system (8 + COM1, COM2 and console).
  333. .he       Snowcrest Specialties Multi User BASIC:  System Maintenance
  334. .bp
  335. .sp 3
  336. .ce
  337. SNOBASIC system maintenance
  338. .sp 3
  339. Once the system is up and running and you are satisfied with 
  340. he user configuration, then other user accounts may be added
  341. to the system.  User accounts are added and maintained
  342. with the program "accoun" stored under the system manager's
  343. account.  Each person who has access to the system should
  344. be given his own account number to help ensure system
  345. security and enable a valid "audit" of system activities via the
  346. log program.
  347. .sp
  348. Each time that SNOBASIC is brought up, when users log in 
  349. and out, and when the system is brought down with the "Kill"
  350. command, an entry is made in the system log file.  This makes
  351. it possible to determine how many times a particular user
  352. logged onto the system, and how much system time was used over a period
  353. of time.  The program "log" stored under the system managers account
  354. provides a way of listing this file.
  355. .sp
  356. The system log file is holds a finite number of entries determined by
  357. how large the file is created to be.  When the end of file is reached,
  358. then the log "wraps" around to the beginning and begins to overwrite
  359. the oldest entries.  If the system has a lot of activity, then the 
  360. log file needs to be made large enough to hold all transactions during
  361. the time between when the log file is inspected.  See appendix C
  362. for more information on the system log file.
  363. .he           Snowcrest Specialties Multi User BASIC:  Differences
  364. .bp
  365. .sp 3
  366. .ce
  367. Differences between SNOBASIC and other BASICs.
  368. .sp 3
  369. .in +5
  370. .ti -5
  371. String Handling
  372. .br
  373. Snowcrest Multi User Basic has enhanced string manipulation that
  374. eliminates the need for the LEFT$, RIGHT$ and MID$ statements
  375. found in other BASICs.  A string variable must be dimensioned before
  376. it can be used.  The dimension should be as large as the largest
  377. expected length of the string.  Strings may be as large
  378. as memory allows. The length of the string can be from 0 up to
  379. the size of the dimension.  Strings are referenced as
  380. a unit by using the variable name.  The right portion of the string
  381. may be referenced by including the beginning index of the substring
  382. as if it were a subscript of a singly dimensioned array.
  383. A substring is reference looks similar to a two dimensioned array except
  384. that the second subscript is really the ending index of the
  385. substring.  Doubly dimensioned strings are not allowed.
  386. .sp
  387. .ce
  388. example
  389. .li
  390.  
  391.               10 Dim a$(10)
  392.               20 Let a$="1234567890"
  393.               30 Print a$
  394.               40 Print a$(5)
  395.               50 Print a$(2,5)
  396.               60 Print a$(3,8)
  397.   
  398.           will print
  399.   
  400.               1234567890
  401.               567890
  402.               2345
  403.               345678
  404. .sp
  405. String concatination is accomplished by using an assignment
  406. statement with the two or more strings separated by a comma (,) rather
  407. than a plus sign as in other BASICs.  The plus sign (+) in
  408. a string assignment statement does string arithmetic and adds
  409. the two strings.
  410. .sp
  411. To fill a string with a particular character (i.e. blank filling a string)
  412. the string may be concatinated with itself as follows.
  413. .li
  414.  
  415.             10 dim a$(10)
  416.             20 let a$="X",a$
  417.  
  418. .ig
  419. will fill the string a$ with the character 'X'.
  420. .sp
  421. .ti -5
  422. Multiple Statements
  423. .br
  424. SNOBASIC does not allow multiple statements per line.  In essence, the
  425. colon (:) operator is not recognized as a statement delimiter.
  426. .sp
  427. .ti -5
  428. Remark Statements
  429. .br
  430. SNOBASIC does not allow a single quote (') at the end of a line
  431. to begin a remark.  All remarks in the program should be made
  432. with the "Rem" statement.
  433. .sp
  434. .ti -5
  435. Variable Names
  436. .br
  437. Variable names under SNOBASIC may consist of a single character
  438. in the range A to Z.
  439. followed by an optional digit in the range 0 to 9.
  440. If the variable is a string,
  441. then it must be followed by a dollar sign ($). Example:
  442. .li
  443.             Following are valid variable names.
  444.                 X
  445.                 Y1
  446.                 N1$
  447.             Following are not valid.
  448.                 1A      -- begins with a digit
  449.                 ABC     -- too many letters
  450. .sp
  451. .ti -5
  452. Files
  453. .br
  454. SNOBASIC was designed from the start to allow
  455. multiple users to utilize a single processor to access a common
  456. collection of programs and a common data base.  As a result,
  457. the file system has several items that are different than most BASICs
  458. available on the market.
  459. .sp
  460. Each file must be created and be given a maximum size before
  461. it can be used.  Otherwise if two users referenced the same file
  462. and one expanded the file and closed it and the other just modified
  463. an existing record and closed it.  It is possible that the file
  464. allocation data of the second user would overwrite the previously
  465. expanded file thus loosing the data of the first user.
  466. .sp
  467. Each file contains the account number of the person who created it.  If
  468. the file is to be accessed by all users, then the account number is 0.
  469. The account number portion of the file name is transparent to the users
  470. unless they have restriction bit 5 set.
  471. .sp
  472. There are two types of files on the system: Basic programs, and data files.
  473. Basic program files are created with the /b attribute (see the "Create"
  474. statement).  Data files are created by omitting the /b attribute
  475. in the "Create" statement.
  476. .sp
  477. Some BASICs have two statements that fill an i/o buffer prior
  478. to random file i/o.
  479. The LSET and RSET statements are not required under SNOBASIC as any
  480. variable may be used in a random disk write statement.
  481. .sp
  482. .ti -5
  483. Peek and Poke
  484. .br
  485. The "Peek" and "Poke" statements are not supported under SNOBASIC
  486. as they can cause serious problems in a multi user system
  487. if not used properly.
  488. .sp
  489. .cp 5
  490. .ti -5
  491. Program Continuation
  492. .br
  493. It is possible to continue a program stopped with the "esc" key even
  494. if a variable has been modified.  This greatly speeds program debugging.
  495. .sp
  496. .ti -5
  497. Graphics
  498. .br
  499. It is not possible to utilize the graphics capability of the IBM
  500. color graphics adapter since the programs written for SNOBASIC may
  501. not necessarily be run on the system console.
  502. .sp
  503. .ti -5
  504. Matrix Operations
  505. .br
  506. SNOBASIC provides a complete set of function to allow matrix
  507. manipulation.  This greatly eases the job of inverting a matrix
  508. or finding the determinant, as they are given by a single statement.
  509. .po 6
  510. .ce
  511. Definitions
  512. .in 3
  513. .ti 0
  514. 1. Constant - A numeric value.
  515. May be preceded by a unary minus sign
  516. and may contain a power of ten expressed in scientific
  517. notation. Numbers contain six significant digits.
  518. Numbers may be expressed with or without decimal
  519. points. Scientific notation is accomplished by using
  520. the letter "e" followed by an optional minus sign
  521. and a number ranging from zero to 38. The numerical
  522. range is approximately +-1.70141e38 and +-2e-39.
  523. .br
  524. Examples: 1,  -100,   2.56,   4.3576e-5,   3.9e12
  525. .sp 2
  526. .ti 0
  527. 2. Literal - An alpha-numeric
  528. string of characters enclosed within
  529. quotation marks. Literals may contain any
  530. ASCII characters. Non-printing
  531. ASCII characters may be
  532. represented by enclosing the decimal value of
  533. the character as a constant within angle brackets
  534. (<>). (See appendix A for ASCII values.)
  535. .br
  536. Examples: "Hello",   "<13>message",   "123skidoo"
  537. .sp 2
  538. .ti 0
  539. 3. Variable - A named location into which
  540. numeric or alpha-numeric data is to be stored.
  541. Numeric variables may be named with a single
  542. letter or a single letter followed by a single digit.
  543. Alpha-numeric variables (which are termed string
  544. variables) may be as above, followed by a dollar
  545. sign ($). Numeric variables may be dimensioned in order
  546. to allow a single variable name to refer to a group of
  547. stored data, and string variables must be dimensioned
  548. (refer to the discussion of the "Dim" statement).
  549. .br
  550. Examples: A,   N9,   K3,   D$,   N5$
  551. .sp 2
  552. .ti 0
  553. 4. Operators - Special characters which,
  554. when used in an expression
  555. (see below), specify a specific operation such as
  556. multiplication or division to be performed on the
  557. numeric or string values which are found on either
  558. side of the operator. The various types of operators
  559. are:
  560. .li
  561.     Arithmetics-    +    Addition
  562.             -    Subtraction
  563.             *    Multiplication
  564.             /    Division
  565.             ^    Exponentiation
  566.     Relationals-    <    Less than
  567.             >    Greater than
  568.             =    Equals
  569.             <=    Less than or equals
  570.             >=    Greater than or equals
  571.             <>, #    Not equals
  572.     Logicals-    and    Logical and
  573.             or    Logical or
  574.     Special-    min    Minimum function
  575.             max    Maximum function
  576. .br
  577. The operators each have an assigned priority, and when
  578. used in an expression, all operators of the highest
  579. priority are evaluated first (from left to right), then
  580. the next priority, until the lowest priority have been
  581. evaluated. The operators in order of their priorities,
  582. highest to lowest, are:
  583. .li
  584.  
  585.         Functions    (highest priority)
  586.         ^
  587.         * /
  588.         + -
  589.         max min
  590.         < > = <= >= <>
  591.         and
  592.         or        (lowest priority)
  593.  
  594. .br
  595. Parentheses () may be used to alter the priority scheme.
  596. In any expression, elements enclosed in parentheses will
  597. be evaluated first (with the operators within the
  598. parentheses evaluated in the order given above), then
  599. the remaining portion of the expression will be evaluated.
  600. See below under "expressions" for examples.
  601. .sp 2
  602. .ti 0
  603. 5. Functions - A system or user defined procedure
  604. which operates on
  605. a supplied value. Functions are three-letter reserved
  606. words which are followed by the supplied value enclosed
  607. in parentheses. The system defined functions are:
  608. .li
  609.     abs(X)    Absolute value of X
  610.     asc(A$)    ASCII value of first character in A$.
  611.     atn(X)    Arctangent of X
  612.         (-pi/2<atn(X)<pi/2)
  613.     cos(X)    Cosine of X (X in radians)
  614.     det(X)    Determinant of last matrix inverted
  615.     exp(X)    Exponential of X
  616.     int(X)    Integer function of X
  617.     len(A$)    Number of characters actually stored
  618.         in the string A$.
  619.     log(X)    Natural logarithm of X
  620.     prt(X)    Account number of user at port X
  621.     rnd(X)    Random number, range 0 to 1
  622.     sgn(X)    Indicates algebraic sign of X
  623.     sin(X)    Sine of X (X in radians)
  624.     sqr(X)    Square root of X
  625.     tan(X)    Tangent of X (X in radians)
  626.     tim(X)    Time of day. X=3 for year, X=2 for
  627.         Julian day, X=1 for hour, X=0 for
  628.         minute, X=-1 for second.
  629.     sys(X)    X=0 for seconds past midnight
  630.         X=1 for month of year
  631.         X=2 for day of month
  632.         X=3 for year (0-99)
  633.         X=4 for port number (0-15)
  634.         X=5 for cpu seconds used
  635.         X=6 for # sectors in last opened file
  636.         X=7 for last error message type
  637.         X=8 for default disk number
  638.         X=9 for last error line number
  639.         X=10 for user's account number
  640.         X=11 for number of users currently
  641.              signed on the system.
  642.         X=12 for current priority/slot interval
  643.         X=13 for total bytes of memory.
  644.         X=14 for remaining memory available
  645.         X=15 for restriction word.
  646.         X=16 for last error message number
  647.  
  648. .br
  649. User defined functions have the names fna-fnz. See the
  650. discussion under the "Def" statement for more information.
  651. Functions may be used anywhere that a numeric
  652. variable is allowed.
  653. .sp 2
  654. .ti 0
  655. 6. Expression - Any combination of constants,
  656. literals, strings,
  657. operators, and functions, which result in a numeric
  658. value. A single constant or numeric variable is a
  659. valid expression. Two strings (or literals or combination
  660. of string and literal) joined by a relational
  661. operator make a valid expression. A single
  662. string variable or literal is not a valid expression
  663. since the expression must evaluate to a numeric value.
  664. .sp 2
  665. .li
  666. Examples:
  667.     A           (single numeric variable)
  668.     3           (single constant)
  669.     A+5/3
  670.     "hello"=a$  (evaluates to 0 or 1)
  671.     log(N)+(45.3E5*K or F)
  672.     C5<10       (evaluates to 0 or 1)
  673. .sp 2
  674. .ti 0
  675. 7. Statement - Any of the list of
  676. reserved words given below preceded
  677. by a statement number (except in the case of the statement
  678. following the reserved word "then" in an "If"
  679. statement, see the discussion of the "If" statement)
  680. and followed by appropriate elements. Statements are
  681. stored in numeric order when entered and executed
  682. upon the detection of the command "Run".
  683. .sp 2
  684. .li
  685. Statement reserved words:
  686. (Words preceded by an asterisk (*) may be used as commands)
  687.  
  688.     *Bye         Hold            *Read file
  689.     *Chain         If             Rel
  690.     *Clear         Input            *Rem
  691.     *Close         Input file        *Rename
  692.     *Close file    *Let            *Restore
  693.     *Create        *Log             Return
  694.      Data        *Lowup            *Show
  695.      Def        *New            *Sign
  696.      Decode         Next             Sleep
  697.     *Delete        *Nulls            *Slot
  698.     *Dim         On            *Sort
  699.     *Disk        *Open file         Stop
  700.      Encode        *Print             Tinput
  701.      End        *Print file        *Trace
  702.      For        *Print file using   *Uplow
  703.     *Full        *Print using        *Write file
  704.      Gosub        *Prty            *Zap
  705.      Goto        *Random
  706.     *Half        *Read
  707. .sp 2
  708. .ti 0
  709. 8. Command - Any of the above
  710. statement reserved words which are
  711. preceded by an asterisk (*) if entered without
  712. a preceding statement number, or any of the command
  713. reserved words listed below, preceded and/or followed
  714. by appropriate elements. A command is executed immediately
  715. upon entering.
  716. .li
  717. Command reserved words:
  718.  
  719.     Append        Load
  720.     Cont        Psave
  721.     Direc        Public
  722.     Error        Renumb
  723.     Kill        Run
  724.     Length        Save
  725.     Lib        Size
  726.     Lines        Time
  727.     List
  728.  
  729. .ti 0
  730. 9. String Expression -A string expression
  731. is a special case of the "Let" statement that
  732. allows the contents of two string variables to be added or subtracted
  733. numerically.  The syntax of a
  734. string expression is as follows:
  735. .sp
  736. <string variable> = <string variable> + or - <string variable>
  737. .sp
  738. The two strings being added must be the same length, and can
  739. contain only digits 0 thru 9 with a leading plus or minus sign.
  740. The length of the destination string must be large enough to hold
  741. the result of the operation. If the result is larger than the length
  742. of the destination, then an overflow error occurs. There is no limit
  743. on the length of the strings operated upon other than
  744. the amount that will fit in memory.
  745. .br
  746. note: The actual length of the strings (as returned by the "len"
  747. function) are
  748. significant, not the dimensioned size.
  749. .sp 2
  750. .qi
  751. .pa
  752. .ce
  753. Miscellaneous
  754. .sp 2
  755. Statement numbers run from 1 to 65535 inclusive.
  756. .sp 2
  757. On the following pages, elements enclosed in square brackets [] are
  758. optional. When there is a possibility of more than one syntax, the
  759. various options will be listed on separate lines. Angle brackets <> will
  760. enclose the words defined on the definition pages.
  761. .sp 2
  762. Relational operators and logical operators evaluate to true or false.
  763. True is defined as any non-zero value (the operators evaluate to 1), and
  764. false is defined as zero. Min and max evaluate to the algebraically
  765. smaller (in the case of min) or larger (in the case of max) of the
  766. numeric expressions on either side of the operator.
  767. .sp 2
  768. String literals and variables may be operated upon only by the 
  769. relational operators (<,>,=,<=,>=,<>) with the exception of
  770. + or - as used in a string expression (see 9 above).
  771. .sp 2
  772. Strings may be used within expressions in their entirety by specifying
  773. the name of the string only, such as A$. If the name is subscripted,
  774. the first subscript specifies the first character position to be used,
  775. and the second subscript specifies the last character position to be
  776. used. If only one subscript is given, the string specified will begin
  777. at that character position and proceed to the end. For example,
  778. A$(5,10) specifies the characters from and including character number
  779. five through and including character number ten of the string named A$.
  780. A$(3) specifies all the characters in the string A$ from the third
  781. through the last. Note that the length of the string (as given by the
  782. "len" function) is different from the dimension of the string (as
  783. specified by the "Dim" statement). The length is the actual number of
  784. characters stored in the string, and the dimension is the maximum
  785. number that could be stored in the string. When filling a string (via
  786. the "Let", "Input", or "Read" statements), the starting character
  787. position specified for the destination string (if given) must be less
  788. than or equal to the previous length of that string plus one. That
  789. is, if A$ contains five characters (len(A$)=5), the first three
  790. statements below would be correct, but the fourth would result in an
  791. error message:
  792. .sp 2
  793. .li
  794.         10 Let A$(3)="more message after character two"
  795.         10 Let A$(6)="appended message"
  796.         10 Let A$(len(A$+1))="automatically appended message"
  797.         10 Let A$(10)="invalid, space between characters 5 and 10)"
  798. .sp 2
  799. File names as described on the following pages have the following
  800. characteristics:
  801. .in 3
  802. .ti 0
  803. 1. File names in commands which are not statements (see definition
  804. number 8) are given as a series of characters without quotation
  805. marks.  String variables are not allowed in this case.
  806. .ti 0
  807. 2. File names which are part of any statement are given as string
  808. variables or string literals (enclosed in quotation marks).
  809. .ti 0
  810. 3. For the statements "Create" and "Delete",
  811. if the user has bit 5 on in his restriction word (see appendix
  812. D), he must specify the account number as well as the file name.
  813. If the user does not have bit 5 on, these statements act as
  814. all other statements.
  815. .ti 0
  816. 4. With the exception of the statements given in (3.) above, the
  817. system first searches for the file under the user's account
  818. number.  Then a search is made of
  819. the public files.  Then, if the restrictions allow
  820. (bit 5 is on in the user's restriction word - appendix D), a search
  821. is made of the remaining files on the directory to find a match
  822. to the specified file name. Thus, a person with bit 5 on in his
  823. restriction word may open files belonging to other users by
  824. specifying the other user's account number as the first four
  825. characters of the file name.  He may also open files which are
  826. not preceded by an account number (and thus do not show up in
  827. ANY directory).
  828. .qi
  829. .pa
  830. .ce
  831. Entering and editing
  832. .ce
  833. programs
  834. .sp 3
  835. .in 3
  836. .ti 0
  837. 1. Programs are entered simply by typing the various statements preceded
  838. by their line numbers. Statements will be internally arranged in
  839. ascending numerical order, no matter in what order they are entered.
  840. .ti 0
  841. 2. If a statement is entered without a preceding line number, and is
  842. one of the statements with an asterisk in the table above (definitions
  843. number 7), or one of the commands (definitions number 8), it will not
  844. be stored as part of the program and will be executed immediately.
  845. .ti 0
  846. 3. If the statement number on an entered statement is the same number as
  847. an already existing statement, the existing statement will be replaced
  848. by the new statement.
  849. .ti 0
  850. 4. If the new statement number falls between two
  851. existing statement numbers, the new statement will be inserted between
  852. the two existing statements.
  853. .ti 0
  854. 5. If a statement number is typed followed
  855. immediately by a carriage return, the existing statement of that
  856. number will be deleted.
  857. .ti 0
  858. 6. If a statement number is entered, followed by
  859. a dash (minus sign), followed by another statement number, all
  860. statements with numbers greater than or equal to the first and less
  861. than or equal to the second will be deleted.  That is, "10-50" will
  862. delete statements 10 through 50 inclusive.
  863. .ti 0
  864. 7. At any time in BASIC, whether entering program or data, mistakes may
  865. be corrected by using the key defined in the program environment as
  866. the cancel key (usually the Ctrl X key (^x)).  They may also be
  867. corrected using the backspace (^h) or delete (rub-out; shift backspace
  868. on some keyboards).  The cancel key (^x) will erase internally all
  869. information entered since the last
  870. occurance of the carriage return key. Delete or backspace will erase
  871. one character at a time, up to the last occurance of the carriage
  872. return key. (When delete is pressed, the character being deleted
  873. is echoed to the terminal).
  874. .ti 0
  875. 8. The escape key ("esc") is the
  876. "panic button" in BASIC. This key is used to initiate the original
  877. sign-in procedure, to erase the current line (echoing a carriage return
  878. instead of back slash) during program editing, or to stop program
  879. execution. If the key is used to stop program execution, the message
  880. "Stop at line xxx" (where xxx is the next line number to be executed) will
  881. be printed at the user's terminal. The line number given may be used
  882. in a subsequent "Run" statement to resume execution, if desired.
  883. If the program being executed is in the process of printing on the
  884. user's terminal, the internal print buffer will be emptied before the
  885. escape key takes effect.
  886. .pa
  887. .ce
  888. Bye statement
  889. .sp 3
  890. [<statement number>] Bye
  891. .sp 2
  892. Causes the user to be signed off the system.  The time of
  893. day and the number of cpu seconds (actual computing time) used will
  894. be printed on the terminal and the terminal will be disabled until such
  895. time as the escape key is pressed to enable another sign-in.  This
  896. command also informs the system log that the user is signed off,
  897. thus terminating the accumulation of elapsed time charged to that
  898. user.  Therefore, it is
  899. important that the user not neglect to use this command.
  900. .pa
  901. .ce
  902. Chain statement
  903. .sp 3
  904. [<statement number>] Chain <string variable or literal>[,<statement number>]
  905. .sp 2
  906. .li
  907.     100 Chain "prog2"
  908.     200 Chain A$
  909.     300 Chain "next",20
  910. .sp 2
  911. Loads the program specified by the string and "Run"s that program. If
  912. no comma and statement number are supplied, execution begins at the
  913. lowest numbered statement in the new program. If a statement number is
  914. given, execution will begin at that statement number. If a statement
  915. number is given and the new program does not contain a statement with
  916. that number, execution will begin at the lowest numbered statement.
  917. If there does not exist a program with the name given by the string, an
  918. error message will be given. An assumed "New" will be performed before
  919. looking for the new program. Therefore, variables and statements
  920. are not common between the two programs. If the new program does not
  921. exist, the old program will have been lost by the time of the error
  922. message.
  923. .sp 2
  924. Example 100 causes the program named "prog2" to be loaded and run.
  925. .br
  926. Example 200 causes the program whose name is in A$ to be loaded and run.
  927. .br
  928. Example 300 causes the program named "next" to be loaded and run starting
  929. at the statement numbered 20.
  930. .pa
  931. .ce
  932. Clear statement
  933. .sp 3
  934. [<statement number>] Clear
  935. .sp 2
  936. Causes all variables in the program to be unassigned and undimensioned.
  937. All storage being taken by the variables is returned to the user space.
  938. All internal stacks (For-Next, Gosub-Return, defined functions, etc.)
  939. are reset and all files are closed.  This statement is equivalent to a
  940. run command without a statement number except that the program continues
  941. to run with the next statement (unless "Clear" is typed as a command,
  942. in which case the program is not
  943. executed.  This statement may be used to separate two logical programs
  944. without requiring them to be loaded seperately.
  945. .pa
  946. .ce
  947. Close statement
  948. .sp 3
  949. [<statement number>] Close
  950. .sp 2
  951. This statement functions exactly as the Close file statement (see
  952. below), with the exception that all currently open channels are closed.
  953. .sp 5
  954. .ce
  955. Close file statement
  956. .sp 3
  957. [<statement number>] Close file(<expression>)
  958. .sp 2
  959. .li
  960.     100 Close file(0)
  961.     200 Close file(A-5)
  962. .sp 2
  963. Closes the channel given by the expression, releases the device
  964. assigned to the channel (if other than disk) for other users, and
  965. releases the channel for this user. If the channel is associated with
  966. an output file, close will empty the memory buffer to the specified
  967. file.
  968. .sp 2
  969. Example 100 will close channel 0. Example 200 will close the channel
  970. whose number is 5 less than the contents of variable A.
  971. .pa
  972. .ce
  973. Copy statement
  974. .sp 3
  975. [<statement number>] Copy <source file name>,<destination file name>
  976. .sp 2
  977. .li
  978.     100 Copy "source","dest"
  979. .sp 2
  980. Causes the contents of the source file to be transferred to the
  981. destination file.
  982. .sp 2
  983. Example 100 causes the contents of the file named source to be
  984. transferred to the file named dest.
  985. .pa
  986. .ce
  987. Create statement
  988. .sp 3
  989. [<statement number>] Create <file name [/b]>,<expression>
  990. .sp 2
  991. .li
  992.     100 Create "d3:newfil/b",10
  993. .sp 2
  994. Causes space to be reserved on the disk specified for the number of
  995. sectors given in the expression following the comma.  The space will be
  996. given the name and the attributes specified. If there is not room in the
  997. directory or on the disk to place this file, an
  998. error message will be given.
  999. .br
  1000. If the file is to be used to save a basic program, then the file should
  1001. be created with the /b attribute as shown in the example.  If the
  1002. file is to be used to hold data, then no attribute should be given.
  1003. .pa
  1004. .ce
  1005. Data statement
  1006. .sp 3
  1007. <statement number> Data <expression or string or literal> ...
  1008. .sp 2
  1009. .li
  1010.     100 Data 1,2,3,4,5
  1011.     200 Data "hi",3,"bye",56
  1012.     300 Data A,B*4+2,rnd(0)*10,D$
  1013. .sp 2
  1014. Supplies data for the "Read" statement. As each "Read" statement is
  1015. encountered, one element, starting from the first element in the lowest
  1016. numbered "Data" statement, per each element in the "Read" statement will
  1017. be supplied. If a variable or expression is encountered in the "Data"
  1018. statement, it will be evaluated and the resultant value will be supplied
  1019. to the "Read" statement element. If a numeric element is encountered
  1020. in the "Data" statement for a string variable in the "Read" statement,
  1021. or if a string element is encountered in the "Data" statement for a
  1022. numeric variable in the "Read" statement, an error message will be
  1023. printed.
  1024. .sp 2
  1025. Example 100 will supply the values 1 through 5 to 5 numeric variables
  1026. in a "Read" statement.
  1027. .br
  1028. Example 200 will supply values to a string
  1029. variable, numeric, string, and numeric.
  1030. .br
  1031. Example 300 will operate
  1032. similarly, except that the expressions given will be evaluated before
  1033. supplying values. The last variable in the example will supply the
  1034. contents of the variable D$ to the corresponding string variable in
  1035. the associated "Read" statement.
  1036. .pa
  1037. .ce
  1038. Decode statement
  1039. .sp 3
  1040. .li
  1041. <statement number> Decode <string variable>,
  1042.               [using <string or literal>,]
  1043.               <expression>[, or ; <expression>...]
  1044. .sp 2
  1045. .li
  1046.     100 Decode A$,N*SIN(X)
  1047.     200 Decode Y$,using "#####.##",z
  1048.     300 Decode N$,I,I*I,Sqr(I)
  1049. .sp 2
  1050. this statement is identical to a print statement except that the
  1051. output is sent to a string variable instead of the terminal.
  1052. see "Print" or "Print using" for additional examples
  1053. .sp 2
  1054. Example 100 will place in the string A$ the result of N times the "Sin"
  1055. of X.
  1056. .br
  1057. Example 200 will place in the string Y$ the contents of Z, using
  1058. the string "#####.##" as a conversion template.
  1059. .br
  1060. Example 300 Places in N$ a string which has I, I squared and the
  1061. square root of I.
  1062. .pa
  1063. .ce
  1064. Def statement
  1065. .sp 3
  1066. <statement number> Def fn*(<numeric variable>)=<expression>
  1067. --where the * is replaced by any letter a-z.
  1068. .sp 2
  1069. .li
  1070.     100 Def fna(X)=X*X
  1071.     200 Def fne(X)=X-int(X/2)*2=0
  1072.     300 Def fns(B)=A$(B,B)="*"
  1073. .sp 2
  1074. Defines a user function. Up to 26 user functions may be defined for any
  1075. program (corresponding to the 26 letters of the alphabet). After a "Def"
  1076. statement has been executed, that function may be used in any expression
  1077. anywhere that a numeric variable or constant is allowed. If the variable
  1078. used within the parentheses of the definition is used in the expression
  1079. to the right of the equals sign, the variable will be replaced by the
  1080. value given within the parentheses of the call to the function. That
  1081. particular variable is local to the "Def" statement. Any other variables
  1082. will be given the value they had elsewhere in the program when the
  1083. function is called. A function may be defined on only one line.
  1084. .sp 2
  1085. Example 100 defines a function which will return the square of any value
  1086. given to it. That is, the statement, let A=fna(8) would set A equal to
  1087. 64.
  1088. .br
  1089. Example 200 defines a function which will return the value 1 if the
  1090. called value is even, and will return the value 0 if the called value
  1091. is odd. That is, let N=fne(4) will set N equal to 1, and let N=fne(9)
  1092. will set n equal to 0.
  1093. .br
  1094. Example 300 will return the value 1 if A$
  1095. contains an asterisk (*) at the position pointed to by the calling
  1096. value. That is, if A$ contains an asterisk at position 5, let N=fns(3)
  1097. will set N=0, and let N=fns(5) will set N=1. Notice that in the examples
  1098. above, the variables X and B, which are the "dummy" variables of the
  1099. various functions, have no relation to the variables X and B elsewhere
  1100. in the program, but the variable A$ is the same A$ as elsewhere in
  1101. the program.
  1102. .pa
  1103. .ce
  1104. Delete statement
  1105. .sp 3
  1106. [<statement number>] Delete <file name>
  1107. .sp 2
  1108.     100 Delete "d2:oldfil"
  1109. .sp 2
  1110. Causes the specified file to be deleted from the directory.
  1111. .sp 2
  1112. Example 100 causes the file named oldfil on disk number 2 to be
  1113. deleted.
  1114. .pa
  1115. .ce
  1116. Dim statement
  1117. .sp 3
  1118. [<statement number>] Dim <variable>(<expression>) ...
  1119. .sp 2
  1120. .li
  1121.     100 Dim A(50),B(100),C(2,4)
  1122.     200 Dim A$(20),K(3),C9(2000)
  1123.     300 Dim S(H*3+V9)
  1124. .sp 2
  1125. Reserves storage for a particular variable and, in the case of numeric
  1126. variables, informs the system that said variable is to be considered as
  1127. a list variable (in the case of a single dimension), or as a matrix
  1128. variable (in the case of a doubly dimensioned variable).
  1129. .sp 2
  1130. Numeric variables take two words for every position reserved, and
  1131. string variables take X/2+1 words (where X is the dimension value).
  1132. Numeric lists and matrices begin at position 0,
  1133. and string variables always begin at position 1. Strings must be
  1134. dimensioned before they are used, even if they are to have only
  1135. one position. Numeric lists and matrices may be used without first
  1136. dimensioning them, in which case they receive default dimensions of
  1137. (10) or (10,10).
  1138. .sp 2
  1139. Example 100 reserves 51 positions for numeric list variable A (0-50),
  1140. 101 positions for B, and 15 positions for matrix C.
  1141. .br
  1142. Example 200
  1143. reserves 20 positions for string variable A$, 4 positions for numeric
  1144. K, and 2001 positions for numeric C9.
  1145. .br
  1146. Example 300 reserves the number
  1147. of positions represented by the expression H*3+V9 plus one for
  1148. numeric S.
  1149. .pa
  1150. .ce
  1151. Disk statement
  1152. .sp 3
  1153. [<statement number>] Disk <disk number>[,<account number>]
  1154. .sp 2
  1155.     100 Disk 3
  1156. .sp 2
  1157. This statement causes all subsequent references to disk files to use
  1158. the specified disk as the default disk.  This statement affects only
  1159. the user who gives it, and is reset upon giving a "Bye" statement.  If
  1160. no disk number is given, the system default disk will become the user's
  1161. default disk (as was the case at sign-in time).
  1162. .sp 2
  1163. If the optional account number is specified, and if the user has bit 10
  1164. on in his restriction word (see appendix D), then his default account
  1165. number will be changed from his own account number to the one
  1166. specified.  This will affect all subsequent Open, Load, Chain, Save,
  1167. List, and Direc statements.  The user will still be operating with the
  1168. same set of restrictions as his original account number, and the Lines
  1169. command will still return his original account name.
  1170. .sp 2
  1171. Example 100 causes all future references to disk files (which do not
  1172. have an explicit disk number followed by a colon [:]) to reference disk
  1173. number three.
  1174. .pa
  1175. .ce
  1176. Encode statement
  1177. .sp 3
  1178. <statement number> Encode <string>,<variable>[,<variable>,...]
  1179. .sp 2
  1180. .li
  1181.     100 Encode "1234,4355",n1,n2
  1182.     200 Encode A$,a
  1183. .sp 2
  1184. This statement is identical to the input statement, except that
  1185. the source of the input comes from a instead of the terminal.
  1186. .sp 2
  1187. Example 100 converts the string "1234,4355" into a numeric form and places
  1188. 1234 into variable n1, and places 4355 into the variable n2.
  1189. .br
  1190. Example 200 reads the string A$ into the variable a.
  1191. .pa
  1192. .ce
  1193. End statement
  1194. .sp 3
  1195. <statement number> End
  1196. .sp 2
  1197. .li
  1198.     100 End
  1199. .sp 2
  1200. Causes termination of program execution and the printing of the
  1201. message "Ready" on the terminal. As many end statements may be
  1202. used in a program as desired, and no end statement is necessary.
  1203. If a program does not contain an end statement, execution will
  1204. terminate upon execution of the last statement of the program,
  1205. upon execution of a stop statement, upon the user pressing the
  1206. "esc" key on the terminal, or upon the program reaching a fatal
  1207. error.
  1208. .sp 2
  1209. Example 100 causes the message "Ready" to be printed on the
  1210. user's terminal and the program to cease execution.
  1211. .pa
  1212. .ce
  1213. For statement
  1214. .sp 3
  1215. .li
  1216. <statement number> For <non-subscripted numeric variable-called the
  1217.             "control variable">=<expression>to<expression>
  1218.             [step<expression>]
  1219.  
  1220.     100 For I=1 to 10
  1221.     200 For J=2.04 to -10.68 step -.02
  1222.     300 For K=A(3) to B9
  1223. .sp 2
  1224. This statement is used in conjunction with a "Next" statement to cause
  1225. the program to loop through a group of statements. Upon execution of
  1226. the for statement, the control variable is set to the value of the
  1227. expression immediately following the equals sign (=). Control is then
  1228. passed to the statement following the "For" statement. Upon reaching
  1229. a "Next" statement with the corresponding control variable, the value
  1230. of the expression following the "step" (as evaluated when the for
  1231. statement was first executed) if specified is added to the control
  1232. variable and compared with the value of the expression following the
  1233. "to" (as evaluated when the for statement was first executed). If
  1234. the resultant value of the control variable is <= the expression
  1235. following the "to" (for positive step; >= for negative step), control
  1236. is passed to the statement following the "For" statement again, but
  1237. with the new value in the control variable. If the resultant value
  1238. is > the expression following the "to" (or < for negative step),
  1239. the control variable is not changed and control passes to the
  1240. statement following the "Next" statement. Thus, when the loop is
  1241. terminated, the control variable contains the value that it
  1242. possessed during the final pass through the loop. If no value is
  1243. given following "step", one (1) is assumed. The values given in
  1244. the expressions above need not necessarily be integers.
  1245. .sp 2
  1246. Example 100 will cause a loop of the statements following the "For"
  1247. to the "Next" statement first with I=1, then with I=2, then with I=3,
  1248. etc., Until the final loop when I=10. The loop, then, would have
  1249. been executed 10 times with I=10 when control is passed to the
  1250. statement following the "Next" statement.
  1251. .br
  1252. Example 200 shows a loop
  1253. with a specified step. The control variable, J, will be decremented
  1254. by .02 Each time through the loop.
  1255. .br
  1256. Example 300 shows a loop which
  1257. will be determined by the contents of A(3) and B9.
  1258. .pa
  1259. .ce
  1260. Full statement
  1261. .sp 3
  1262. [<statement number>] Full
  1263. .sp 2
  1264. .li
  1265.     100 Full
  1266.     Full
  1267. .sp 2
  1268. This statement causes the terminal echo to be enabled. The echo
  1269. may be disabled by means of the "Half" statement. The effects of
  1270. this statement remain until a "Half" statement is executed,
  1271. regardless of termination of the program, loading of new programs,
  1272. or any other action other than signing off. Echo enabled is
  1273. the default condition at sign-on time.
  1274. .sp 2
  1275. Example 100 enables echo when executed within the program. The
  1276. second example enables echo immediately.
  1277. .pa
  1278. .ce
  1279. Gosub statement
  1280. .sp 3
  1281. <statement number> Gosub <statement number>
  1282. .sp 2
  1283. .li
  1284.     100 Gosub 500
  1285. .sp 2
  1286. This statement functions exactly as the "Goto" statement, except that
  1287. the statement number of the statement following the "Gosub" statement
  1288. is placed on a stack to be recalled upon executing a "Return"
  1289. statement (when control will be passed to the statement number that
  1290. is recalled). If the stack is filled by executing too many "Gosub"
  1291. statements before encountering a "Return" statement, an error message
  1292. is printed.
  1293. .sp 2
  1294. Example 100 causes control to be passed to statement 500 and the
  1295. statement number of the statement number following statement 100 to
  1296. be placed on the return stack. When the next "Return" statement is
  1297. executed, control will be passed to the statement following statement
  1298. 100.
  1299. .pa
  1300. .ce
  1301. Goto statement
  1302. .sp 3
  1303. <statement number> Goto <statement number>
  1304. .sp 2
  1305. .li
  1306.     100 Goto 1000
  1307. .sp 2
  1308. This statement transfers control to the statement number specified.
  1309. The branch is unconditional.
  1310. .sp 2
  1311. Example 100 transfers control to the statement numbered 1000.
  1312. .pa
  1313. .ce
  1314. Half statement
  1315. .sp 3
  1316. [<statement number>] Half
  1317. .sp 2
  1318. .li
  1319.     100 Half
  1320. .sp 2
  1321. This statement causes the terminal echo to be suppressed. The
  1322. suppression remains in effect until the execution of a "Full"
  1323. statement either as an immediate command or as a statement within
  1324. a program. This statement is normally used to condition basic to
  1325. operate with a half-duplex terminal, but is also useful in suppressing
  1326. printout of input data which
  1327. is of a sensitive or high security nature.
  1328. .sp 2
  1329. Example 100 causes the terminal echo to be subsequently suppressed.
  1330. .pa
  1331. .ce
  1332. Hold statement
  1333. .sp 3
  1334. .li
  1335.     100 Hold
  1336. .sp 2
  1337. This statement causes the user to be given uninterrupted
  1338. time thus suspending servicing of other users.  Servicing other users
  1339. is restored by the use of the "Rel" statement (see below).  The primary
  1340. purpose of this statement is to allow the user to update a file without
  1341. allowing another user to change the contents of the same file "out from
  1342. under him".  Any input/output other than disk will cancel the effects
  1343. of this command (as will "Sleep", "End", "Stop", "Bye", "New", etc.)
  1344. This command should be utilized with care on debugged programs only.
  1345. .pa
  1346. .ce
  1347. If statement
  1348. .sp 3
  1349. .li
  1350. <statement number> If <expression> goto <statement number>
  1351.                    gosub <statement number>
  1352.                    then <statement number>
  1353.                    then <statement>
  1354.  
  1355.     100 If A<1 goto 1000
  1356.     200 If A$="hello" gosub 5000
  1357.     300 If B<5 or A>2 then 2000
  1358.     400 If A$<>"run" then Print "what?"
  1359.     500 If C>=1 and C<=5 then On C goto 600,700,800,900,1000
  1360. .sp 2
  1361. This statement tests the expression following the word "If" for
  1362. logical true or false (logical true is any non-zero value, logical
  1363. false is zero), and if true, performs the operation requested.
  1364. Any statement may be used in the fourth form of the "If" statement,
  1365. but it should be noted that using a "For" or a "Next" statement in
  1366. this context could be dangerous if care is not taken to insure
  1367. that the value of the evaluated expression of the "If" statement
  1368. does not change for the duration of the loop. (Also, "For" and
  1369. "Next" statements within an "If" statement do not affect the
  1370. indentation of the listing as normal "For" and "Next" statements do.
  1371. .sp 2
  1372. Example 100 causes a transfer to statement 1000 if A is less than
  1373. 1.
  1374. .br
  1375. Example 200 causes a transfer to the subroutine at statement
  1376. 5000 if the string variable A$ contains the characters "hello".
  1377. (Note that A$ must contain only those letters. If the first five
  1378. characters are "hello", but A$ contains more characters after the
  1379. first five, the comparison will not be equal.) Upon the execution
  1380. of a return statement, control will be to the statement following
  1381. statement 200.
  1382. .br
  1383. Example 300 will transfer to statement 2000 if B is
  1384. less than five or if A is greater than 2. The keyword, "then", will
  1385. be replaced by the keyword "goto" when this statement is listed.
  1386. .br
  1387. Example 400 causes the word "what?" to be printed on the terminal
  1388. if A$ does not contain the characters "run".
  1389. .br
  1390. Example 500 transfers
  1391. control to 600, 700, 800, 900, or 1000, depending on the value of
  1392. the variable C if C is greater than or equal to 1 and less than
  1393. or equal to 5. If C is outside of this range, control will be
  1394. passed to the statement following statement 500.
  1395. .pa
  1396. .ce
  1397. Input statement
  1398. .sp 3
  1399. <statement number> Input [<literal>,]<variable>[,<variable>]...[;]
  1400. .sp 2
  1401. .li
  1402.     100 Input A
  1403.     200 Input B(5),C,D$
  1404.     300 Input F;
  1405.     400 Input "enter number ",N
  1406. .sp 2
  1407. This statement allows data to be obtained from the user during
  1408. program execution and placed in an appropriate program variable.
  1409. Upon executing this statement, basic writes a question mark (?)
  1410. to the terminal and waits for the user to enter data. Control
  1411. is returned to the program when the user presses the return
  1412. key. If the variable in the input statement is a numeric variable,
  1413. the user will be required to type a number in any valid numeric
  1414. form. If the variable is a string variable, the user may type
  1415. any number of characters followed by a carriage return. If more
  1416. than one numeric variable is specified within a single input
  1417. statement, the user may type that number of numeric values
  1418. separated by commas, or he may type a carriage return after
  1419. each variable, in which case the question mark prompt will be
  1420. repeated until the required number of values have been entered.
  1421. Note that if more than one string variable is specified, the user
  1422. must terminate each string with a carriage return. Commas will be
  1423. entered as part of the string. If the input statement is
  1424. terminated with a semi-colon (;), no carriage-return will be
  1425. sent to the terminal at the end of the statement. If, however,
  1426. the statement is not terminated with a semi-colon, a carriage
  1427. return will be sent to the terminal at the end of the input.
  1428. (Note that use of the semi-colon is meaningless with a half-
  1429. duplex terminal, since the carriage return is echoed at the
  1430. terminal.)
  1431. .sp 2
  1432. Example 100 causes a question mark to be printed at the terminal
  1433. and causes BASIC to wait for the user to enter a numeric value.
  1434. That value will be stored in the variable A, and control will be
  1435. passed to the statement following 100 after a carriage return has
  1436. been sent to the terminal.
  1437. .br
  1438. Example 200 allows the user to enter
  1439. two numeric values separated by a comma, followed by a comma and
  1440. any string of characters ended with a carriage return. The user
  1441. could also enter one numeric value ended with a carriage return,
  1442. followed by another numeric value ended with a carriage return,
  1443. followed by a string of characters ended with a carriage return.
  1444. .br
  1445. Example 300 allows the user to enter a single numeric value
  1446. followed by a carriage return. The value will be placed in the
  1447. variable F, but no carriage return will be echoed to the terminal.
  1448. .br
  1449. Example 400 prints the string "Enter number" then allows the user
  1450. to input a numeric value.  The value will be placed in the variable N.
  1451. .pa
  1452. .ce
  1453. Input file statement
  1454. .sp 3
  1455. .li
  1456. <statement number> Input file(<file number>[,<record number>]),
  1457.             <variable>[,<variable>]...
  1458.  
  1459.     100 Input file[0],A,B
  1460.     200 Input file[A,B],C$
  1461. .sp 2
  1462. This statement functions exactly as the input statement, except that
  1463. the input is requested from the device associated with the file
  1464. number specified. Also, no question mark prompt is generated with
  1465. this statement. If a record number is specified, a seek operation
  1466. is performed to that record before the input operation is performed
  1467. (disk files only are valid for seeks). If no variable list is
  1468. specified, the seek only will be performed. Data on the specified
  1469. file is expected to be in exactly the same format as for the input
  1470. statement.
  1471. .sp 2
  1472. Example 100 will read a line up to a carriage return from file 0 and
  1473. evaluate to find a numeric value which will be placed in the variable
  1474. A. If the value is terminated with a comma, the same line will be
  1475. searched for another numeric value for the variable B. If the value
  1476. is terminated with a carriage return, another line will be read
  1477. (up to a carriage return) and searched for a value for B.
  1478. .br
  1479. Example 200 causes a seek to the record pointed to by the variable B on the
  1480. file pointed to by the variable A, followed by the reading of a line
  1481. (up to a carriage return) for characters to be placed in the string
  1482. variable C$.
  1483. .pa
  1484. .ce
  1485. Let statement
  1486. .sp 3
  1487. .li
  1488. [<statement number>] [Let] <variable>=<expression>[,<variable>=
  1489.                     <expression>]...
  1490.                <String variable>=<literal>[,<literal>]...
  1491.                     <String variable>...
  1492.  
  1493.     100 Let A=5
  1494.     200 B(10)=C<5*20
  1495.     300 D=sqr(2),E=4,C(2)=D
  1496.     400 let A$="he","llo",B$(5,10)
  1497. .sp 2
  1498. This statement causes either the value of a numeric expression to be
  1499. assigned to a numeric variable or the value of a string expression
  1500. to be assigned to a string variable. The keyword "Let" need not be
  1501. entered, but BASIC will automatically insert the word for a listing
  1502. if it is left out. As many assignments as will fit on a single line
  1503. may be entered separated by commas. Note that in the case of a string
  1504. assignment the commas cause concatination of the string information.
  1505. Therefore, two string assignments may not be entered on the same
  1506. statement separated by commas, as BASIC would assume that the
  1507. variable occuring on the left of the second equal sign was meant to
  1508. be concatinated into the variable on the left of the first equal sign,
  1509. and an error message would be signalled at the second equal sign.
  1510. .sp 2
  1511. Example 100 causes the value 5 to be placed in the variable
  1512. A.
  1513. .br
  1514. Example 200 causes the value zero to be placed in the eleventh
  1515. position (starting with 0) of the numeric list B if C was
  1516. greater than or equal to 5, and the value 20 to be placed in
  1517. B(10) if C is less than 5.
  1518. .br
  1519. Example 300 places the square root of
  1520. 2 in the variable D, 4 into E, and the square root of 2 (from
  1521. the variable D) into cC2).
  1522. .br
  1523. Example 400 places the characters
  1524. "hello" followed by the characters found in positions 5 through
  1525. 10 of B$ into A$.
  1526. .pa
  1527. .ce
  1528. Log statement
  1529. .sp 3
  1530. [<statement number>] Log <string variable or string literal>
  1531. .sp 2
  1532. .li
  1533.     100 Log "This terminal is not working correctly!"
  1534. .sp 2
  1535. This statement causes the string to be written on the accounting log
  1536. file.  Its purpose is to allow users to leave messages for the system
  1537. operator concerning system problems, terminal problems, accounting
  1538. information, program run history, etc.  Stored with the message are
  1539. the user's account number, port number, date, and time of day.
  1540. .sp 2
  1541. Example 100 causes the message "This terminal is not working correctly!"
  1542. to be stored in the accounting file for the system operator's
  1543. information.
  1544. .pa
  1545. .ce
  1546. Lowup statement
  1547. .sp 3
  1548. [<statement number>] Lowup
  1549. .sp 2
  1550. This statement causes all lower-case characters received from the
  1551. user's terminal to be converted to upper-case characters before being
  1552. echoed to the terminal or used by the program.  The system can be
  1553. taken out of the mode by the use of the 
  1554. "Uplow" statement (see below). This statement is useful when it is
  1555. desired to force the user to type input data in upper case in order
  1556. to not make the program have to check both lower and upper case
  1557. user reponses.
  1558. .pa
  1559. .ce
  1560. Mat statement
  1561. .sp 3
  1562. In the formats given below, "MV" stands for matrix variable, which is
  1563. any doubly dimensioned variable or a non-dimensioned variable which has
  1564. not been used previously in the program. If the variable is of the
  1565. latter type, the dimensions must be specified within parentheses
  1566. following the keywords zer, con, or idn.
  1567. .sp 2
  1568. .li
  1569. <statement number> Mat <mv>=<mv>
  1570. <statement number> Mat <mv>=<mv>+<mv>
  1571. <statement number> Mat <mv>=<mv>-<mv>
  1572. <statement number> Mat <mv>=<mv>*<mv>
  1573. <statement number> Mat <mv>=(<expression>)*<mv>
  1574. <statement number> Mat <mv>=inv(<mv>)
  1575. <statement number> Mat <mv>=trn(<mv>)
  1576. <statement number> Mat <mv>=zer
  1577. <statement number> Mat <mv>=con
  1578. <statement number> Mat <mv>=idn
  1579. .sp 2
  1580. The above statements all allow doubly dimensioned arrays to be used as
  1581. and operated upon as matrices. It should be noted that the matrix
  1582. operations here documented do not use the zeroeth positions of arrays.
  1583. That is, row zero and column zero are not used and will be ignored by
  1584. matrix operations. Each of the above forms of the mat statement is
  1585. documented seperately below.
  1586. .sp 2
  1587. .li
  1588.     100 Mat A=B
  1589. .sp 2
  1590. This statement will cause the values in all the elements of matrix
  1591. B to be stored in matrix A. If A had not been previously dimensioned,
  1592. it will be given the dimensions of matrix B. If A had been previously
  1593. dimensioned, it will be re-dimensioned to have the same dimensions
  1594. as matrix B. This re-dimensioning follows the normal rules for
  1595. re-dimensioning. That is, any array (not string variables) may be
  1596. re-dimensioned at any time provided that the total number of elements
  1597. required by the new dimensions does not exceed the total number of
  1598. elements given the variable when it was first dimensioned by the
  1599. program.
  1600. .sp 2
  1601. .li
  1602.     100 Mat A=B+C
  1603.         200 Mat A=B-C
  1604. .sp 2
  1605. These statements cause the elements in matrix C to be added to (example
  1606. 100) or subtracted from (example 200) the elements of matrix B. The
  1607. arithmetic operation is performed element by element and is normal
  1608. algebraic addition and subtraction. Matrices B and C must have the
  1609. same dimensions, and one or the other may be the same matrix as the
  1610. matrix to the left of the equals sign. Matrix A will be re-dimensioned
  1611. as explained above.
  1612. .sp 2
  1613. .li
  1614.     100 Mat A=B*C
  1615. .sp 2
  1616. This statement causes matrix multiplication of matrices B and C and
  1617. the result to be placed in matrix A. To obtain the matrix product
  1618. of B*C, each row of B is multiplied by each column of C. Each
  1619. row/column set is added together to find the resultant matrix
  1620. element. Neither matrices on the right of the equals sign may be
  1621. the same matrix as on the left of the equals sign. Matrix A will
  1622. be re-dimensioned as explained above to have the number of columns
  1623. as matrix C and the number of rows as matrix B. The number of
  1624. columns of matrix B must match the number of rows of matrix C.
  1625. .sp 2
  1626. .li
  1627.     100 Mat A=(5+cos(D))*B
  1628. .sp 2
  1629. This statement causes each element of matrix B to be multiplied by
  1630. the value 5+cos(D) and the result to be placed in matrix A. Matrices
  1631. A and B may be the same matrix. Matrix A will be re-dimensioned to
  1632. the dimensions of matrix B as explained above.
  1633. .sp 2
  1634. .li
  1635.     100 Mat A=inv(B)
  1636. .sp 2
  1637. This statement will obtain the inverse of matrix B and store it in
  1638. matrix A. Matrix A will be re-dimensioned to the dimensions of matrix
  1639. B as explained above, and matrices A and B may be the same matrix.
  1640. Matrix B must be square and at least 2 by 2. Any square matrix may
  1641. be inverted except one that contains one or more zero elements along
  1642. the major diagonal. The determinant of the last matrix inverted by
  1643. a basic program may be obtained through the use of the "det(X)"
  1644. function. Note that the variable X has no relevance to the det
  1645. function although it is syntactically required.
  1646. .sp 2
  1647. .li
  1648.     100 Mat A=trn(B)
  1649. .sp 2
  1650. This statement transposes matrix B and stores the result into matrix
  1651. A. A matrix is transposed by reversing its rows and columns. Matrix
  1652. B cannot be the same matrix as matrix A, and matrix A will be
  1653. re-dimensioned to the dimensions of matrix B as explained above.
  1654. .sp 2
  1655. .li
  1656.     100 Mat A=zer(5,6)
  1657. .sp 2
  1658. This statement stores the value zero in every element of matrix A,
  1659. and if a dimension is given, dimensions matrix A to the specified
  1660. size.
  1661. .sp 2
  1662. .li
  1663.     100 Mat A=con
  1664. .sp 2
  1665. This statement stores the value one in every element of matrix A,
  1666. and if a dimension is given, dimensions matrix A to the specified
  1667. size.
  1668. .sp 2
  1669. .li
  1670.     100 Mat A=idn
  1671. .sp 2
  1672. This statement creates an identity matrix by storing zeroes in
  1673. every element of the matrix except the major diagonal, where ones
  1674. are stored. If a dimension is given, matrix A will be dimensioned
  1675. to the specified size.
  1676. .pa
  1677. .ce
  1678. New statement
  1679. .sp 3
  1680. [<statement number>] New
  1681. .sp 2
  1682. .li
  1683.     New
  1684.     100 New
  1685. .sp 2
  1686. This statement causes all statements in the program to be erased,
  1687. all variables unassigned and cleared, and all open files closed.
  1688. All information in core before this statement is executed is lost.
  1689. Therefore, this statement should only be issued before entering a
  1690. program or after all important information is saved.  This statement
  1691. also causes execution to cease and the "Ready" message to be printed
  1692. if it is encountered as a part of a program.  That is, it functions
  1693. exactly as an "End" statement, except that all statements are erased
  1694. before execution is terminated.
  1695. .sp 2
  1696. The first example will clear the user's program area, usually in
  1697. preparation for inputting a new program.  The second example, being
  1698. a statement in a program, will, when executed, clear the user's space
  1699. and terminate the execution of the program with the "Ready" message.
  1700. .pa
  1701. .ce
  1702. Next statement
  1703. .sp 3
  1704. <statement number> Next <non-subscripted variable>
  1705. .sp 2
  1706. .li
  1707.     100 Next I
  1708. .sp 2
  1709. This statement is used in conjunction with the "For" statement to
  1710. signify the end of a loop. The non-subscripted variable should
  1711. be the same variable as the control variable of the associated
  1712. "For" statement. See the documentation of the "For" statement.
  1713. Upon execution of this statement, control is either passed to
  1714. the statement immediately following the associated "For" statement
  1715. or to the statement immediately following the next statement,
  1716. depending on whether the loop parameters are satisfied or not.
  1717. .sp 2
  1718. Example 100 is the final statement in the loop associated with
  1719. a "For" statement which has I for a control variable.
  1720. .pa
  1721. .ce
  1722. Nulls statement
  1723. .sp 3
  1724. [<statement number>] Nulls <number>
  1725. .sp 2
  1726. .li
  1727.     100 Nulls 8
  1728. .sp 2
  1729. This statement is used with certain high-speed terminals to force a
  1730. delay for the carriage-return, line-feed mechanism on such terminals.
  1731. Any number of nulls may be specified, but the number given will be
  1732. accepted modulo 15.  After this statement, each line will be terminated
  1733. with a carriage return, line feed, and the specified number of nulls,
  1734. in that order.  This function may be reset by typing the statement
  1735. with the number zero or by signing off.
  1736. .sp 2
  1737. Example 100 causes eight nulls to be sent after every line feed to
  1738. the user's terminal.
  1739. .pa
  1740. .ce
  1741. On statement
  1742. .sp 2
  1743. In the format given below, s# stands for statement number.
  1744. .sp 2
  1745. .li
  1746. <s#> On <expression> goto <s#>[,<s#>][,<s#>]...
  1747. <s#> On <expression> gosub <s#>[,<s#>][,<s#>]...
  1748. <s#> On err goto <s#>
  1749. <s#> On esc goto <s#>
  1750. <s#> On err gosub <s#>
  1751. <s#> On esc gosub <s#>
  1752. .sp 2
  1753. .li
  1754.     100 On X goto 200,300,400,500
  1755.     200 On (A$="YES")+1 goto 200,300
  1756.     300 On err gosub 1000
  1757.     400 On esc goto 5000
  1758. .sp 2
  1759. This statement evaluates the expression following the keyword "On"
  1760. and transfers control to the first statement following the goto or
  1761. gosub if the value is equal to one and less than two, the second
  1762. statement number if the value is equal to two and less than three,
  1763. etc. If the evaluated value of the expression is less than one or
  1764. greater than the number of statement numbers in the statement number
  1765. list, control is passed to the statement immediately following the
  1766. "On" statement. The goto and gosub functions are exactly as described
  1767. for the "Goto" and "Gosub" statements.
  1768. .sp 2
  1769. The "On" statement can also be used to provide programmable traps for
  1770. errors encountered during execution and for the escape key.  The
  1771. "On err" or "On esc" forms of this statement, when executed, inform
  1772. the system that the specified line number is to be executed upon
  1773. detection of an error or detection of the escape key during execution.
  1774. These statements remain in effect until another "On err" or "On esc"
  1775. statement is encountered, or until the user types a "Run", a "New",
  1776. or a "Load" command.  Care should be exercised in the use of these
  1777. statements, as it is possible to place a user's terminal in an unusable
  1778. state with them.  If an escape trap has been provided which does not
  1779. stop the program, and there is an error in the error trap routine,
  1780. the user would not be able to stop the program, and the program would
  1781. loop entering the error trap routine.  The only way out would be for
  1782. the system operator to "Zap" the terminal.  Therefore, these
  1783. statements should only be used in tested programs.
  1784. .sp 2
  1785. Example 100 will transfer control to statement 200 if 1<=X<2, to
  1786. statement 300 if 2<=X<3, to statement 400 if 3<=X<4, and to
  1787. statement 500 if 4<=X<5. If X is less than 1 or greater than or equal
  1788. to 5, the next statement following the on statement will be executed.
  1789. .br
  1790. Example 200 will transfer control to statement 200 if A$ does not
  1791. contain the characters "YES" and to statement 300 if A$ does contain
  1792. those characters.
  1793. .pa
  1794. .ce
  1795. Open file statement
  1796. .sp 3
  1797. .li
  1798. [<statement number>] Open file (<file number>[,<# bytes per random
  1799.                 record>],<file name>
  1800.  
  1801.     100 Open file(0,100),"file1"
  1802.     200 Open file(N1),A$
  1803.     300 Open file(3),"PRN:"
  1804. .sp 2
  1805. This statement makes available for use a disk file or a physical device
  1806. for a BASIC program. The first parameter required is the file number.
  1807. This number is chosen by the user and must be in the range 0-39 (the
  1808. maximum number of files that may be open in any single program is 40).
  1809. This file number will be used by
  1810. "Read file", "Write file", "Input file", and "Print file" statements to access
  1811. the particular disk file or physical device opened by this statement.
  1812. The second parameter, which is optional, is the number of bytes per
  1813. record for a randomly accessed disk file. If not specified, the default
  1814. value of 128 will be used. This parameter has meaning if a "Read file",
  1815. "Write file", "Input file", or "Print file" statement is used with their
  1816. optional parameter specifying a record number. If so, that record
  1817. number will be multiplied by the number of bytes per record given here
  1818. to obtain the location on the disk of the first byte of data to be
  1819. read or written (the actual calculation is the record number-1 times
  1820. the number of bytes per record, since the first record is number 1).
  1821. For calculation of the number of bytes needed per record, each numeric
  1822. value stored on the disk requires four bytes of storage, and each
  1823. string requires the length of the string plus one byte of storage.
  1824. Note that this is the length of the string (which is the number of
  1825. characters actually in the string) and not the dimension of the
  1826. string (which is the maximum number of characters that could be
  1827. stored in the string). The data as stored on the disk is simply the
  1828. numeric values or the string characters. There are no extra pointers
  1829. in a disk file to inform BASIC as to whether the next value is a
  1830. numeric or a string value. Therefore, it is imperative that the
  1831. variable list of a disk "Read file" statement be in the same order and
  1832. contain the same types (numeric or string) variables as the variable
  1833. list of the "Write file" statement that originally stored the data.
  1834. (For "Print file", characters are written in the same manner as they
  1835. would be written on the terminal using one byte per character.
  1836. "Print file" statements not followed by a semicolon (;) place a
  1837. carriage return and a line feed following the information for the
  1838. line itself).
  1839. For string data written with a "Write file" statement, a null character
  1840. is stored at the termination of the string that was written. When
  1841. reading the string, the string variable used in the "Read file" statement
  1842. may have a greater dimension or an equal dimension to the dimension
  1843. of the variable used in the "Write file", and the reading of the string will
  1844. be terminated by the null on the disk. If the dimension of the
  1845. string variable used in the "Read file" is less than the number of
  1846. characters before the null on the disk, the reading will be terminated
  1847. in the midst of the string on the disk. This can be useful in
  1848. reading text files, as the file may be read a byte at a time by
  1849. means of a string variable with a dimension of one, and the end
  1850. of the record can be determined by testing the length of the
  1851. string variable with the "Len" function after the "Read file". The end
  1852. of the record would return a zero length. The third and final
  1853. parameter required by the "Open file" statement is the name of the
  1854. file, which may be either a string variable or a string literal.
  1855. If this name is the name of one of the line printer (PRN:), it
  1856. will be tested to see if it is already in use, and if not,
  1857. assigned to this program for later use. If the name is not the
  1858. name of the line printer, the disk will be searched for a file
  1859. with the corresponding name. The disk directory will first be searched
  1860. for a name preceded by the user's account code, then for a name
  1861. preceded by the public account code (zero), then (if the user has this
  1862. capability as determined by his account restrictions) for a file
  1863. not preceded by any account code.  If the file with the specified name
  1864. is a saved BASIC program (with the b attribute), the user will not
  1865. be allowed to open the file.
  1866. .sp 2
  1867. Example 100 will open a disk file by the name of "file1" on channel
  1868. zero with 100 bytes per random record. This file may be used either
  1869. randomly (by the use of the record number parameter in "Read file"
  1870. and "Write file"
  1871. statements) or sequentially (by omiting the record number in "Read file" and
  1872. "Write file" statements) or both (this is true of any disk file).
  1873. .br
  1874. Example 200 will open a file having the name specified by the string variable
  1875. A$ on the channel specified by the variable A1. This file will have
  1876. the default of 128 bytes per random record.
  1877. .br
  1878. Example 300 will open the
  1879. line printer on channel 3.
  1880. .pa
  1881. .ce
  1882. Print statement
  1883. .sp 3
  1884. .li
  1885. [<statement number>] Print <expression>[, or ; <expression>]...
  1886. [<Statement number>] ? <expression>[, or ; <expression>]...
  1887.  
  1888.     100 Print A+5;tab(15);sqr(2)
  1889.     200 ?A$,5
  1890.     300 ?"The answer is:";C;
  1891. .sp 2
  1892. This statement prints on the terminal the value of any numeric
  1893. expression encountered, the contents of any string variable or
  1894. literal encountered, and tabulates to the column specified by
  1895. any tab function encountered or to the next tab stop for any
  1896. comma (,) encountered. Semi-colons (;) can be used to separate
  1897. elements where no tabulation is desired. The question mark can
  1898. be used in the place of the keyword "Print" (also useful
  1899. when using the "Print" statement in the immediate mode-without
  1900. a statement number), but the keyword "Print" will be output
  1901. during a list of the program instead of the leading question mark.
  1902. If commas are used for tabulation, a carriage return will be
  1903. output instead of spacing to the next tab stop if there would
  1904. not be room for another number before the end of a 72 character
  1905. line. Semi-colons will not cause carriage returns and may be
  1906. used in conjunction with the tab function when it is desired
  1907. to output lines longer than 72 characters. For the tab function,
  1908. the first position of the line is considered position zero.
  1909. If the terminal is already beyond the position specified by the
  1910. tab function, no action will be caused by that tab. Numeric
  1911. values will be printed as six digits plus a decimal point and
  1912. an optional minus sign. If a number requires more than six
  1913. digits, scientific notation will be used, with only the six
  1914. most significant digits being printed. BASIC internally uses
  1915. six or seven digits of precision, depending on the number.
  1916. Every numeric value printed will be preceded by either a blank
  1917. or a minus sign and followed by a
  1918. blank. If the last item in the variable list is followed
  1919. by a semi-colon, the carriage return at the end will be suppressed.
  1920. This will cause the next print statement to continue on the same
  1921. line.
  1922. .sp 2
  1923. Example 100 will print the value of the expression A+5 on the
  1924. terminal followed by spacing to column 15 (counting from zero)
  1925. followed by the value 1.4142, Which is the square root of 2.
  1926. .br
  1927. Example 200 will print the contents of the string A$ followed
  1928. by a tab to the first tab stop followed by the number 5.
  1929. .br
  1930. Example 300 will print the message "The answer is:" followed
  1931. by the value in the variable C. The trailing semi-colon suppresses
  1932. the carriage return at the end of this print statement, so that
  1933. the next print statement will continue immediately following
  1934. the number from the variable C.
  1935. .pa
  1936. .ce
  1937. Print file statement
  1938. .sp 3
  1939. .li
  1940. [<statement number>] Print file (<file number>[,<record number>]),
  1941.                 <expression>[,<expression>]...
  1942.  
  1943.     100 Print file(0,4),A;B,C
  1944. .sp 2
  1945. This statement functions exactly as the print statement except that
  1946. the output is sent to the file that is specified by the file
  1947. number. If a record number is specified, a seek is performed to
  1948. that record before the data is written. Semi-colons
  1949. may be used exactly as in the print statement.
  1950. .sp 2
  1951. Example 100 will write the values of the variables A, B, and C
  1952. to the file number zero, fourth record. The value of A will be
  1953. written first, followed by the value of B followed by a tab to
  1954. the next tab stop, the value of C, a carriage return and a line
  1955. feed.
  1956. .pa
  1957. .ce
  1958. Print file using statement
  1959. .ce
  1960. Print using statement
  1961. .sp 3
  1962. .li
  1963. <statement number> Print [file (<file number>[,<record number>]),]
  1964.                 using <string variable or literal>,
  1965.                 <expression or string>[,<expression or
  1966.                 string>]...
  1967.  
  1968.     100 Print using "###.##",2.3
  1969.     200 Print file(7,10),using Z$,Z(1);
  1970.     300 print using "##### time","First","2nd","3rd","4th"
  1971. .sp 2
  1972. This statement
  1973. causes formatted printing to the terminal or the specified file.  File
  1974. accessing is exactly as in the "Print file" statement described above.
  1975. The first string which immediately follows the keyword "using" is the
  1976. format string, and the rest of the elements are the argument list to
  1977. be printed using that format.  If the statement is followed by a
  1978. semi-colon or a comma, no carriage return (or line feed)
  1979. will be output following the
  1980. formatted print.  Tab functions and semi-colons between elements of
  1981. the argument list are not allowed. The
  1982. argument list elements must be separated by commas.  Within the
  1983. format string, string literals and format characters may both appear.
  1984. Anything which does not evaluate to a valid format character will be
  1985. assumed to be a string literal and will be output verbatim.  If the
  1986. format string is exhausted before the argument list, then the format
  1987. string will be repeated.  The following are valid format characters:
  1988. .li
  1989.  
  1990.     +    -    #    0    ,    .    $
  1991. .sp 2
  1992. A format field is made of a valid combination of these characters.
  1993. The first occurance of a non-valid format character, or the occurance
  1994. of an out-of-place format character defines the termination of the
  1995. format field.  One element from the argument list will be placed in
  1996. each format field.
  1997. .sp 2
  1998. String data will overlay the format field character by character.
  1999. If the argument string is longer than the format field, it will be
  2000. truncated.  If the argument string is shorter than the format field,
  2001. trailing blanks will be inserted to fill the format field. Example:
  2002. .li
  2003.     Print using "###.##","One","two","that is all, folks"
  2004.  
  2005. will print:  One^^^two^^^that^i
  2006.     (where ^ represents a blank)
  2007. .sp 2
  2008. Numeric data will be output right-justified, one digit per format
  2009. digit character (defined below).  If the numeric to be printed is
  2010. too large for the field specified, the field will be filled with
  2011. asterisks (*).  Unless otherwise specified (by the termination of
  2012. a floating character or use of the 0 format character, see below),
  2013. all preceding zeroes will be
  2014. suppressed.  A format digit character is the "pound" sign (#),
  2015. the zero (0) or a floating character.  Examples:
  2016. .sp 2
  2017. .li
  2018.     Print using "###.##",1,2.1,3.24,5.64975,12345.6
  2019.  
  2020. will print:  ^^1.00^^2.1^^3.24^^5.65******
  2021.     (where ^ represents a blank)
  2022. .sp 2
  2023. Notice that in printing 5.65, The number was rounded.
  2024. .sp 2
  2025. As in the above example, the decimal point is output where
  2026. specified.  If the number had been a fraction only, a zero would have
  2027. been output immediately preceding the decimal.  That is, .25 Would have
  2028. been represented as 0.25.  
  2029. .sp 2
  2030. If a sign character (+ or -) were placed immediately before the field
  2031. or immediately after the field, the sign of the number would be placed
  2032. in that position.  The sign character + causes a + to be printed if
  2033. the number is positive, and a - to be printed if the number is
  2034. negative.  The sign character - is the same, except that a blank is
  2035. printed for positive numbers. Example:
  2036. .li
  2037.  
  2038.     Print using "+###.## ",25,.45,-5.346,-1
  2039.  
  2040. will print:  +^25.00^+^^0.45^-^^5.35^-^^1.00
  2041.     (where ^ represents a blank)
  2042. .sp 2
  2043. If more than one sign character is specified (preceding sign only), it
  2044. is a floating sign.  That is, the sign will be moved as far to the
  2045. right as the sign characters and the magnitude of the number permit.
  2046. If there is room between the floating signs and the magnitude of the
  2047. number, leading zeroes will be inserted. Example:
  2048. .li
  2049.  
  2050.     Print using "---##.## ",1,-1,-345.3,-20
  2051.  
  2052. will print:  ^^^01.00^^^-01.00^^-345.30^^^-20.00
  2053.     (where ^ represents a blank)
  2054. .sp 2
  2055. Likewise, dollar signs may be specified as fixed (one only) or floating
  2056. (more than one).  Dollar signs act exactly as signs, except that a
  2057. dollar sign is always printed, regardless of the whether the argument
  2058. is positive or negative.  If a sign is required in addition to the
  2059. dollar sign, it must be a fixed sign (only one), and must appear either
  2060. before the dollar sign or after the field.  Example:
  2061. .li
  2062.  
  2063.     Print using "-$$$$#.## ",1,-1,.45
  2064.  
  2065. will print:  ^^^^$1.00^-^^^$1.00^^^^^$0.45
  2066.     (where ^ represents a blank)
  2067.  
  2068.     Print using "$$$$#.##- ",1,-10,-.45
  2069.  
  2070. will print:  ^^^$1.00^^^^$10.00-^^^^$0.45-
  2071.     (where ^ represents a blank)
  2072. .sp 2
  2073. Commas inserted in the format field will be printed if the magnitude
  2074. of the number is large enough to require them.  Otherwise, they will
  2075. be replaced with blanks. Example:
  2076. .li
  2077.  
  2078.     Print using "#,###,###.## ",1,1000,1E6
  2079.  
  2080. will print:  ^^^^^^^^1.00^^^^^1,000.00^1,000,000.00^
  2081.     (where ^ represents a blank)
  2082. .sp 2
  2083. Four consecutive up arrows (^) will require that the number be
  2084. converted and output in scientific notation.  The number will be
  2085. adjusted to the position of the decimal point given in the field, and
  2086. the appropriate power of ten will be given in the four positions
  2087. specified by the up arrows.  Example:
  2088. .li
  2089.  
  2090.     Print using "+#.#####^^^^",123456
  2091.  
  2092. will print:  +1.23456E+05
  2093. .pa
  2094. .ce
  2095. Prty Statement
  2096. .sp 3
  2097. [<statement number>] Prty <expression>[,<expression>]
  2098. .sp 2
  2099. .li
  2100.     100 Prty 3
  2101.     200 Prty 1,1
  2102. .sp 2
  2103. This statement sets the program priority for this port, or a given port.
  2104. The program
  2105. priority is a number between 0 and 255 inclusive which determines the
  2106. number of times this process will be bypassed by the scheduler
  2107. before being allowed to execute.  For example: if the program priority
  2108. is 3, then the scheduler will not select this process to be run
  2109. until it has been bypassed 3 times.  If the program priority is set to 0,
  2110. then the process will receive service each time through the polling loop
  2111. as long as the program requires service.
  2112. .br
  2113. In short, the higher the priority number, the slower the program will run.
  2114. .br
  2115. This is a restricted function
  2116. and requires restriction bit 4 to change the priority of your own port.
  2117. Restriction bit 1 is required in addition to bit 4 to change the 
  2118. priority of another port.
  2119. .sp 2
  2120. Example 100 will set the program priority of this port to 3 if 
  2121. restriction bit 4 is set.
  2122. .br
  2123. Example 200 will set the program priority for port 1 to 1 if restriction
  2124. bits 1 and 4 are set.
  2125. .pa
  2126. .ce
  2127. Random statement
  2128. .sp 3
  2129. [<statement number>] Random
  2130. .sp 2
  2131. .li
  2132.     100 Random
  2133. .sp 2
  2134. This statement causes the random number generator to be reset to
  2135. a specific starting point. The use of this statement allows the
  2136. programmer to obtain the same set of random numbers for repetitive
  2137. trials of evalutaion programs. If this statement is not used, the
  2138. random number generator will proceed from the point where it was
  2139. last used on the user's port. The random number generator does not
  2140. reset with any action other than this statement or bringing the
  2141. system up.
  2142. .sp 2
  2143. Example 100 resets the random number generator.
  2144. .pa
  2145. .ce
  2146. Read statement
  2147. .sp 3
  2148. [<statement number>] Read <variable>[,<variable>]...
  2149. .sp 2
  2150. .li
  2151.     100 Read A,B,C,D(8)
  2152.         200 Read A,A$,B,B$,C,C$
  2153. .sp 2
  2154. This statement causes values to be obtained from "Data" statements in
  2155. the program and placed in the variables specified. For each variable
  2156. encountered in a "Read" statement, one datum will be obtained from a
  2157. "Data" statement and placed in the variable given. The "Data" statement
  2158. pointer will then be updated to the next datum in that "Data" statement
  2159. or to the next "Data" statement if the end of that statement has been
  2160. reached. If the end of all "Data" statements is reached before the end
  2161. of the "Read" statement, an error message will be
  2162. printed. If the datum in the "Data" statement is not of the same
  2163. type (numeric or string) as the variable in the "Read" statement, an
  2164. error message will be printed.
  2165. .sp 2
  2166. Example 100 will read four numeric data values from "Data" statements
  2167. in the program and place them in the variables A, B, C, and D(8).
  2168. .br
  2169. Example 200 will read a numeric datum from a "Data" statement and
  2170. place it in A, a string datum and place it in A$, a numeric into
  2171. B, a string into B$, a numeric into C and a string into C$.
  2172. .pa
  2173. .ce
  2174. Read file statement
  2175. .sp 3
  2176. .li
  2177. [<statement number>] Read file(<file number>[,<record number>]),
  2178.                 <variable>[,<variable>]...
  2179. .sp 2
  2180. .li
  2181.     100 Read file(4),A,B,C$
  2182. .sp 2
  2183. This statement functions exactly as the "Read" statement except
  2184. that the values are obtained from the file specified instead of
  2185. "Data" statements. If a record number is specified, a seek is
  2186. performed to that record before the data is read.
  2187. .sp 2
  2188. Example 100 reads four bytes from the specified file to form the
  2189. value for the variable A, four bytes for B, and the number of
  2190. bytes specified by the dimension of C$ or until a null character
  2191. is encountered, whichever comes first, to form the contents of
  2192. C$.
  2193. .pa
  2194. .ce
  2195. Rel statement
  2196. .sp 3
  2197. <statement number> Rel
  2198. .sp 2
  2199. This statement causes the internal disk buffer to be dumped and the
  2200. next user to be serviced.
  2201. It is intended to be used in conjunction with
  2202. the "Hold" statement (see above) to prevent
  2203. other users to be serviced at times when updates
  2204. are made to shared disk files.  See the "Hold" statement description
  2205. for more information.
  2206. .pa
  2207. .ce
  2208. Rem statement
  2209. .sp 3
  2210. [<statement number>] Rem <any characters followed by a carriage return>
  2211. .sp 2
  2212. .li
  2213.     100 Rem start of the calculation routines
  2214. .sp 2
  2215. This statement allows documentation within a program. This statement
  2216. may appear anywhere within a program and is ignored when executed.
  2217. .pa
  2218. .ce
  2219. Rename statement
  2220. .sp 2
  2221. [<statement number>] Rename <old file name>,<new file name>
  2222. .sp 2
  2223. .li
  2224.     100 Rename "d3:oldnam","newnam"
  2225. .sp 2
  2226. Will cause the file with the old file name to be given the new file
  2227. name. Notice that the disk number is only specified on the old file
  2228. name.
  2229. .sp 2
  2230. Example 100 will give the file on disk 3 with the name oldnam the name
  2231. newnam.
  2232. .pa
  2233. .ce
  2234. Restore statement
  2235. .sp 3
  2236. [<statement number>] Restore [<statement number>]
  2237. .sp 2
  2238. .li
  2239.     100 Restore
  2240.     200 Restore 300
  2241. .sp 2
  2242. This statement causes the data statement pointer to be reset to the
  2243. first "Data" statement in the program or the statement which is
  2244. specified.  All future "Read" statements will re-read the same data as
  2245. the "Read" statements preceding the execution of this statement.
  2246. .sp 2
  2247. Example 100 causes the first value in the first "Data" statement in the
  2248. program to be the next value passed to a "Read" statement.
  2249. .br
  2250. Example 200
  2251. causes "Data" statement 300 to be the next one to be processed.
  2252. .pa
  2253. .ce
  2254. Return statement
  2255. .sp 3
  2256. <statement number> Return
  2257. .sp 2
  2258. .li
  2259.     100 Return
  2260. .sp 2
  2261. This statement causes the statement number on the top of the stack
  2262. of statement numbers created by the "Gosub" statement to be the next
  2263. statement to be executed. In essence, this statement effects a return
  2264. from a subroutine which received control from a "Gosub" statement
  2265. earlier in the execution of the program. Return is made to the
  2266. statement immediately following the last "Gosub" statement which was
  2267. executed.
  2268. .sp 2
  2269. Example 100 causes the program to resume execution with the statement
  2270. following the last "Gosub" statement to be executed.
  2271. .pa
  2272. .ce
  2273. Show statement
  2274. .sp 3
  2275. [<statement number>] Show <expression>
  2276. .sp 2
  2277. .li
  2278.     show 3
  2279. .sp 2
  2280. This statement logicaly connects your terminal in parallel to the
  2281. terminal of the given port number.  All characters displayed on one
  2282. terminal will be displayed on the other.  The show statement stays
  2283. in effect until ctrl A is entered on the originating terminal.
  2284. This statement is restricted and requires restriction bit 14 to be set.
  2285. This is intended for use by the system operator.  If two users both use
  2286. the show command such that they show each other either directly or
  2287. indirectly, the output will become very confusing until either user 
  2288. enters ctrl A.
  2289. .br
  2290. The example causes all characters displayed on port 3 to be shown on
  2291. the current port, and all characters typed on this port to be displayed
  2292. on port 3.
  2293. .br
  2294. This statement is often used to run a program in background by signing
  2295. on an unused terminal via the "Sign" statement, then showing that
  2296. port with the "Show" statement and running the program.
  2297. .pa
  2298. .ce
  2299. Sign statement
  2300. .sp 3
  2301. .li
  2302. [<statement number>] Sign <expression>,<string>,<expression>,<string>
  2303.                  port      terminal    account   password
  2304. .sp 2
  2305. .li
  2306.     sign 3,"crt1",1010,"secret"
  2307. .sp 2
  2308. This statement allows a user on one port to sign in another port
  2309. without having to actually be at that terminal.  This is sometimes used
  2310. to run programs in "background".  Note: there does not need to actually
  2311. be a terminal on the given port, but the interface hardware must be 
  2312. present, otherwise the port will not sign in, but will hang.  If the 
  2313. given port is already signed on, then an error will be returned.
  2314. .br
  2315. This is a restricted function and requires restriction bit 14 to be set.
  2316. .sp 2
  2317. The example will sign in port 3 with terminal "crt1", account number 1010
  2318. and password "secret"
  2319. .pa
  2320. .ce
  2321. Sleep statement
  2322. .sp 3
  2323. <statement number> Sleep <expression>
  2324. .sp 2
  2325. .li
  2326.     100 Sleep 5
  2327. .sp 2
  2328. This statement
  2329. causes BASIC to stop selecting this particular port and program in its
  2330. task selection logic for a period of seconds specified by the
  2331. expression.  This statement is usually used in conjunction with the
  2332. sys function option 11, which allows a program to know how many users
  2333. are on the system.  These two statements used together can allow a
  2334. program to run only if there are no other users on the system, or to
  2335. stop executing when a certain limit of other users is exceeded.
  2336. .sp 2
  2337. Example 100 causes the program to become dormant for 5 seconds.
  2338. .pa
  2339. .ce
  2340. Slot statement
  2341. .sp 3
  2342. .li
  2343. [<statement number>] Slot <expression>[,<expression>]
  2344.                  time           port
  2345. .sp 2
  2346. .li
  2347.     slot 2
  2348.     slot 1,5
  2349. .sp 2
  2350. This statement sets the amount of time this port, or a given port will
  2351. be given whenever the scheduler begins execution of the program on that port.
  2352. The expression representing the amount of time can range from .1 to 25.5
  2353. seconds inclusive in steps of .1.  The initial slot time for a port
  2354. is set by the account program and is usually set to 1 second.
  2355. .br
  2356. In short, the larger the slot time, the more time that is given to
  2357. this process before any other process is allowed to run.  Improper
  2358. use of this statement can bring multi user operation to a crawl.
  2359. This is a restricted statement and requires restriction bit 1 set.
  2360. If a port number is given, then restriction bit 14 must be set as well.
  2361. .sp 2
  2362. The first example will set the slot time for this port to be 2 seconds if
  2363. restriction bit 1 is set.
  2364. .br
  2365. The second example will set the slot time for port 5 to be 1 second if 
  2366. restriction bits 1 and 14 are set.
  2367. .pa
  2368. .ce
  2369. Sort statement
  2370. .sp 3
  2371. .li
  2372. [<statement number>] Sort file(<input file number>[,<first input record
  2373.     number>]),file(<work file number>),file(<output file number>,
  2374.     [,<first output record number>]),<number of records to sort>,
  2375.     <length of record in bytes>,<string variable for memory work
  2376.     area>,<sort key 1>[,<sort key 2>][,<sort key 3>][,<sort key 4>]
  2377.     [,<sort key 5>]
  2378.  
  2379.     100 Sort file(0),file(1),file(2,3),100,15,A$,1,-7
  2380. .sp 2
  2381. This statement will sort a "stripped" input file and produce a "tag"
  2382. file containing pointers to the input file in sorted order.  Numeric
  2383. and string information can be sorted.  The file to be sorted must first
  2384. be processed to create a "stripped" file which contains the record
  2385. number (pointer) followed by the information to be sorted in major to
  2386. minor field order.  The following information is then supplied on the
  2387. sort statement:
  2388. .in 11
  2389. .ti -3
  2390. 1. Input file - the channel number which is presently open to
  2391. file containing the stripped input file and the record
  2392. number of the first record in that file to be processed
  2393. (default record number is 1).
  2394. .ti -3
  2395. 2. Work file - the channel number of a file which can be used
  2396. by the sort program for intermediate storage of the stripped
  2397. file information.  This file should be at least as large as
  2398. the stripped file.
  2399. .ti -3
  2400. 3. Output file - the channel number which is to contain the
  2401. pointer information and the record number at which the first
  2402. pointer should be written.  This file must be large enough
  2403. to contain one pointer for each record to be sorted.
  2404. .ti -3
  2405. 4. The number of records to be sorted.
  2406. .ti -3
  2407. 5. The length of a record in bytes.  This includes the pointer.
  2408. .ti -3
  2409. 6. A string which has previously been dimensioned as large as
  2410. possible.  This string provides the in-memory working area for
  2411. the sort.  The larger this string, the faster the sort.
  2412. .ti -3
  2413. 7. Sort keys - up to five numbers informing the sort as to
  2414. numeric vs. Alphabetic information in the input file.
  2415. .br
  2416. If the key is:
  2417. .in 27
  2418. .ti -11
  2419. positive - it is the number of numeric pieces of
  2420. information which are contiguous in the
  2421. input file.
  2422. .ti -11
  2423. Zero     - will be ignored.
  2424. .ti -11
  2425. Negative - it is the number of alphabetic bytes of
  2426. information which are contiguous in the
  2427. input file.  Note that the nulls at the end
  2428. of strings must be taken into account.
  2429. .qi
  2430. .sp 2
  2431. Example 100 will sort the input file found on channel 0.  The work file
  2432. is on channel 1, and the output file is on channel 2 starting at record
  2433. 3.  There are 100 records of 15 bytes each (including the pointer). The
  2434. string A$ provides the in-memory working area, and each record contains
  2435. the pointer, one number, and 7 bytes of alphabetic information.
  2436. .pa
  2437. .ce
  2438. Stop statement
  2439. .sp 3
  2440. <statement number> Stop
  2441. .sp 2
  2442. .li
  2443.     100 Stop
  2444. .sp 2
  2445. This statement causes the termination of program execution. As opposed
  2446. to the "End" statement, this statement causes the message "stop at line X"
  2447. to be printed on the terminal instead of "Ready" (X is the
  2448. statement number of the "Stop" statement).
  2449. .sp 2
  2450. Example 100 causes program execution to terminate and the message
  2451. "stop at line 100" to be printed on the terminal.
  2452. .pa
  2453. .ce
  2454. Tinput statement
  2455. .sp 3
  2456. .li
  2457. <statement number> Tinput [<string>,]<expression>,<variable>[,<variable>...]
  2458.                prompt    time       destination ...
  2459. .sp 2
  2460. .li
  2461.     100 tinput 10,n
  2462.     200 tinput "enter number",T,N
  2463. .li
  2464. .sp 2
  2465. The "Tinput" statement is identical to the input statement, except that
  2466. it will "time out" after a given amount of time.  This makes it possible
  2467. to write a program that will not hang up if the user does not respond
  2468. to a question.  The time out period can range from 0 to 32767 seconds.
  2469. If the time out is 0 seconds, then tinput acts as a regular input
  2470. statement.
  2471. .br
  2472. Example 100 will input a number to be placed in variable N unless the
  2473. user does not respond within ten seconds.
  2474. .br
  2475. Example 200 will print the string "enter number" as a prompt, then
  2476. will wait T seconds before timing out.
  2477. .pa
  2478. .ce
  2479. Trace statement
  2480. .sp 3
  2481. [<statement number>] Trace <expression>
  2482. .sp 2
  2483. .li
  2484.     Trace 1
  2485. .sp 2
  2486. This statement toggles the debugging trace output.  When the
  2487. expression following the trace statement evaluates to a non zero
  2488. value, then the trace will be turned on.  If the expression
  2489. is zero, then the trace will be turned off.  When the trace is on,
  2490. each time a statement is executed, then the line number of
  2491. that statement is printed on the terminal.  This is useful in
  2492. following the execution of a program during debugging.
  2493. .sp 2
  2494. The example will turn on the debugging trace output until it is turned
  2495. off with a trace 0 statement.
  2496. .pa
  2497. .ce
  2498. Uplow statement
  2499. .sp 3
  2500. [<statement number>] Uplow
  2501. .sp 2
  2502. This statement causes the system to accept lower-case characters as is,
  2503. without first converting them to upper-case.  This is used when it is
  2504. desired to input lower case information from the terminal. 
  2505. The system is in this mode at sign-on.  This
  2506. function is reset by the "Lowup" statement (see above).
  2507. .pa
  2508. .ce
  2509. Write file statement
  2510. .sp 3
  2511. .li
  2512. [<statement number>] Write file(<file number>[,<record number>]),
  2513.                 <expression>[,<expression>]...
  2514. .sp 2
  2515. .li
  2516.     100 Write file(3,N),A,B,C$
  2517. .sp 2
  2518. This statement causes the values of the expressions in its variable
  2519. list to be written on the file specified by the file number. If a
  2520. record number is specified, a seek will be performed to that record
  2521. before the data is written. Four bytes (of binary data) will be
  2522. written for every numeric expression found in the variable list,
  2523. and one byte for every character contained within a string variable
  2524. or literal encountered in the list followed by one byte containing
  2525. a null character. No pointers are written on the file to specify
  2526. the type of data (numeric or string), so care must be exercised
  2527. to read the data in the same order with a corresponding "Read"
  2528. statement when desired.
  2529. .sp
  2530. Record numbers can range from 1 to 32767 inclusive.  If a record of 0 is
  2531. given, then no seek will be performed and the file will be accessed
  2532. sequentialy.
  2533. .sp 2
  2534. Example 100 will seek to the record specified by the variable N on
  2535. file 3 and write four bytes for variable A, four for B, and one byte
  2536. for each character contained in C$, plus one byte for a null to
  2537. terminate the C$ string.
  2538. .pa
  2539. .ce
  2540. Zap statement
  2541. .sp 3
  2542. .li
  2543. [<statement number>] Zap <expression>,<string>
  2544.                 port       statement
  2545. .sp 2
  2546. .li
  2547.     zap 10,"bye"
  2548.     zap 5,"print "sign off now<7>""
  2549. .sp 2
  2550. This statement is used to insert a statement into the execution stream
  2551. of a given port.  "Zap" first issues an escape to the given port while
  2552. supressing any escape traps, then inserts the string into the execution
  2553. stream to be exectued on that port.  This makes it possible to terminate
  2554. a program that has hung up and left an escape trap on.
  2555. If the given port
  2556. is the current port, or is not signed on, then the zap command is ignored.
  2557. This is a restricted statement and requires restriction bit 14 to be set.
  2558. This is intended for use by the system operator to "Zap" a program that
  2559. has gone away with an escape trap enabled, or for sending a quick
  2560. message to another terminal
  2561. .sp 2
  2562. The first example will sign off port 10 regardless of what is running
  2563. at the time.
  2564. .sp
  2565. The second example will stop whatever is running on port five and
  2566. print the message "sign off now" then ring the bell.
  2567. .pa
  2568. .ce
  2569. Append command
  2570. .sp 3
  2571. Append <file name>
  2572. .sp 2
  2573. .li
  2574.     Append datast
  2575. .sp 2
  2576. This command functions exactly as the "Load" command except that no
  2577. implied "New" statement is performed. The specified file is located on
  2578. the disk and the program is loaded statement by statement just as if
  2579. the statements had been entered at the terminal keyboard. Therefore, if
  2580. there exists in the program in memory a statement with the same line
  2581. number as a statement that is read from the disk, the statement from
  2582. the disk will replace the statement in memory. If a statement from the
  2583. disk has a line number that falls between the line numbers of two
  2584. statements in memory, the disk statement will be placed between the two
  2585. statements in memory. One use of this command is to add a set of "Data"
  2586. statements to a program.
  2587. .sp 2
  2588. The example will cause the file "datast" to be located on the disk and
  2589. the statements in that file to be added to the statements of the
  2590. program which resides in memory.
  2591. .pa
  2592. .ce
  2593. Cont command
  2594. .sp 3
  2595. Cont
  2596. .sp 2
  2597. This command can be used to restart a basic program after interruption
  2598. (usually by the escape key).  The program will resume with the line
  2599. number that would have been executed had the user not interrupted it.
  2600. This line number is the same as the line number printed in the message
  2601. "stop at line X", except in the case of the "Stop" statement, when
  2602. execution will resume with the next line number. If user modifications
  2603. make it impossible to restart, an error message will be given. 
  2604. In this case the program may be resumed by supplying a "Run" command
  2605. with a statement number specified. If the
  2606. program has not been run, or if an "End" statement has been executed,
  2607. the "Cont" command will function exactly as a "Run" command with no line
  2608. number.
  2609. .pa
  2610. .ce
  2611. Direc command
  2612. .sp 3
  2613. Direc [<disk number>][<[account number]>][,<file name>]
  2614. .sp 2
  2615. .li
  2616.     Direc d1
  2617.     Direc [3000],PRN:
  2618. .sp 2
  2619. This command causes the directory of the user's private library to be
  2620. listed on the terminal. Files are listed five per line, plus an
  2621. indication of the number of disk sectors used in each file. Also given
  2622. is an indication of the "B" attribute.
  2623. The directory listing may be terminated at any time by pressing the
  2624. escape key.  If the user wishes to list the directory of another
  2625. account, the account code must follow the disk number and be enclosed
  2626. within square brackets.  The ability to list another account code is
  2627. governed by the user's account restrictions (see appendix D).  If a
  2628. file name is given, it must be preceded by a comma, and the listing
  2629. will be placed in that file.
  2630. .sp
  2631. If the account number given is -1, and the restriction word allows access
  2632. to other accounts, then all files on the given disk are listed.  Note:
  2633. the brackets surrounding the account number are necessary.
  2634. .sp 2
  2635. The first example will list the user's files which reside on d1 with
  2636. the listing going to the terminal.  The second example will list the
  2637. files for account 3000 which reside on the default disk, with the
  2638. listing going to the line printer.
  2639. .pa
  2640. .ce
  2641. Error command
  2642. .sp 3
  2643. Error <error number>
  2644. .sp 2
  2645. .li
  2646.     Error 5
  2647. .sp 2
  2648. This command causes a description of an error message to be printed on
  2649. the user's terminal. At the detection of an error, BASIC prints the
  2650. error number, the line number (if applicable), the error type and
  2651. the text of the error message on the terminal. If
  2652. the user wishes to view this information at other times,
  2653. this command should be entered.
  2654. Error messages are stored on the disk in the file "basicerrors" and
  2655. maintained by a text editor such as "Edlin".
  2656. .pa
  2657. .ce
  2658. Kill command
  2659. .sp 3
  2660. Kill
  2661. .sp 2
  2662. This command causes the BASIC system to be immediately aborted and a
  2663. return to DOS. This command may only be executed from the system
  2664. console, since DOS will communicate with the console immediately after
  2665. the command takes effect.
  2666. Also note that the abort is immediate, and any users using the system
  2667. will be stopped. The "Lines" command should be used to determine system
  2668. utilization before this command is issued. This command is only allowed
  2669. for users with bit 15 on in their restriction word (see appendix D).
  2670. .sp
  2671. The "Kill" command will flush any disk buffers belonging to the user 
  2672. issuing the "Kill" command, but will not flush buffers belonging
  2673. to other users, so it is important that all other users sign off
  2674. before issuing the "Kill" command.
  2675. .pa
  2676. .ce
  2677. Length command
  2678. .sp 3
  2679. Length
  2680. .sp 2
  2681. This command decodes the user's program line by line and prints the
  2682. total number of bytes needed to store the program as text. It also
  2683. divides this number of bytes by 512 and prints the number of sectors
  2684. needed to store the program on disk. This number of sectors may be
  2685. compared with the number printed in response to a "Direc" or "Lib" command
  2686. to decide which file should be used to contain the program.
  2687. .pa
  2688. .ce
  2689. Lib command
  2690. .sp 3
  2691. Lib [<disk number>][,<[account number]>][,<file name>]
  2692. .sp 2
  2693. .li
  2694.     Lib d2
  2695.     Lib [-1],PRN:
  2696. .sp 2
  2697. This command causes a listing of all programs in the public directory
  2698. to the user's terminal. If a disk number is given, the listing will
  2699. be of the public directory on that disk. If a disk number is not
  2700. given, the system default disk will be used. Files are listed three
  2701. per line, and an indication is given of the number of sectors used
  2702. by each file. An indication is also given as to the presence of the
  2703. "B" attribute.  If a file name is specified,
  2704. the output will be sent to that file.
  2705. .sp
  2706. If an account number is given, then the command acts identical to
  2707. the "Direc" command.
  2708. .sp 2
  2709. The first example causes a listing of all the public files on disk
  2710. two to be printed on the terminal.
  2711. .br
  2712. The second example sends a listing of all files on the current directory
  2713. to the line printer.  This is only allowed if restriction bit 13 is set.
  2714. .pa
  2715. .ce
  2716. Lines command
  2717. .sp 3
  2718. Lines
  2719. .sp 2
  2720. This command causes a listing of all users presently on the
  2721. system to be printed on the terminal. Also listed is the port number,
  2722. the priority and the slot time
  2723. for each user (see "Prty" and "Slot" statements).
  2724. .br
  2725. This command can be useful in determining system mix
  2726. which gives an indication of the efficiency of a compute-bound program.
  2727. Compute-bound programs will run less efficiently with a greater number
  2728. of users on the system.
  2729. .pa
  2730. .ce
  2731. List command
  2732. .sp 3
  2733. .li
  2734. List [beginning line number][-ending line number][,<file name>]
  2735.  
  2736.     List 100-
  2737.     List,PRN:
  2738.     List,d1:myprog
  2739. .sp 2
  2740. This command causes a listing of the program to be sent to the file
  2741. specified, or if no file is specified, to be sent to the user's
  2742. terminal. If only a beginning line number is specified, only that
  2743. line will by listed. If a beginning line number followed by a dash
  2744. is specified, the listing will begin at that line number.
  2745. If both beginning and ending line numbers are specified, the listing
  2746. will contain only that range of lines.
  2747. .sp 2
  2748. The first example will list the user's program starting with line 100
  2749. on the terminal.
  2750. .sp
  2751. The second example will list the entire program on
  2752. the line printer.
  2753. .sp
  2754. The third example will store the
  2755. entire program on the disk file on disk number 1 which has the name
  2756. "myprog" (preceded by the user's account code-the list command may
  2757. not be used to store programs in public files). Note that the third
  2758. example does not cause a program to be loaded and then listed to the
  2759. terminal as in other BASIC's, but instead sends the listing of the
  2760. program which the user had already loaded to the file specified.
  2761. .pa
  2762. .ce
  2763. Load command
  2764. .sp 3
  2765. Load <file name>
  2766. .sp 2
  2767. .li
  2768.     Load myfile
  2769. .sp 2
  2770. This command causes a program to be loaded from the specified file.
  2771. BASIC first performs an assumed "New" command to clear memory, then loads
  2772. the specified program. The program may either be in text form (as with
  2773. the "List <file name>" command) or in binary form (as with the "Save
  2774. <file name>" command). "Load" will automatically determine the format
  2775. of the file and then load the program from the file. Binary programs
  2776. must be loaded from files which have the "B" attribute (see the "Create"
  2777. command).  If the designated file is not on the directory of the specified
  2778. disk, an error message will be given, but the program which was previously
  2779. in memory will already have been lost by the assumed "New".
  2780. .sp 2
  2781. The example will load the program contained in the file "myfile" on the
  2782. default disk.
  2783. .pa
  2784. .ce
  2785. Psave command
  2786. .sp 3
  2787. Psave <file name>
  2788. .sp 2
  2789. .li
  2790.     Psave test
  2791. .sp 2
  2792. This command functions exactly as the "Save" command (see below),
  2793. except that files
  2794. which are preceded by the public account number (0) are used instead of
  2795. files preceded by the user's account number.
  2796. .sp 2
  2797. The example saves the program in memory into the file named "test"
  2798. in binary form. The file "Test" must have been created with the "B"
  2799. attribute (see the "Create" statement).
  2800. .pa
  2801. .ce
  2802. Public command
  2803. .sp 3
  2804. Public [beginning line number][-ending line number],<file name>
  2805. .sp 2
  2806. .li
  2807.     Public,stat
  2808. .sp 2
  2809. This command functions exactly as the "List" command (see above),
  2810. except that files
  2811. which are preceded by the public account number (0) are used instead of
  2812. files preceded by the user's account number.
  2813. .sp 2
  2814. The example lists the user's program in text form into the
  2815. public file named "stat".
  2816. .pa
  2817. .ce
  2818. Renumb command
  2819. .sp 3
  2820. Renumb [<increment>][,<beginning line number>]
  2821. .sp 2
  2822. .li
  2823.     Renumb 100,2000
  2824. .sp 2
  2825. This command causes a program to be renumbered using the increment
  2826. given in the first number (or 10 if no number is
  2827. given), and beginning with the statement number given in the
  2828. second number (or 10 if no number is given). If the
  2829. renumbering process as stated causes statement numbers in the program
  2830. to run beyond statement 65535 (maximum for the system), the command
  2831. will be repeated with both parameters set to one. Renumbering affects
  2832. line numbers, and statement numbers in "Goto", "Gosub", "On", "Restore"
  2833. and "If" statements.
  2834. .sp 2
  2835. The example will renumber the program in increments of 100 with the
  2836. first statement numbered 2000.
  2837. .pa
  2838. .ce
  2839. Run command
  2840. .sp 3
  2841. .li
  2842. [<statement number>] Run [<file name>]
  2843.  
  2844.     100 Run
  2845.     Run
  2846. .sp 2
  2847. This command causes BASIC to change from the edit mode of operation
  2848. to the execution mode of operation. If no line number is specified, all
  2849. variables will be set to zero and unassigned, all files will be closed,
  2850. all stacks will be cleared (gosub, for-next, and function), and
  2851. execution will begin with the lowest numbered statement of the program.
  2852. If a line number is specified, none of the above will be done, (that
  2853. is, all variables will remain assigned and will contain their previous
  2854. values, and all stacks will remain as set), and execution will begin
  2855. with the specified statement. Any statement number may be specified,
  2856. but care should be taken when altering the course of a program with
  2857. this command. If a "Return" statement is bypassed by means of an
  2858. interruption of the program and re-commencement using this command,
  2859. but skipping the "Return" statement, one position on the gosub stack
  2860. will be lost to the program until the next "New" command or "Run"
  2861. command without a statement number. Also, the next "Return" statement
  2862. encountered will cause control to be passed to the statement
  2863. corresponding to the "Return" statement that was ignored.  If a file
  2864. name is specified in the "Run" command, that file will be loaded
  2865. (exactly as in the "Load" command) and executed.  A statement
  2866. number will be ignored in this case.
  2867. .pa
  2868. .ce
  2869. Save command
  2870. .sp 3
  2871. Save <file name>
  2872. .sp 2
  2873. This command causes the program which is currently in memory to be saved
  2874. in binary form on the disk in the file specified.  This command is much
  2875. faster than the corresponding "List" command, and will store the program
  2876. in less space than the list command.  However, programs stored in this
  2877. manner can be accessed only by BASIC.  No editors
  2878. can read or change any program stored in this manner.  Also,
  2879. BASIC performs an automatic "Clear" before saving a program in binary
  2880. (see "Clear" statement), which "List" does not.  This means that after
  2881. issuing a "Save" command, the user may not use the "Run" command with a
  2882. statement number or the "Cont" command.  Only a "Run" without a statement
  2883. number will be successful.  Finally, a program which is saved with this
  2884. command cannot be appended to another program already in memory (see
  2885. "Append" command).  In order to determine the number of sectors required
  2886. for a program stored in binary form, use the "Size" command described
  2887. below.
  2888. .sp 
  2889. The file referenced must have been created with the /b attribute or
  2890. an error will occur.  (see the "Create" statement).
  2891. .sp
  2892. If the file is not large enough to hold the "Saved" program, then
  2893. it will automaticly be expanded to fit.  This is the only option
  2894. under BASIC that will expand a file, but should not be used
  2895. to expand data files.
  2896. .pa
  2897. .ce
  2898. Show command
  2899. .sp 3
  2900. Show <terminal number>
  2901. .sp 1
  2902.     Show 3
  2903. .sp 2
  2904. This command logically connects your terminal in parallel
  2905. to the terminal of the given user number.  All characters
  2906. displayed on one terminal will be displayed on the other.
  2907. The show command stays in effect until CTRL A is entered on
  2908. the originating terminal.  This command is restricted and
  2909. requires restriction bit 14 to be set (see appendix D).  This is
  2910. intended for use by the system operator.  If two users both
  2911. use the show command such that they show each other
  2912. either directly or indirectly, the output will become very
  2913. confusing until both users enter CTRL A.
  2914. .sp 1
  2915. The example causes all characters displayed on user 3's
  2916. terminal to be shown on the terminal of the user issuing the
  2917. command, and all characters typed on this terminal to be
  2918. displayed on user 3's terminal.
  2919. .sp 1
  2920. This command is often used to run a program in
  2921. background by signing on an unused terminal via the
  2922. "Sign" statement, then showing that terminal with the
  2923. "Show" command and running the program.
  2924. .pa
  2925. .ce
  2926. Size command
  2927. .sp 3
  2928. Size
  2929. .sp 2
  2930. This command causes the number of bytes used by the current program,
  2931. and the number of bytes available in the user space, to be printed on
  2932. the user's terminal. The first value is dependent on the number of
  2933. statements in the program and the number of bytes needed by the user's
  2934. variables, lists, and matrices, and the second value is a constant.
  2935. Also, the number of sectors required for a binary save of the current
  2936. program is printed.  See the "Save" command.
  2937. .pa
  2938. .ce
  2939. Time command
  2940. .sp 3
  2941. Time
  2942. .sp 2
  2943. This command causes the terminal time information (which is given in
  2944. response to a "Bye" command also) to be printed on the user's terminal.
  2945. The time given will be the number of cpu seconds used by the user since
  2946. sign-in time, and the current date and time-of-day.
  2947. .pa
  2948. .ce
  2949. Appendix A
  2950. .sp 3
  2951. The following table gives the ASCII characters and their equivalent
  2952. decimal values. These decimal values may be given within angle brackets
  2953. (<>) in any string literal to represent the given character.
  2954. .sp 2
  2955. .li
  2956. value   char !  value   char !  value   char !  value   char
  2957. -----   ---- !  -----   ---- !  -----   ---- !  -----   ----
  2958.              !               !               !
  2959.   0     nul  !   32     space!   64     @    !   96     `
  2960.   1     Soh  !   33     !    !   65     A    !   97     a
  2961.   2     stx  !   34     "    !   66     B    !   98     b
  2962.   3     etx  !   35     #    !   67     C    !   99     c
  2963.   4     eot  !   36     $    !   68     D    !  100     d
  2964.   5     enq  !   37     %    !   69     E    !  101     e
  2965.   6     ack  !   38     &    !   70     F    !  102     f
  2966.   7     bel  !   39     '    !   71     G    !  103     g
  2967.   8     bs   !   40     (    !   72     H    !  104     h
  2968.   9     ht   !   41     )    !   73     I    !  105     i
  2969.  10     lf   !   42     *    !   74     J    !  106     j
  2970.  11     vt   !   43     +    !   75     K    !  107     k
  2971.  12     ff   !   44     ,    !   76     L    !  108     l
  2972.  13     cr   !   45     -    !   77     M    !  109     m
  2973.  14     so   !   46     .    !   78     N    !  110     n
  2974.  15     si   !   47     /    !   79     O    !  111     o
  2975.  16     dle  !   48     0    !   80     P    !  112     p
  2976.  17     dc1  !   49     1    !   81     Q    !  113     q
  2977.  18     dc2  !   50     2    !   82     R    !  114     r
  2978.  19     dc3  !   51     3    !   83     S    !  115     s
  2979.  20     dc4  !   52     4    !   84     T    !  116     t
  2980.  21     nak  !   53     5    !   85     U    !  117     u
  2981.  22     syn  !   54     6    !   86     V    !  118     v
  2982.  23     etb  !   55     7    !   87     W    !  119     w
  2983.  24     can  !   56     8    !   88     X    !  120     x
  2984.  25     em   !   57     9    !   89     Y    !  121     y
  2985.  26     sub  !   58     :    !   90     Z    !  122     z
  2986.  27     esc  !   59     ;    !   91     [    !  123     {
  2987.  28     fs   !   60     <    !   92     \    !  124     |
  2988.  29     gs   !   61     =    !   93     ]    !  125     }
  2989.  30     Rs   !   62     >    !   94     ^    !  126     ~
  2990.  31     us   !   63     ?    !   95     _    !  127     del
  2991. .pa
  2992. .ce
  2993. Appendix B
  2994. .sp 3
  2995. .ce
  2996. Derived Functions
  2997. .sp 2
  2998. The following functions can be calculated using the BASIC functions:
  2999. .sp 2
  3000. .li
  3001. Function                Function expressed in terms of BASIC functions
  3002. --------                ----------------------------------------------
  3003.  
  3004. secant                  sec(X)=1/cos(X)
  3005. cosecant                csc(X)=1/sin(X)
  3006. cotangent               cot(X)=1/tan(X)
  3007. inverse sine            arcsin(X)=atn(X/sqr(-X*X+1))
  3008. inverse cosine          arccos(X)=-atn(X/sqr(-X*X+1))+1.5708
  3009. Inverse secant          arcsec(X)=atn(sqr(X*X-1))+sgn(X)-1)*1.5708
  3010. Inverse cosecant        arccsc(X)=atn(1/sqr(X*X-1))+(sgn(X)-1)*1.5708
  3011. Inverse cotangent       arccot(X)=-atn(X)+1.5708
  3012. Hyperbolic sine         sinh(X)=(exp(X)-exp(-X))/2
  3013. hyperbolic cosine       cosh(X)=(exp(X)+exp(-X))/2
  3014. hyperbolic tangent      tanh(X)=-exp(-X)/(exp(X)+exp(-X))*2+1
  3015. hyperbolic secant       sech(X)=2/(exp(X)+exp(-X))
  3016. hyperbolic cosecant     csch(X)=2/(exp(X)-exp(-X))
  3017. hyperbolic cotangent    coth(X)=exp(-X)/(exp(X)-exp(-X))*2+1
  3018. inverse hyperbolic
  3019.         sine            arcsinh(X)=log(X+sqr(X*X+1))
  3020. inverse hyperbolic
  3021.         cosine          arccosh(X)=log(X+sqr(X*X-1))
  3022. inverse hyperbolic
  3023.         tangent         arctanh(X)=log((1+X)/(1-X))/2
  3024. inverse hyperbolic
  3025.         secant          arcsech(X)=log((sqr(-X*X+1)+1)/X)
  3026. inverse hyperbolic
  3027.         cosecant        arccsch(X)=log((sgn(X)*sqr(X*X+1)+1)/X)
  3028. inverse hyperbolic
  3029.         cotangent       arccoth(X)=log((X+1)/(X-1))/2
  3030. .pa
  3031. .ce
  3032. Appendix C
  3033. .sp 3
  3034. .ce
  3035. Support Files
  3036. .sp 2
  3037. Included on the BASIC distribution diskette are several files necessary
  3038. to operate the system:
  3039. .sp 2
  3040. .li
  3041.     d0:fbasicac.cts
  3042.     d0:fbasiclo.gs
  3043.     d0:fbasicer.ror
  3044.     d0:fbasicme.sgs
  3045. .sp 2
  3046. The file basicaccts contains the account information used by the system
  3047. accounting programs and the sign in procedure.  This file is maintained
  3048. by the "account" program.
  3049. .sp
  3050. The file basiclogs
  3051. contains a log of system start up, user sign on and
  3052. sign off, messages to the system operator created by the "Log" statement,
  3053. and system kill.  As messages are written to the log file, they are
  3054. added until the end of file is reached.  When the end of file is
  3055. reached, then the messages will "wrap" around to the beginning of the file
  3056. and begin overwriting the oldest messages.  To expand the log file, 
  3057. "Create" a file with the number of records for your desired history
  3058. allowing 8 entries per sector. Then delete the old file and rename
  3059. the new file to basicerror.  Then write a 0 in the first record to
  3060. initialize the last record used pointer.
  3061. The contents of this file are maintained and reported by the program
  3062. "log".  For further information on record format of basiclogs, see
  3063. the program listing.
  3064. .sp
  3065. The file basicerror contains the
  3066. system error messages displayed by the "Error" command.
  3067. Each error message in basicerror consists of two or more lines.
  3068. The first line contains the error number, a comma, and the error type.
  3069. The remaining lines until the next double carriage return are the text
  3070. of the error message as reported by the "Error" command.
  3071. .sp
  3072. The basicmsgs
  3073. file contains the banner message printed when escape is pressed during
  3074. the log in process, and the 'hello' message printed after a succesful
  3075. sign on.  The two messages in basicmsgs can be edited with any text editor
  3076. and are both terminated by a double carriage return.
  3077. .sp
  3078. If any of the above files are not found on the directory d0:, then
  3079. BASIC will not be able to run, and will exit to DOS without any messages.
  3080. .sp
  3081. See appendix E for an explanation of file naming conventions.
  3082. .pa
  3083. .ce
  3084. Appendix D
  3085. .sp 3
  3086. .ce
  3087. Account Program
  3088. .sp 2
  3089. This program is used to add, delete, or list the contents of the
  3090. basicaccts file. Each account number entry contains the user's account
  3091. number (4 digits in decimal), the user's password, the user's
  3092. restriction indicators, and a word giving the number of times that
  3093. user has signed-in since his account number was added.
  3094. Execution is self-explanatory. The restrictions are entered as a list
  3095. of ones and zeros from bit 15 to bit 0.  The meanings of the bits are:
  3096. .sp 2
  3097. .li 
  3098.     bit     meaning if set to 1
  3099.     ---     -------------------
  3100.     15    Allow "Kill" command.
  3101.     14    Allow "Zap", "Prty", "Slot", "Show", "Sign" to other ports.
  3102.     13    Allow user to list any directory.
  3103.     12    Allow "Create", "Delete", "Rename".
  3104.     11
  3105.     10    Allow user to save programs on files.
  3106.     9    Allow "Public" command.
  3107.     8    Allow "Hold" statement.
  3108.     7    Allow user to list saved programs.
  3109.     6
  3110.     5    Allows user to open any file (basic or non-basic).
  3111.         The user may give up to 10 characters for a file
  3112.         name if he has this bit=1.
  3113.         Note: when this bit is set, then the user account
  3114.         number must be given as part of the file name when
  3115.         accessing any file using "Create" or "Delete".
  3116.         See Appendix E for pc-dos file conventions.
  3117.     4    Allow "Prty" and "Slot" statements.
  3118.     3 
  3119.     2 
  3120.     1 
  3121.     0    No log of sign-in, out for this user.
  3122. .pa
  3123. .sp 3 
  3124. .ce
  3125. Appendix E
  3126. .sp 3
  3127. .ce
  3128. pc-dos file conventions
  3129. .sp 2
  3130. Under pc-dos, BASIC references all files in the following form:
  3131. .li
  3132.     dn:auuuuXXXXXXX
  3133. .br
  3134. where 'dn:' represents an optional disk number corresponding to a pc-dos
  3135. directory path, 
  3136. 'a' is either 'B' for a basic program, or 'F' for a data file.  'uuuu'
  3137. represents the user account number or 0, and XXXXXX represent the given file
  3138. name.  Note, the file attribute is supplied automatically by BASIC
  3139. during the create, and open so
  3140. it does not need to be included in the name passed to any BASIC statement.
  3141. The file name will run over into the file extent as viewed in
  3142. a pc-dos "dir" command.
  3143. .sp
  3144. Pc-dos 2.0 path names are supported by the use of a disk number.  Set up
  3145. in the program environment are variables that describe the path name
  3146. to a specific "disk" as viewed by basic.  To provide access to a specific
  3147. directory or disk, enter a pc-dos "set" command to enter the path for that
  3148. directory.
  3149. .sp 2
  3150. .li
  3151.     examples
  3152.         set D0=a:
  3153.         set D1=c:\basic
  3154. .sp 2
  3155. There must be one set command for each disk path that will be accessed
  3156. through BASIC.  This can be done in the AUTOEXEC.BAT file to set the
  3157. disks up at power up.
  3158. .sp
  3159. BASIC does not put a limit on the number of directories accessed, via the
  3160. set commands, but it is likely that pc-dos will give an "out of environment
  3161. space" message if too many environment variables are set.
  3162. .sp
  3163. BASIC is shipped with a single
  3164. directory set up as d0: which is named "dk0".  There is a corresponding
  3165. entry in the environment D0=\dk0. To allow access to other directory
  3166. paths, add other environment entries for D1 D2 etc...
  3167. .sp
  3168. Pc-dos files that are to be used by BASIC users must be created and allocated
  3169. before they can be used.  Because Snowcrest BASIC supports multiple users,
  3170. it is possible that two users can access the same file simultaneously.
  3171. If one user expands the file, the other user may not be notified. 
  3172. To eliminate the possibility of lost data, the file is allocated to
  3173. the maximum size at the time the file is created.  In addition to providing
  3174. data integrity, this also improves file access times because the file is
  3175. allocated on a contiguous section of the disk.
  3176. .sp
  3177. The file name should have the user's account number as the
  3178. first four characters and the name he
  3179. wishes as the next six.  Example:  1000game would be a file named
  3180. 'game' for user 1000.  Files that are to be public, that is, available
  3181. to all users, should have a single zero as the first character of the
  3182. name, 0tictoe.  When searching for a file, BASIC will first search
  3183. for a match under the user's account code, then under the public
  3184. account code, then (if the user has bit 5=1 in his restriction word)
  3185. with no account code.  User account codes must always be four digits
  3186. the first of which may not be zero.
  3187. .sp
  3188. If the file is created with the "b" attribute,
  3189. it may not
  3190. be opened (via the 'open statement').
  3191.