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.
 
 
 
 
 
 

1873 lines
68 KiB

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