ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1882 lines
58 KiB

  1. Bywater BASIC Interpreter/Shell, version 2.10
  2. ---------------------------------------------
  3. Copyright (c) 1993, Ted A. Campbell
  4. for bwBASIC version 2.10, 11 October 1993
  5. CONTENTS:
  6. 1. DESCRIPTION
  7. 2. TERMS OF USE
  8. 3. QUICK REFERENCE LIST OF COMMANDS AND FUNCTIONS
  9. 4. GENERAL NOTES ON USAGE
  10. 5. EXPANDED REFERENCE FOR COMMANDS AND FUNCTIONS
  11. 6. PREDEFINED VARIABLES
  12. 7. UNIMPLEMENTED COMMANDS AND FUNCTIONS
  13. and AGENDA FOR DEVELOPMENT
  14. 8. THE STORY OF BYWATER BASIC
  15. 9. COMMUNICATIONS
  16. The author wishes to express his thanks to Mr. David MacKenzie,
  17. who assisted in the development Unix installation and configuration
  18. for this version.
  19. 1. DESCRIPTION
  20. The Bywater BASIC Interpreter (bwBASIC) implements a large
  21. superset of the ANSI Standard for Minimal BASIC (X3.60-1978)
  22. and a significant subset of the ANSI Standard for Full BASIC
  23. (X3.113-1987) in C. It also offers shell programming facilities
  24. as an extension of BASIC. bwBASIC seeks to be as portable
  25. as possible.
  26. bwBASIC can be configured to emulate features, commands, and
  27. functions available on different types of BASIC interpreters;
  28. see the file INSTALL for further installation information.
  29. The interpreter is fairly slow. Whenever faced with a choice
  30. between conceptual clarity and speed, I have consistently chosen
  31. the former. The interpreter is the simplest design available,
  32. and utilizes no system of intermediate code, which would speed
  33. up considerably its operation. As it is, each line is interpreted
  34. afresh as the interpreter comes to it.
  35. bwBASIC implements one feature not available in previous BASIC
  36. interpreters: a shell command can be entered interactively at the
  37. bwBASIC prompt, and the interpreter will execute it under a
  38. command shell. For instance, the command "dir *.bas" can be
  39. entered in bwBASIC (under DOS, or "ls -l *.bas" under UNIX) and
  40. it will be executed as from the operating system command line.
  41. Shell commands can also be given on numbered lines in a bwBASIC
  42. program, so that bwBASIC can be used as a shell programming
  43. language. bwBASIC's implementation of the RMDIR, CHDIR, MKDIR,
  44. NAME, KILL, ENVIRON, and ENVIRON$() commands and functions
  45. offer further shell-processing capabilities.
  46. 2. TERMS OF USE:
  47. This version of Bywater BASIC is released under the terms of the
  48. GNU General Public License (GPL), which is distributed with this
  49. software in the file "COPYING". The GPL specifies the terms
  50. under which users may copy and use the software in this distribution.
  51. A separate license is available for commercial distribution,
  52. for information on which you should contact the author.
  53. 3. QUICK REFERENCE LIST OF COMMANDS AND FUNCTIONS
  54. Be aware that many of these commands and functions will not be
  55. available unless you have set certain flags in the header files
  56. (see the expanded reference section below for dependencies).
  57. ABS( number )
  58. ASC( string$ )
  59. ATN( number )
  60. CALL subroutine-name
  61. CASE ELSE | IF partial-expression | constant
  62. CHAIN [MERGE] file-name [, line-number] [, ALL]
  63. CHDIR pathname
  64. CHR$( number )
  65. CINT( number )
  66. CLEAR
  67. CLOSE [[#]file-number]...
  68. CLS
  69. COMMON variable [, variable...]
  70. COS( number )
  71. CSNG( number )
  72. CVD( string$ )
  73. CVI( string$ )
  74. CVS( string$ )
  75. DATA constant[,constant]...
  76. DATE$
  77. DEF FNname(arg...)] = expression
  78. DEFDBL letter[-letter](, letter[-letter])...
  79. DEFINT letter[-letter](, letter[-letter])...
  80. DEFSNG letter[-letter](, letter[-letter])...
  81. DEFSTR letter[-letter](, letter[-letter])...
  82. DELETE line[-line]
  83. DIM variable(elements...)[variable(elements...)]...
  84. DO NUM|UNNUM
  85. DO [WHILE expression]
  86. EDIT
  87. ELSE
  88. ELSEIF
  89. END IF | FUNCTION | SELECT | SUB
  90. ENVIRON variable-string = string
  91. ENVIRON$( variable-string )
  92. EOF( device-number )
  93. ERASE variable[, variable]...
  94. ERL
  95. ERR
  96. ERROR number
  97. EXP( number )
  98. FIELD [#] device-number, number AS string-variable [, number AS string-variable...]
  99. FILES filespec$
  100. FUNCTION
  101. FOR counter = start TO finish [STEP increment]
  102. GET [#] device-number [, record-number]
  103. GOSUB line | label
  104. GOTO line | label
  105. HEX$( number )
  106. IF expression THEN [statement [ELSE statement]]
  107. INKEY$
  108. INPUT [# device-number]|[;]["prompt string";]list of variables
  109. INSTR( [start-position,] string-searched$, string-pattern$ )
  110. INT( number )
  111. KILL file-name
  112. LEFT$( string$, number-of-spaces )
  113. LEN( string$ )
  114. LET variable = expression
  115. LINE INPUT [[#] device-number,]["prompt string";] string-variable$
  116. LIST line[-line]
  117. LOAD file-name
  118. LOC( device-number )
  119. LOCATE line, column
  120. LOF( device-number )
  121. LOG( number )
  122. LOOP [UNTIL expression]
  123. LSET string-variable$ = expression
  124. MERGE file-name
  125. MID$( string$, start-position-in-string[, number-of-spaces ] )
  126. MKD$( number )
  127. MKDIR pathname
  128. MKI$( number )
  129. MKS$( number )
  130. NAME old-file-name AS new-file-name
  131. NEW
  132. NEXT [counter]
  133. OCT$( number )
  134. ON variable GOTO|GOSUB line[,line,line,...]
  135. ON ERROR GOSUB line
  136. OPEN "O"|"I"|"R", [#]device-number, file-name [,record length]
  137. file-name FOR INPUT|OUTPUT|APPEND AS [#]device-number [LEN = record-length]
  138. OPTION BASE number
  139. POS
  140. PRINT [# device-number,][USING format-string$;] expressions...
  141. PUT [#] device-number [, record-number]
  142. QUIT
  143. RANDOMIZE number
  144. READ variable[, variable]...
  145. REM string
  146. RESTORE line
  147. RETURN
  148. RIGHT$( string$, number-of-spaces )
  149. RMDIR pathname
  150. RND( number )
  151. RSET string-variable$ = expression
  152. RUN [line][file-name]
  153. SAVE file-name
  154. SELECT CASE expression
  155. SGN( number )
  156. SIN( number )
  157. SPACE$( number )
  158. SPC( number )
  159. SQR( number )
  160. STOP
  161. STR$( number )
  162. STRING$( number, ascii-value|string$ )
  163. SUB subroutine-name
  164. SWAP variable, variable
  165. SYSTEM
  166. TAB( number )
  167. TAN( number )
  168. TIME$
  169. TIMER
  170. TROFF
  171. TRON
  172. VAL( string$ )
  173. WEND
  174. WHILE expression
  175. WIDTH [# device-number,] number
  176. WRITE [# device-number,] element [, element ]....
  177. 4. GENERAL NOTES ON USAGE:
  178. 4.a. Interactive Environment
  179. An interactive environment is provided if the flag INTERACTIVE
  180. is defined as TRUE in bwbasic.h, so that a line with a
  181. line number can be entered at the bwBASIC prompt and it will be
  182. added to the program in memory.
  183. Line numbers are not strictly required, but are useful if the
  184. interactive enviroment is used for programming. For longer
  185. program entry one might prefer to use an ASCII text editor, and
  186. in this case lines can be entered without numbers. One can use
  187. DO NUM and DO UNNUM to number or unnumber lines. See also the
  188. documentation below for the pseudo-command EDIT.
  189. 4.b. Naming Conventions
  190. Command names and function names are not case sensitive,
  191. so that "Run" and "RUN" and "run" are equivalent and "abs()"
  192. and "ABS()" and "Abs()" are equivalent. HOWEVER, variable
  193. names ARE case sensitive in bwbASIC, so that "d$" and "D$"
  194. are different variables. This differs from some BASIC
  195. implementations where variable names are not case sensitive.
  196. Variable names can use any alphabetic characters, the period
  197. and underscore characters and decimal digits (but not in the
  198. first position). They can be terminated with '#' or '!' to
  199. allow Microsoft-type names, even though the precision is
  200. irrelevant to bwBASIC.
  201. 4.c. Numerical Constants
  202. Numerical constants may begin with a digit 0-9 (decimal), with
  203. the "&H" or "&h" (hexadecimal) or the "&o" or "&O" (octal).
  204. Decimal numbers may terminated with 'E', 'e', 'D', or 'd'
  205. followed by an exponent number to denote exponential notation.
  206. Decimal constants may also be terminated by the '#' or '!'
  207. to comply with Microsoft-style precision terminators, although
  208. the precision specified will be irrelevant to bwBASIC.
  209. 4.d. Command-Line Execution
  210. A filename can be specified on the command line and will be
  211. LOADed and RUN immediately, so that the command line
  212. bwbasic prog.bas
  213. will load and execute "prog.bas".
  214. 4.e. Program Storage
  215. All programs are stored as ASCII text files.
  216. 4.f. TRUE and FALSE
  217. TRUE is defined as -1 and FALSE is defined as 0 in the default
  218. distribution of bwBASIC. These definitions can be changed by
  219. those compiling bwBASIC (see file BWBASIC.H).
  220. 4.g. Assignments
  221. Assignment must be made to variables. This differs from some
  222. implementations of BASIC where assignment can be made to a
  223. function. Implication: "INSTR( 3, x$, y$ ) = z$" will not
  224. work under bwBASIC.
  225. 4.h. Operators and Precedence
  226. bwBASIC recognizes the following operators, with their level
  227. of precedence given (1 = highest):
  228. ^ 1 exponentiation
  229. * 2 multiplication
  230. / 2 division
  231. \ 3 integer division
  232. + 5 addition
  233. - 5 subtraction
  234. = 6 equality or assignment
  235. MOD 4 modulus (remainder) arithmetic
  236. <> 7 inequality
  237. < 8 less than
  238. > 9 greater than
  239. <= 10 less than or equal to
  240. =< 10 less than or equal to
  241. >= 11 greater than or equal to
  242. => 11 greater than or equal to
  243. NOT 12 negation
  244. AND 13 conjunction
  245. OR 14 disjunction
  246. XOR 15 exclusive or
  247. IMP 16 implication
  248. EQV 17 equivalence
  249. 4.h. Numerical Precision (NOT)
  250. bwBASIC utilizes numbers with only one level of precision. If
  251. the flag NUMBER_DOUBLE is defined as TRUE in bwbasic.h, the
  252. precision implemented will be that of the C "double" data type;
  253. otherwise (default) the precision will be that of the C "float"
  254. type. At a number of points there are commands (or pseudo-
  255. commands) that seem to recognize Microsoft-style precision
  256. distinctions, but for the most part these are just work-around
  257. aliases to allow Microsoft-style programs to be run.
  258. 5. EXPANDED REFERENCE FOR COMMANDS AND FUNCTIONS
  259. The "Dependencies" listed in the folowing reference materials
  260. refers to flags that must be set to TRUE in bwbasic.h for the
  261. associated command or function to be implemented. These flags
  262. are as follows:
  263. (core) Commands and Functions in any implementation of
  264. bwBASIC; these are the ANSI Minimal BASIC core
  265. INTERACTIVE Commands supporting the interactive programming
  266. environment
  267. COMMON_CMDS Commands beyond ANSI Minimal BASIC which are common
  268. to Full ANSI BASIC and Microsoft BASICs
  269. COMMON_FUNCS Functions beyond the ANSI Mimimal BASIC core, but
  270. common to both ANSI Full BASIC and Microsoft-style
  271. BASIC varieties
  272. UNIX_CMDS Commands which require Unix-style directory and
  273. environment routines not specified in C
  274. STRUCT_CMDS Commands related to structured programming; all
  275. of these are part of the Full ANSI BASIC standard
  276. ANSI_FUNCS Functions unique to ANSI Full BASIC
  277. MS_CMDS Commands unique to Microsoft BASICs
  278. MS_FUNCS Functions unique to Microsoft BASICs
  279. ------------------------------------------
  280. Function: ABS( number )
  281. Description: ABS returns the absolute value of the argument 'number'.
  282. Dependencies: (core)
  283. ------------------------------------------
  284. Function: ASC( string$ )
  285. Description: ASC returns the ASCII code for the first letter in
  286. the argument string$.
  287. Dependencies: MS_FUNCS
  288. ------------------------------------------
  289. Function: ATN( number )
  290. Description: ATN returns the arctangent value of the argument 'number'
  291. in radians.
  292. Dependencies: (core)
  293. ------------------------------------------
  294. Command: CALL subroutine-name
  295. Description: CALL calls a named subroutine (see SUB and END SUB).
  296. Dependencies: STRUCT_CMDS
  297. ------------------------------------------
  298. Command: CASE ELSE | IF partial-expression | constant
  299. Description: CASE introduces an element of a SELECT CASE statement
  300. (see SELECT CASE). CASE IF introduces a conditional
  301. SELECT CASE element, and CASE ELSE introduces a
  302. default SELECT CASE element.
  303. Dependencies: STRUCT_CMDS
  304. ------------------------------------------
  305. Command: CHAIN [MERGE] file-name [, line-number] [, ALL]
  306. Description: CHAIN passes control to another BASIC program.
  307. Variables declared COMMON (q.v.) will be passed
  308. to the new program.
  309. Dependencies: COMMON_CMDS
  310. ------------------------------------------
  311. Command: CHDIR pathname$
  312. Description: CHDIR changes the current directory to that indicated
  313. by the argument pathname$.
  314. Dependencies: UNIX_CMDS
  315. ------------------------------------------
  316. Function: CHR$( number )
  317. Description: CHR$ returns a one-character string with the character
  318. corresponding to the ASCII code indicated by argument
  319. 'number'.
  320. Dependencies: COMMON_FUNCS
  321. ------------------------------------------
  322. Function: CINT( number )
  323. Description: CINT returns the truncated integer for the argument
  324. 'number'.
  325. Dependencies: MS_FUNCS
  326. ------------------------------------------
  327. Command: CLEAR
  328. Description: CLEAR sets all numerical variables to 0, and all
  329. string variables to null.
  330. Dependencies: COMMON_CMDS
  331. ------------------------------------------
  332. Command: CLOSE [[#]file-number]...
  333. Description: CLOSE closes the file indicated by file-number
  334. (see OPEN).
  335. Dependencies: COMMON_CMDS
  336. ------------------------------------------
  337. Command: CLS
  338. Description: CLS clears the display screen (IBM and compatibles
  339. only as of version 2.10).
  340. Dependencies: IMP_IQC and IMP_CMDLOC
  341. ------------------------------------------
  342. Command: CMDS
  343. Description: CMDS is a debugging command that prints a list
  344. of all implemented bwBASIC commands.
  345. Dependencies: DEBUG
  346. ------------------------------------------
  347. Command: COMMON variable [, variable...]
  348. Description: COMMON designates variables to be passed to a CHAINed
  349. program (see CHAIN).
  350. Dependencies: COMMON_CMDS
  351. ------------------------------------------
  352. Function: COS( number )
  353. Description: COS returns the cosine of the argument 'number'
  354. in radians.
  355. Dependencies: (core)
  356. ------------------------------------------
  357. Function: CSNG( number )
  358. Description: CSNG is a pseudo-function that has no effect under
  359. bwBASIC. It replicates a Microsoft-type command
  360. that would convert the 'number' to single-precision.
  361. Dependencies: MS_FUNCS
  362. ------------------------------------------
  363. Function: CVD( string$ )
  364. Description: CVD converts the argument string$ into a bwBASIC
  365. number (precision is irrelevant in bwBASIC since
  366. bwBASIC numbers have only one precision).
  367. Implenentation-Specific Notes:
  368. CVD(), CVI(), CVS(), MKI$(), MKD$(), MKS$(): These functions
  369. are implemented, but are dependent on a) the sizes for integer,
  370. float, and double values on particular systems, and b) how
  371. particular versions of C store these numerical values. The
  372. implication is that data files created using these functions
  373. on a DOS-based microcomputer may not be translated correctly
  374. by bwBASIC running on a Unix-based computer. Similarly, data
  375. files created by bwBASIC compiled by one version of C may not be
  376. readable by bwBASIC compiled by another version of C (even under
  377. the same operating system). So be careful with these.
  378. Dependencies: MS_FUNCS
  379. ------------------------------------------
  380. Function: CVI( string$ )
  381. Description: CVI converts the argument string$ into a bwBASIC
  382. number (precision is irrelevant in bwBASIC since
  383. bwBASIC numbers have only one precision; see also
  384. the note on CVD).
  385. Dependencies: MS_FUNCS
  386. ------------------------------------------
  387. Function: CVS( string$ )
  388. Description: CVI converts the argument string$ into a bwBASIC
  389. number (precision is irrelevant in bwBASIC since
  390. bwBASIC numbers have only one precision; see also
  391. the note on CVD).
  392. Dependencies: MS_FUNCS
  393. ------------------------------------------
  394. Command: DATA constant[,constant]...
  395. Description: DATA stores numerical and string constants to be
  396. accessed by READ (q.v.).
  397. Dependencies: (core)
  398. ------------------------------------------
  399. Function: DATE$
  400. Description: DATE$ returns the current date based on the computer's
  401. internal clock as a string in the form "YYYY-MM-DD".
  402. As implemented under bwBASIC, DATE$ cannot be used for
  403. assignment (i.e., to set the system date).
  404. Note: bwBASIC presently (v2.10) does not allow assignment
  405. to a function.
  406. Dependencies: COMMON_FUNCS
  407. ------------------------------------------
  408. Command: DEF FNname(arg...)] = expression
  409. Description: DEF defines a user-written function. This function
  410. corresponds to Microsoft-type implementation, although
  411. in bwBASIC DEF is a working equivalent of FUNCTION.
  412. Dependencies: (core)
  413. ------------------------------------------
  414. Command: DEFDBL letter[-letter](, letter[-letter])...
  415. Description: DEFDBL declares variables with single-letter names
  416. as numerical variables (precision is irrelevant in
  417. bwBASIC).
  418. Dependencies: MS_CMDS
  419. ------------------------------------------
  420. Command: DEFINT letter[-letter](, letter[-letter])...
  421. Description: DEFINT declares variables with single-letter names
  422. as numerical variables (precision is irrelevant in
  423. bwBASIC).
  424. Dependencies: MS_CMDS
  425. ------------------------------------------
  426. Command: DEFSNG letter[-letter](, letter[-letter])...
  427. Description: DEFSNG declares variables with single-letter names
  428. as numerical variables (precision is irrelevant in
  429. bwBASIC).
  430. Dependencies: MS_CMDS
  431. ------------------------------------------
  432. Command: DEFSTR letter[-letter](, letter[-letter])...
  433. Description: DEFSTR declares variables with single-letter names
  434. as string variables.
  435. Dependencies: MS_CMDS
  436. ------------------------------------------
  437. Command: DELETE line[-line]
  438. Description: DELETE deletes program lines indicated by the
  439. argument(s). If you want to use DELETE for non-
  440. numbered programs, first use DO NUM, then DELETE,
  441. then DO UNNUM.
  442. Dependencies: INTERACTIVE
  443. ------------------------------------------
  444. Command: DIM variable(elements...)[variable(elements...)]...
  445. Description: DIM specifies variables that have more than one
  446. element in a single dimension, i.e., arrayed
  447. variables.
  448. Note: As implemented under bwBASIC, DIM accepts only
  449. parentheses as delimiters for variable fields.
  450. (Some BASICs allow the use of square brackets.)
  451. Dependencies: (core)
  452. ------------------------------------------
  453. Command: DO NUM|UNNUM
  454. Description: DO NUM numbers all lines in a program. The first
  455. line is given the number 10, and subsequent lines
  456. are numbered consecutively in multiples of 10. DO
  457. UNNUM removes all line numbers from a program.
  458. NOTE that these functions do nothing to line
  459. numbers, e.g., following a GOSUB or GOTO statement;
  460. these commands cannot be used as a replacement for
  461. RENUM (available in some systems, but not bwBASIC).
  462. With these commands, however, one can develop
  463. unnumbered programs by entering new lines with numbers,
  464. then running DO UNNUM to remove the line numbers.
  465. Together with LOAD and SAVE (q.v.) one can use
  466. bwBASIC as a primitive text editor.
  467. Dependencies: INTERACTIVE
  468. ------------------------------------------
  469. Command: DO [WHILE expression]
  470. Description: DO implements a number of forms of program loops.
  471. DO...LOOP simply loops; the only way out is by
  472. EXIT; DO WHILE...LOOP loops while "expression" is
  473. true (this is equivalent to the older WHILE-WEND
  474. loop, also implemented in bwBASIC); DO...LOOP UNTIL
  475. loops until the expression following UNTIL is true.
  476. Dependencies: STRUCT_CMDS
  477. ------------------------------------------
  478. Command: EDIT
  479. Description: EDIT is a pseudo-command which calls the text editor
  480. specified in the variable BWB.EDITOR$ to edit the
  481. program in memory. After the call to the text editor,
  482. the (edited) prgram is reloaded into memory. The user
  483. normally must specific a valid path and filename in
  484. BWB.EDITOR$ before this command will be useful.
  485. Dependencies: COMMON_CMDS
  486. ------------------------------------------
  487. Command: ELSE
  488. Description: ELSE introduces a default condition in a multi-line IF
  489. statement.
  490. Dependencies: STRUCT_CMDS
  491. ------------------------------------------
  492. Command: ELSEIF
  493. Description: ELSEIF introduces a secondary condition in a multi-
  494. line IF statement.
  495. Dependencies: STRUCT_CMDS
  496. ------------------------------------------
  497. Command: END IF | FUNCTION | SELECT | SUB
  498. Description: END IF ends a multi-line IF statement. END FUNCTION
  499. ends a multi-line function definition. END SELECT
  500. ends a SELECT CASE statement. END SUB ends a multi-
  501. line subroutine definition.
  502. Dependencies: STRUCT_CMDS
  503. ------------------------------------------
  504. Command: ENVIRON variable-string$ = string$
  505. Description: ENVIRON sets the environment variable identified by
  506. variable-string$ to string$.
  507. It might be noted that this differs from the implementation
  508. of ENVIRON in some versions of BASIC, but bwBASIC's ENVIRON
  509. allows BASIC variables to be used on either side of the equals
  510. sign. Note that the function ENVIRON$() is different from the
  511. command, and be aware of the fact that in some operating systems
  512. an environment variable set within a program will not be passed
  513. to its parent shell.
  514. Dependencies: UNIX_CMDS
  515. ------------------------------------------
  516. Function: ENVIRON$( variable-string$ )
  517. Description: ENVIRON$ returns the environment variable associated with
  518. the name variable-string$.
  519. Dependencies: MS_FUNCS
  520. ------------------------------------------
  521. Function: EOF( device-number )
  522. Description: EOF returns TRUE (-1) if the device associated with
  523. device-number is at the end-of-file, otherwise it
  524. returns FALSE (0).
  525. Dependencies: MS_FUNCS
  526. ------------------------------------------
  527. Command: ERASE variable[, variable]...
  528. Description: ERASE eliminates arrayed variables from a program.
  529. Dependencies: COMMON_CMDS
  530. ------------------------------------------
  531. Function: ERL
  532. Description: ERL returns the line number of the most recent error.
  533. Dependencies: MS_FUNCS
  534. ------------------------------------------
  535. Function: ERR
  536. Description: ERR returns the error number of the most recent error.
  537. Note that if PROG_ERRORS has been defined when bwBASIC is
  538. compiled, the ERR variable will not be set correctly upon
  539. errors. It only works when standard error messages are used.
  540. Dependencies: MS_FUNCS
  541. ------------------------------------------
  542. Command: ERROR number
  543. Description: ERROR simulates an error, i.e., displays the message
  544. appropriate for that error. This command is helpful
  545. in writing ON ERROR GOSUB routines that can identify
  546. a few errors for special treatment and then ERROR ERR
  547. (i.e., default handling) for all others.
  548. Dependencies: COMMON_CMDS
  549. ------------------------------------------
  550. Command: EXIT [FOR]
  551. Description: EXIT by itself exits from a DO...LOOP loop;
  552. EXIT FOR exits from a FOR...NEXT loop.
  553. Dependencies: STRUCT_CMDS
  554. ------------------------------------------
  555. Function: EXP( number )
  556. Description: EXP returns the exponential value of 'number'.
  557. Dependencies: (core)
  558. ------------------------------------------
  559. Command: FIELD [#] device-number, number AS string-variable$ [, number AS string-variable$...]
  560. Description: FIELD allocates space in a random file buffer for device
  561. indicated by device-number, allocating 'number' bytes
  562. and assigning the bytes at this position to the variable
  563. string-variable$.
  564. Dependencies: COMMON_CMDS
  565. ------------------------------------------
  566. Command: FILES filespec$
  567. Description: FILES is a pseudocommand that invokes the directory program
  568. specified in the variable BWB.FILES$ with the argument
  569. filespec$. Normally, the user must set this variable
  570. before FILES can be used. E.g., for PC-type computers,
  571. BWB.FILES$ = "DIR"
  572. will work, for Unix machines,
  573. BWB.FILES$ = "ls -l"
  574. etc.
  575. Dependencies: COMMON_CMDS
  576. ------------------------------------------
  577. Command: FNCS
  578. Description: CMDS is a debugging command that prints a list
  579. of all pre-defined bwBASIC functions.
  580. Dependencies: DEBUG
  581. ------------------------------------------
  582. Command: FUNCTION
  583. Description: FUNCTION introduces a function definition, normally
  584. ending with END FUNCTION. In bwBASIC, FUNCTION and
  585. DEF are qorking equivalents, so either can be used
  586. with single-line function definitions or with multi-
  587. line definitions terminated by END FUNCTION.
  588. Dependencies: STRUCT_CMDS
  589. ------------------------------------------
  590. Command: FOR counter = start TO finish [STEP increment]
  591. Description: FOR initiates a FOR-NEXT loop with the variable
  592. 'counter' initially set to 'start' and incrementing
  593. in 'increment' steps (default is 1) until 'counter'
  594. equals 'finish'.
  595. Dependencies: (core)
  596. ------------------------------------------
  597. Command: GET [#] device-number [, record-number]
  598. Description: GET reads the next reacord from a random-access file
  599. or device into the buffer associated with that file.
  600. If record-number is specified, the GET command reads the
  601. specified record.
  602. Dependencies: COMMON_CMDS
  603. ------------------------------------------
  604. Command: GOSUB line | label
  605. Description: GOSUB initiates a subroutine call to the line (or label)
  606. specified. The subroutine must end with RETURN.
  607. Dependencies: (core), but STRUCT_CMDS for labels
  608. ------------------------------------------
  609. Command: GOTO line | label
  610. Description: GOTO branches program execution to the specified line
  611. (or label).
  612. Dependencies: (core), but STRUCT_CMDS for labels
  613. ------------------------------------------
  614. Function: HEX$( number )
  615. Description: HEX$ returns a string giving the hexadecimal (base 16)
  616. value for the 'number'.
  617. Dependencies: MS_FUNCS
  618. ------------------------------------------
  619. Command: IF expression THEN [statement [ELSE statement]]
  620. Description: IF evaluates 'expression' and performs the THEN
  621. statement if it is true or (optionally) the
  622. ELSE statement if it is FALSE. If STRUCT_CMDS
  623. is set to TRUE, bwBASIC allows multi-line IF
  624. statements with ELSE and ELSEIF cases, ending
  625. with END IF.
  626. Dependencies: (core), STRUCT_CMDS for multi-line IF statements
  627. ------------------------------------------
  628. Function: INKEY$
  629. Description: INKEY$ reads the status of the keyboard, and a single
  630. keypress, if available. If a keypress is not available,
  631. then INKEY$ immediately returns a null string ("").
  632. Currently (v2.10) implemented in bwx_iqc.c only.
  633. Dependencies: IMP_IQC and IMP_CMDLOC
  634. ------------------------------------------
  635. Command: INPUT [# device-number]|[;]["prompt string";]list of variables
  636. Description: INPUT allows input from the terminal or a device
  637. specified by device-number. If terminal, the "prompt
  638. string" is output, and input is assigned to the
  639. appropriate variables specified.
  640. bwBASIC does not support the optional feature of INPUT
  641. that suppresses the carriage-return and line-feed at the end
  642. of the input. This is because C alone does not provide for any
  643. means of input other than CR-LF-terminated strings.
  644. Dependencies: (core)
  645. ------------------------------------------
  646. Function: INSTR( [start-position,] string-searched$, string-pattern$ )
  647. Description: INSTR returns the position at which string-pattern$
  648. occurs in string-searched$, beginning at start-position.
  649. As implemented in bwBASIC, INSTR cannot be used for
  650. assignments.
  651. Note: bwBASIC presently (v2.10) does not allow assignment
  652. to a function.
  653. Dependencies: MS_FUNCS
  654. ------------------------------------------
  655. Function: INT( number )
  656. Description: INT returns the largest integer less than or equal to
  657. the argument 'number'. NOTE that this is not a "truncated"
  658. integer function, for which see CINT.
  659. Dependencies: (core)
  660. ------------------------------------------
  661. Command: KILL file-name$
  662. Description: KILL deletes the file specified by file-name$.
  663. Dependencies: UNIX_CMDS
  664. ------------------------------------------
  665. Function: LEFT$( string$, number-of-spaces )
  666. Description: LEFT$ returns a substring a string$ with number-of-spaces
  667. from the left (beginning) of the string). As implemented
  668. under bwBASIC, it cannot be used for assignment.
  669. Dependencies: MS_FUNCS
  670. ------------------------------------------
  671. Function: LEN( string$ )
  672. Description: LEN returns the length in bytes of string$.
  673. Dependencies: COMMON_FUNCS
  674. ------------------------------------------
  675. Command: LET variable = expression
  676. Description: LET assigns the value of 'expression' to the variable.
  677. As currently implemented, bwBASIC supports implied LET
  678. statements (e.g., "X = 4.5678" at the beginning of
  679. a line or line segment, but does not support assignment
  680. to multiple variables (e.g., "x, y, z = 3.141596").
  681. Dependencies: (core)
  682. ------------------------------------------
  683. Command: LINE INPUT [[#] device-number,]["prompt string";] string-variable$
  684. Description: LINE INPUT reads entire line from the keyboard or a file
  685. or device into string-variable$. If input is from the
  686. keyboard (stdin), then "prompt string" will be printed
  687. first. Unlike INPUT, LINE INPUT reads a whole line,
  688. not stopping for comma-delimited data items.
  689. Dependencies: COMMON_CMDS
  690. ------------------------------------------
  691. Command: LIST line[-line]
  692. Description: LIST lists program lines as specified in its argument.
  693. Dependencies: INTERACTIVE
  694. ------------------------------------------
  695. Command: LOAD file-name
  696. Description: LOAD loads an ASCII BASIC program into memory.
  697. Dependencies: INTERACTIVE
  698. ------------------------------------------
  699. Function: LOC( device-number )
  700. Description: LOC returns the next record that GET or PUT statements
  701. will use.
  702. Dependencies: MS_FUNCS
  703. ------------------------------------------
  704. Command: LOCATE line, column
  705. Description: LOCATE addresses trhe curor to a specified line and
  706. column. Currently (v2.10) implemented in bwx_iqc.c only.
  707. Dependencies: IMP_IQC and IMP_CMDLOC
  708. ------------------------------------------
  709. Function: LOF( device-number )
  710. Description: LOF returns the length of a file (specified by device-number)
  711. in bytes.
  712. Dependencies: MS_FUNCS
  713. ------------------------------------------
  714. Function: LOG( number )
  715. Description: LOG returns the natural logarithm of the argument 'number'.
  716. Dependencies: (core)
  717. ------------------------------------------
  718. Command: LOOP [UNTIL expression]
  719. Description: LOOP terminates a program loop: see DO.
  720. Dependencies: STRUCT_CMDS
  721. ------------------------------------------
  722. Command: LSET string-variable$ = expression
  723. Description: LSET transfers data from 'expression' to the left-hand
  724. side of a string variable or random access buffer field.
  725. Dependencies: COMMON_CMDS
  726. ------------------------------------------
  727. Command: MERGE file-name
  728. Description: MERGE adds program lines from 'file-name' to the program
  729. in memory. Unlike LOAD, it does not clear the program
  730. currently in memory.
  731. Dependencies: COMMON_CMDS
  732. ------------------------------------------
  733. Function: MID$( string$, start-position-in-string[, number-of-spaces ] )
  734. Description: MID$ returns a substring of string$ beginning at
  735. start-position-in-string and continuing for
  736. number-of-spaces bytes.
  737. Dependencies: MS_FUNCS
  738. ------------------------------------------
  739. Command: MKDIR pathname$
  740. Description: MKDIR creates a new directory path as specified by
  741. pathname$.
  742. Dependencies: UNIX_CMDS
  743. ------------------------------------------
  744. Function: MKD$( number )
  745. Description: MKD$, MKI$, and MKS$ are all equivalent in bwBASIC.
  746. They convert the numerical value 'number' into a string
  747. which can be stored in a more compressed form in a file
  748. (especially for random file access). Since bwBASIC does
  749. not recognize differences in precision, these commands
  750. are effectively equivalent.
  751. Dependencies: MS_FUNCS
  752. ------------------------------------------
  753. Function: MKI$( number )
  754. Description: Equivalent to MKD$ (q.v.)
  755. Dependencies: MS_FUNCS
  756. ------------------------------------------
  757. Function: MKS$( number )
  758. Description: Equivalent to MKD$ (q.v.).
  759. Dependencies: MS_FUNCS
  760. ------------------------------------------
  761. Command: NAME old-file-name AS new-file-name
  762. Description: NAME renames an existing file (old-file-name) as
  763. new-file-name.
  764. Dependencies: UNIX_CMDS
  765. ------------------------------------------
  766. Command: NEW
  767. Description: NEW deletes the program in memory and clears all
  768. variables.
  769. Dependencies: INTERACTIVE
  770. ------------------------------------------
  771. Command: NEXT [counter-variable]
  772. Description: NEXT comes at the end of a FOR-NEXT loop; see FOR.
  773. Dependencies: (core)
  774. ------------------------------------------
  775. Function: OCT$( number )
  776. Description: OCT$ returns a string giving the octal (base 8)
  777. representation of 'number'.
  778. Dependencies: MS_FUNCS
  779. ------------------------------------------
  780. Command: ON variable GOTO|GOSUB line[,line,line,...]
  781. Description: ON either branches (GOTO) or calls a subroutine
  782. (GOSUB) based on the rounded value of variable;
  783. if it is 1, the first line is called, if 2, the second
  784. line is called, etc.
  785. Dependencies: (core)
  786. ------------------------------------------
  787. Command: ON ERROR GOSUB line|label
  788. Description: ON ERROR sets up an error handling subroutine. See
  789. also ERROR.
  790. Dependencies: COMMON_CMDS, STRUCT_CMDS for labels
  791. ------------------------------------------
  792. Command: OPEN "O"|"I"|"R", [#]device-number, file-name [,record length]
  793. file-name FOR INPUT|OUTPUT|APPEND AS [#]device-number [LEN = record-length]
  794. Description: OPEN allocates random access memory for access to a disk
  795. file or other device. Note that two quite different forms
  796. of the OPEN statement are supported. In the first form,
  797. "O" (note that these letters must be encased in quotation
  798. marks) denotes sequential output, "I" denotes sequential
  799. input, and "R" denotes random-access input and output.
  800. Once OPEN, any number of operations can be performed
  801. on a device (see WRITE #, INPUT #, PRINT #, etc.).
  802. Dependencies: COMMON_CMDS
  803. ------------------------------------------
  804. Command: OPTION BASE number
  805. Description: OPTION BASE sets the lowest value for array subscripts,
  806. either 0 or 1.
  807. Dependencies: (core)
  808. ------------------------------------------
  809. Function: POS
  810. Description: POS returns the current cursor position in the line.
  811. Dependencies: COMMON_FUNCS
  812. ------------------------------------------
  813. Command: PRINT [# device-number,][USING format-string$;] expressions...
  814. Description: PRINT outputs text to the screen or to a file or device
  815. specified by device-number. In the current implementation
  816. of bwBASIC, expressions to be printed must be separated by
  817. the comma (tabbed output), the semicolon (immediate
  818. sequential output) or the plus sign (immediate sequential
  819. output by string concatenation). Expressions separated
  820. by blanks or tabs are not supported. If USING is specified,
  821. a number of formatting marks may appear in the format
  822. string:
  823. ! prints the first character of a string
  824. \\ prints 2+x characters of a string, where x =
  825. the number of spaces between the backslashes
  826. & variable-length string field
  827. # represents a single digit in output format for
  828. a number
  829. . decimal point in a number
  830. + sign of a number (will output + or -)
  831. - trailing minus after a number
  832. ** fill leading spaces with asterisks
  833. $$ output dollar sign in front of a number
  834. ^^ output number in exponential format
  835. _ output next character literally
  836. As currently implemented, the exponential format
  837. will be that used by the C compiler.
  838. Dependencies: (core), COMMON_FUNCS for USING
  839. ------------------------------------------
  840. Command: PUT [#] device-number [, record-number]
  841. Description: PUT outputs the next available record or the record
  842. specified by record-number to the file or device
  843. denoted by device-number.
  844. Dependencies: COMMON_CMDS
  845. ------------------------------------------
  846. Command: QUIT
  847. Description: QUIT is a synonym for SYSTEM; with INTERACTIVE
  848. environment, it exits the program to the
  849. operating system (or the calling program).
  850. Dependencies: INTERACTIVE
  851. ------------------------------------------
  852. Command: RANDOMIZE number
  853. Description: RANDOMIZE seeds the random number generator (see RND).
  854. Under bwBASIC, the TIMER function (q.v.) can be used
  855. to supply a 'number' seed for the random number
  856. generator.
  857. Dependencies: (core)
  858. ------------------------------------------
  859. Command: READ variable[, variable]...
  860. Description: READ reads values from DATA statements and assigns these
  861. values to the named variables. Variable types in a READ
  862. statement must match the data types in DATA statements
  863. as they are occurred. See also DATA and RESTORE.
  864. Dependencies: (core)
  865. ------------------------------------------
  866. Command: REM string
  867. Description: REM allows remarks to be included in a program. As
  868. currently implemented, the entire line following
  869. REM is ignored by the interpreter (thus, even if
  870. MULTISEG_LINES is set, a REM line will not be able
  871. to find a segment delimiter (":") followed by another
  872. line segment with command. bwBASIC does not currently
  873. implement the Microsoft-style use of the single quotation
  874. mark to denote remarks.
  875. Dependencies: (core)
  876. ------------------------------------------
  877. Command: RESTORE line
  878. Description: RESTORE resets the line and position counters for DATA
  879. and READ statements to the top of the program file or
  880. to the beginning of the specified line. (Currently this
  881. must be a line number.)
  882. Dependencies: (core)
  883. ------------------------------------------
  884. Command: RETURN
  885. Description: RETURN concludes a subroutine called by GOSUB.
  886. Dependencies: (core)
  887. ------------------------------------------
  888. Function: RIGHT$( string$, number-of-spaces )
  889. Description: RIGHT$ returns a substring a string$ with number-of-spaces
  890. from the right (end) of the string). As implemented
  891. under bwBASIC, it cannot be used for assignment.
  892. Dependencies: MS_FUNCS
  893. ------------------------------------------
  894. Command: RMDIR pathname
  895. Description: RMDIR deletes the directory path indicated by pathname.
  896. Dependencies: UNIX_CMDS
  897. ------------------------------------------
  898. Function: RND( number )
  899. Description: RND returns a pseudo-random number. The 'number' value
  900. is ignored by bwBASIC if supplied. The RANDOMIZE
  901. command (q.v.) reseeds the random-number generator.
  902. Dependencies: (core)
  903. ------------------------------------------
  904. Command: RSET string-variable$ = expression
  905. Description: RSET transfers data from 'expression' to the right-hand
  906. side of a string variable or random access buffer field.
  907. Dependencies: COMMON_CMDS
  908. ------------------------------------------
  909. Command: RUN [line][file-name$]
  910. Description: RUN executes the program in memory. If a file-name$ is
  911. supplied, then the specified file is loaded into memory
  912. and executed. If a line number is supplied, then execution
  913. begins at that line.
  914. Dependencies: INTERACTIVE
  915. ------------------------------------------
  916. Command: SAVE file-name$
  917. Description: SAVE saves the program in memory to file-name$. bwBASIC
  918. only saves files in ASCII format.
  919. Dependencies: INTERACTIVE
  920. ------------------------------------------
  921. Command: SELECT CASE expression
  922. Description: SELECT CASE introduces a multi-line conditional selection
  923. statement. The expression given as the argument to SELECT
  924. CASE will be evaluated by CASE statements following. The
  925. SELECT CASE statement conclludes with an END SELECT
  926. statement.
  927. As currently implemented, CASE statements may be followed
  928. by string values, but in this case only simple comparisons
  929. (equals, not equals) can be performed.
  930. Dependencies: STRUCT_CMDS
  931. ------------------------------------------
  932. Function: SGN( number )
  933. Description: SGN returns the sign of the argument 'number', +1
  934. for positive numbers, 0 for 0, and -1 for negative numbers.
  935. Dependencies: (core)
  936. ------------------------------------------
  937. Function: SIN( number )
  938. Description: SIN returns the sine of the argument 'number'
  939. in radians.
  940. Dependencies: (core)
  941. ------------------------------------------
  942. Function: SPACE$( number )
  943. Description: SPACE$ returns a string of blank spaces 'number'
  944. bytes long.
  945. Dependencies: MS_FUNCS
  946. ------------------------------------------
  947. Function: SPC( number )
  948. Description: SPC returns a string of blank spaces 'number'
  949. bytes long.
  950. Dependencies: MS_FUNCS
  951. ------------------------------------------
  952. Function: SQR( number )
  953. Description: SQR returns the square root of the argument 'number'.
  954. Dependencies: (core)
  955. ------------------------------------------
  956. Command: STOP
  957. Description: STOP interrupts program execution. As implemented under
  958. bwBASIC, STOP issues a SIGINT signal.
  959. Dependencies: (core)
  960. ------------------------------------------
  961. Function: STR$( number )
  962. Description: STR$ returns a string giving the decimal (base 10)
  963. representation of the argument 'number'.
  964. Dependencies: COMMON_FUNCS
  965. ------------------------------------------
  966. Function: STRING$( number, ascii-value|string$ )
  967. Description: STRING$ returns a string 'number' bytes long consisting
  968. of either the first character of string$ or the character
  969. answering to the ASCII value ascii-value.
  970. Dependencies: MS_FUNCS
  971. ------------------------------------------
  972. Command: SUB subroutine-name
  973. Description: SUB introduces a named, multi-line subroutine. The
  974. subroutine is called by a CALL statement, and concludes
  975. with an END SUB statement.
  976. Dependencies: STRUCT_CMDS
  977. ------------------------------------------
  978. Command: SWAP variable, variable
  979. Description: SWAP swaps the values of two variables. The two variables
  980. must be of the same type (either numerical or string).
  981. Dependencies: COMMON_CMDS
  982. ------------------------------------------
  983. Command: SYSTEM
  984. Description: SYSTEM exits from bwBASIC to the calling program or
  985. (more usually) the operating system.
  986. Dependencies: INTERACTIVE
  987. ------------------------------------------
  988. Function: TAB( number )
  989. Description: TAB outputs spaces until the column indicated by
  990. 'number' has been reached.
  991. Dependencies: (core)
  992. ------------------------------------------
  993. Function: TAN( number )
  994. Description: TAN returns the tangent of the argument 'number'
  995. in radians.
  996. Dependencies: (core)
  997. ------------------------------------------
  998. Function: TIME$
  999. Description: TIME$ returns the current time based on the computer's
  1000. internal clock as a string in the form "HH-MM-SS".
  1001. As implemented under bwBASIC, TIME$ cannot be used for
  1002. assignment (i.e., to set the system time).
  1003. Note: bwBASIC presently (v2.10) does not allow assignment
  1004. to a function.
  1005. Dependencies: COMMON_FUNCS
  1006. ------------------------------------------
  1007. Function: TIMER
  1008. Description: TIMER returns the time in the system clock in seconds
  1009. elapsed since midnight.
  1010. Dependencies: MS_FUNCS
  1011. ------------------------------------------
  1012. Command: TROFF
  1013. Description: TROFF turns of the trace facility; see TRON.
  1014. Dependencies: COMMON_CMDS
  1015. ------------------------------------------
  1016. Command: TRON
  1017. Description: TRON turns on the trace facility. This facility will print
  1018. each line number in square brackets as the program is
  1019. executed. This is useful in debugging programs with
  1020. line numbers. To debug an unnumbered program with
  1021. TRON, call DO NUM first, but remember to call DO UNNUM
  1022. before you save the program later.
  1023. Dependencies: COMMON_CMDS
  1024. ------------------------------------------
  1025. Function: VAL( string$ )
  1026. Description: VAL returns the numerical value of the string$.
  1027. Dependencies: COMMON_FUNCS
  1028. ------------------------------------------
  1029. Command: VARS
  1030. Description: VARS is a debugging command which prints a list of
  1031. all variables defined which have global scope.
  1032. Dependencies: DEBUG
  1033. ------------------------------------------
  1034. Command: WEND
  1035. Description: WEND concludes a WHILE-WEND loop; see WHILE.
  1036. Dependencies: COMMON_CMDS
  1037. ------------------------------------------
  1038. Command: WHILE expression
  1039. Description: WHILE initiates a WHILE-WEND loop. The loop ends with
  1040. WEND, and execution reiterates through the loop as
  1041. long as the 'expression' is TRUE (-1).
  1042. Dependencies: COMMON_CMDS
  1043. ------------------------------------------
  1044. Command: WIDTH [# device-number,] number
  1045. Description: WIDTH sets screen or device output to 'number'
  1046. columns. device-number specifies the device
  1047. or file for oputput.
  1048. Dependencies: COMMON_CMDS
  1049. ------------------------------------------
  1050. Command: WRITE [# device-number,] element [, element ]....
  1051. Description: WRITE outputs variables to the screen or to a file
  1052. or device specified by device-number. Commas
  1053. are inserted between expressions output, and strings
  1054. are enclosed in quotation marks.
  1055. Dependencies: COMMON_CMDS
  1056. ------------------------------------------
  1057. 6. PREDEFINED VARIABLES
  1058. BWB.EDITOR$
  1059. BWB.FILES$
  1060. BWB.PROMPT$
  1061. BWB.IMPLEMENTATION$
  1062. The commands EDIT and FILES are pseudo-commands that launch
  1063. shell programs named in the variables BWB.EDITOR$ and BWB.FILES$,
  1064. respectively. The default values for these variables can
  1065. be changed in bwbasic.h (DEF_EDITOR and DEF_FILES), or they
  1066. can be changed on the fly by the user. An idea might be to
  1067. initialize these variables in "profile.bas" for specific
  1068. implementations; for instance, BWB.FILES$ might be defined as
  1069. "ls -l" on Unix systems or "dir" on DOS systems.
  1070. The preset variable BWB.PROMPT$ can be used to set the prompt
  1071. string for bwBASIC. Again, it is suggested that a user-
  1072. selected promptcan be set up in a "profile.bas" to be
  1073. initialized each time bwBASIC starts. Note that special
  1074. characters can be added to the prompt string, e.g.,
  1075. BWB.PROMPT$ = "Ok"+CHR$(10)
  1076. will give an "Ok" prompt followed by a linefeed.
  1077. The preset variable BWB.IMPLEMENTATION$ will return "TTY" for
  1078. the bwx_tty implementation and will return "IQC" for the
  1079. IBM PC or Compatibles with QuickC (bwx_iqc) implementation.
  1080. This may be useful in determing which commands and functions
  1081. (specifically CLS, LOCATE, and INKEY$) may be available.
  1082. 7. UNIMPLEMENTED COMMANDS AND FUNCTIONS, and AGENDA FOR DEVELOPMENT
  1083. There are some items not implemented that have been so long
  1084. a part of standard BASICs that their absence will seem surprising.
  1085. In each case, though, their implementation would require opera-
  1086. ting-system-specific functions or terminal-specific functions
  1087. that cannot be universally provided. Some specific examples:
  1088. CLOAD Relies on CP/M or MSDOS conventions for binary
  1089. executable files.
  1090. CONT See RESUME below (programmer ignorance?).
  1091. DEF USR Relies on CP/M or MSDOS conventions for binary
  1092. executable files.
  1093. FRE() The ability to report the amount of free memory
  1094. remaining is system-specific due to varying patterns
  1095. of memory allocation and access; consequently this
  1096. ability is not present in ANSI or earlier versions
  1097. of C and this function is not available in bwBASIC.
  1098. INPUT$() C by itself is not able to read unechoed keyboard
  1099. input, and can read keyboard input only after a
  1100. Carriage-Return has been entered.
  1101. INP Calls to hardware ports, like machine-language
  1102. routines, are highly system-specific and cannot
  1103. be implemented in C alone.
  1104. LLIST See LPRINT below.
  1105. LPOS See LPRINT below.
  1106. LPRINT and LLIST, etc., require access to a printer device,
  1107. and this varies from one system to another. Users
  1108. might try OPENing the printer device on their own
  1109. operating system (e.g., "/dev/lp" on Unix systems,
  1110. or "PRN" under DOS) and see if printing can be done
  1111. from bwBASIC in this way.
  1112. NULL In this case, I am convinced that NULL is no longer
  1113. necessary, since very few printers now require NULLs
  1114. at the end of lines.
  1115. OUT See INP above (calls to hardware ports).
  1116. PEEK() PEEK and POKE enabled earlier BASICs to address
  1117. particular memory locations. Although bwBASIC
  1118. could possibly implement this command (POKE) and
  1119. this function (PEEK()), the limitation would be
  1120. highly limited by the different systems for
  1121. memory access in different systems.
  1122. POKE see PEEK() above.
  1123. RENUM Since unnumbered lines can be entered and
  1124. executed under bwBASIC, it would not be
  1125. possible to implement a RENUM routine.
  1126. Instead, bwBASIC uses DO NUM and DO UNNUM.
  1127. RESUME Is this possible under C? If so, I
  1128. simply have failed to figure it out yet.
  1129. Mea culpa (but not maxima).
  1130. USR See CALL and DEF USR above (machine language
  1131. subroutines).
  1132. VARPTR See PEEK and POKE above.
  1133. WAIT See INP and OUT above.
  1134. There are other commands, functions, and implementation details
  1135. that I am working on, and which are on the agenda list for future
  1136. versions of bwBASIC. These agenda include:
  1137. PARACT i.e., the ability to execute PARallel ACTions. This
  1138. is described in ANSI BASIC, although I have not seen it
  1139. implemented before. It will offer a rough, non-
  1140. preemptive form of multitasking within the scope
  1141. of a BASIC program. Programmers will note points at which
  1142. there are already hooks for PARACT in bwBASIC.
  1143. XMEM PC-type computers need to be able to use extended
  1144. memory. If we could use extended memory for program
  1145. lines, variables, and function defitions, we could
  1146. write much longer programs. This would entail,
  1147. however, a fairly serious rewriting of the program
  1148. to utilize memory handles for these storage features
  1149. instead of direct memory pointers.
  1150. Windows The addition of memory handles in addition to the
  1151. non-preemptive execution of program lines (in a
  1152. crude form, already present) will make it possible
  1153. to develop implementations for Windows and perhaps
  1154. for other graphical user interfaces. But what form
  1155. should this take? I have in mind presently a BASIC
  1156. that would run in the background, appearing only
  1157. as an icon in the GUI space, with pop-up editors
  1158. and output windows. Thus, the interpreted language
  1159. would serve a purpose something like 'cron' (a task
  1160. scheduler) under Unix systems. You may have some
  1161. reflections that would help me in this.
  1162. Graphics Here we face fairly critical differences in different
  1163. styles and implementations of graphics, e.g., between
  1164. GWBASIC, ANSI BASIC, VisualBASIC, etc. But it's
  1165. possible that Graphics commands and functions could
  1166. be added. These would all be implementation-specific.
  1167. The ANSI Standard for full BASIC does not specify which particular
  1168. commands or functions must be implemented, and in fact the standard
  1169. is very robust. Perhaps no implementation of BASIC would ever
  1170. include all of the items, but some ANSI commands and functions which
  1171. remain unimplemented are:
  1172. ACCESS
  1173. ANGLE
  1174. AREA
  1175. ARITHMETIC
  1176. ARRAY
  1177. ASK
  1178. BSTR
  1179. BVAL
  1180. CEIL
  1181. CELLS
  1182. CLIP
  1183. COLLATE
  1184. CONNECT
  1185. COSH
  1186. DATUM
  1187. DEBUG
  1188. DECIMAL
  1189. DECLARE
  1190. DEGREES
  1191. DEVICE
  1192. DISCONNECT
  1193. DISPLAY
  1194. DOT
  1195. DRAW
  1196. ERASE
  1197. EVENT
  1198. EXCEPTION
  1199. GRAPH
  1200. HANDLER
  1201. IMAGE
  1202. KEY
  1203. LCASE
  1204. LINES
  1205. LOG10
  1206. LOG2
  1207. MAT
  1208. MIX
  1209. MULTIPOINT
  1210. OUTIN
  1211. OUTPUT
  1212. PARACT
  1213. PICTURE
  1214. PIXEL
  1215. PLOT
  1216. POINTS
  1217. RADIANS
  1218. RECEIVE
  1219. RENUMBER
  1220. REWRITE
  1221. ROTATE
  1222. ROUND
  1223. SEIZE
  1224. SEND
  1225. SHIFT
  1226. SINH
  1227. TANH
  1228. TIMEOUT
  1229. TRACE
  1230. TRANSFORM
  1231. TRUNCATE
  1232. UBOUND
  1233. UCASE
  1234. VIEWPORT
  1235. WAIT
  1236. VIEWPORT
  1237. ZONEWIDTH
  1238. 8. THE STORY OF BYWATER BASIC
  1239. This program was originally begun in 1982 by my grandmother, Mrs.
  1240. Verda Spell of Beaumont, TX. She was writing the program using
  1241. an ANSI C compiler on an Osborne I CP/M computer and although my
  1242. grandfather (Lockwood Spell) had bought an IBM PC with 256k of
  1243. RAM my grandmother would not use it, paraphrasing George Herbert
  1244. to the effect that "He who cannot in 64k program, cannot in 512k."
  1245. She had used Microsoft BASIC and although she had nothing against
  1246. it she said repeatedly that she didn't understand why Digital
  1247. Research didn't "sue the socks off of Microsoft" for version 1.0
  1248. of MSDOS and so I reckon that she hoped to undercut Microsoft's
  1249. entire market and eventually build a new software empire on
  1250. the North End of Beaumont. Her programming efforts were cut
  1251. tragically short when she was thrown from a Beaumont to Port
  1252. Arthur commuter train in the summer of 1986. I found the source
  1253. code to bwBASIC on a single-density Osborne diskette in her knitting
  1254. bag and eventually managed to have it all copied over to a PC
  1255. diskette. I have revised it slightly prior to this release. You
  1256. should know, though, that I myself am an historian, not a programmer.
  1257. 9. COMMUNICATIONS:
  1258. email: tcamp@delphi.com