home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / bwbasic / part01 < prev    next >
Encoding:
Text File  |  1993-10-29  |  74.6 KB  |  2,312 lines

  1. Newsgroups: comp.sources.misc
  2. From: tcamp@delphi.com (Ted A. Campbell)
  3. Subject: v40i052:  bwbasic - Bywater BASIC interpreter version 2.10, Part01/15
  4. Message-ID: <csm-v40i052=bwbasic.112142@sparky.Sterling.COM>
  5. X-Md4-Signature: 1ad90d355a4a15c007f2afe7e2595499
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Fri, 29 Oct 1993 16:22:50 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: tcamp@delphi.com (Ted A. Campbell)
  12. Posting-number: Volume 40, Issue 52
  13. Archive-name: bwbasic/part01
  14. Environment: UNIX, DOS
  15. Supersedes: bwbasic: Volume 33, Issue 37-47
  16.  
  17.                         Bywater Software Announces
  18.  
  19.                Bywater BASIC Interpreter/Shell, version 2.10
  20.                ---------------------------------------------
  21.  
  22.                     Copyright (c) 1993, Ted A. Campbell
  23.                   for bwBASIC version 2.10, 11 October 1993
  24.  
  25. DESCRIPTION:
  26.  
  27.    The Bywater BASIC Interpreter (bwBASIC) implements a large
  28.    superset of the ANSI Standard for Minimal BASIC (X3.60-1978)
  29.    and a significant subset of the ANSI Standard for Full BASIC
  30.    (X3.113-1987) in C. It also offers shell programming facilities
  31.    as an extension of BASIC. bwBASIC seeks to be as portable
  32.    as possible.
  33.  
  34.    This version of Bywater BASIC is released under the terms of the 
  35.    GNU General Public License (GPL), which is distributed with this 
  36.    software in the file "COPYING".  The GPL specifies the terms 
  37.    under which users may copy and use the software in this distribution.
  38.  
  39.    A separate license is available for commercial distribution,
  40.    for information on which you should contact the author.
  41.  
  42. IMPROVEMENTS OVER PREVIOUS VERSION (1.11):
  43.  
  44.    * now compilable on "stock" (older K&R specification) C compilers; 
  45.  
  46.    * implements ANSI-BASIC-style structured programming, with
  47.      called subroutines, multi-line functions, multi-line IF-THEN
  48.      ELSE statements, SELECT CASE statements, etc.;
  49.  
  50.    * new enhancements to the interactive environment, such as DO NUM
  51.      and DO UNNUM to number or unnumber all program lines;
  52.  
  53.    * addition of some hardware-specific commands such as CLS, LOCATE,
  54.      and INKEY$ (at present for IBM PC and compatibles, using the
  55.      Microsoft QuickC compiler), opening the way for more hardware-
  56.      specific commands and functions in the future; 
  57.  
  58.    * general improvements to reliability and portability, including
  59.      more extensive testing than previous versions; 
  60.  
  61. COMMUNICATIONS:
  62.  
  63.    email:  tcamp@delphi.com
  64.  
  65. A LIST OF BASIC COMMANDS AND FUNCTIONS IMPLEMENTED in bwBASIC 2.10:
  66.  
  67.    Be aware that many of these commands and functions will not be
  68.    available unless you have set certain flags in the header files.
  69.  
  70.    ABS( number )
  71.    ASC( string$ )
  72.    ATN( number )
  73.    CALL subroutine-name
  74.    CASE constant | IF partial-expression | ELSE
  75.    CHAIN file-name
  76.    CHDIR pathname
  77.    CHR$( number )
  78.    CINT( number )
  79.    CLEAR
  80.    CLOSE [[#]file-number]...
  81.    CLS
  82.    COMMON variable [, variable...]
  83.    COS( number )
  84.    CSNG( number )
  85.    CVD( string$ )
  86.    CVI( string$ )
  87.    CVS( string$ )
  88.    DATA constant[,constant]...
  89.    DATE$
  90.    DEF FNname(arg...)] = expression
  91.    DEFDBL letter[-letter](, letter[-letter])...
  92.    DEFINT letter[-letter](, letter[-letter])...
  93.    DEFSNG letter[-letter](, letter[-letter])...
  94.    DEFSTR letter[-letter](, letter[-letter])...
  95.    DELETE line[-line]
  96.    DIM variable(elements...)[variable(elements...)]...
  97.    DO NUM|UNNUM
  98.    DO [WHILE expression]
  99.    EDIT        (* depends on variable BWB.EDITOR$)
  100.    ELSE
  101.    ELSEIF
  102.    END FUNCTION | IF | SELECT | SUB
  103.    ENVIRON variable-string$ = string$
  104.    ENVIRON$( variable-string )
  105.    EOF( device-number )
  106.    ERASE variable[, variable]...
  107.    ERL
  108.    ERR
  109.    ERROR number
  110.    EXIT FOR|DO
  111.    EXP( number )
  112.    FIELD [#] device-number, number AS string-variable [, number AS string-variable...]
  113.    FILES filespec$    (* depends on variable BWB.FILES$)
  114.    FOR counter = start TO finish [STEP increment]
  115.    FUNCTION function-definition
  116.    GET [#] device-number [, record-number]
  117.    GOSUB line | label
  118.    GOTO line | label
  119.    HEX$( number )
  120.    IF expression THEN [statement [ELSE statement]]
  121.    INKEY$
  122.    INPUT [# device-number]|[;]["prompt string";]list of variables
  123.    INSTR( [start-position,] string-searched$, string-pattern$ )
  124.    INT( number )
  125.    KILL file-name
  126.    LEFT$( string$, number-of-spaces )
  127.    LEN( string$ )
  128.    LET variable = expression
  129.    LINE INPUT [[#] device-number,]["prompt string";] string-variable$
  130.    LIST line[-line]
  131.    LOAD file-name
  132.    LOC( device-number )
  133.    LOCATE
  134.    LOF( device-number )
  135.    LOG( number )
  136.    LOOP [UNTIL expression]
  137.    LSET string-variable$ = expression
  138.    MERGE file-name
  139.    MID$( string$, start-position-in-string[, number-of-spaces ] )
  140.    MKD$( number )
  141.    MKDIR pathname
  142.    MKI$( number )
  143.    MKS$( number )
  144.    NAME old-file-name AS new-file-name
  145.    NEW
  146.    NEXT counter
  147.    OCT$( number )
  148.    ON variable GOTO|GOSUB line[,line,line,...]
  149.    ON ERROR GOSUB line | label
  150.    OPEN O|I|R, [#]device-number, file-name [,record length]
  151.         file-name FOR INPUT|OUTPUT|APPEND AS [#]device-number [LEN = record-length]
  152.    OPTION BASE number
  153.    POS
  154.    PRINT [# device-number,][USING format-string$;] expressions...
  155.    PUT [#] device-number [, record-number]
  156.    RANDOMIZE number
  157.    READ variable[, variable]...
  158.    REM string
  159.    RESTORE line
  160.    RETURN
  161.    RIGHT$( string$, number-of-spaces )
  162.    RMDIR pathname
  163.    RND( number )
  164.    RSET string-variable$ = expression
  165.    RUN [line]|[file-name]
  166.    SAVE file-name
  167.    SELECT CASE expression
  168.    SGN( number )
  169.    SIN( number )
  170.    SPACE$( number )
  171.    SPC( number )
  172.    SQR( number )
  173.    STOP
  174.    STR$( number )
  175.    STRING$( number, ascii-value|string$ )
  176.    SUB subroutine-name
  177.    SWAP variable, variable
  178.    SYSTEM
  179.    TAB( number )
  180.    TAN( number )
  181.    TIME$
  182.    TIMER
  183.    TROFF
  184.    TRON
  185.    VAL( string$ )
  186.    WEND
  187.    WHILE expression
  188.    WIDTH [# device-number,] number
  189.    WRITE [# device-number,] element [, element ]....
  190. -----
  191. #! /bin/sh
  192. # This is a shell archive.  Remove anything before this line, then feed it
  193. # into a shell via "sh file" or similar.  To overwrite existing files,
  194. # type "sh file -c".
  195. # Contents:  bwbasic-2.10 bwbasic-2.10/INSTALL bwbasic-2.10/bwbasic.doc
  196. #   bwbasic-2.10/bwbtest bwbasic-2.10/bwbtest/dataread.bas
  197. # Wrapped by kent@sparky on Thu Oct 21 10:47:47 1993
  198. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  199. echo If this archive is complete, you will see the following message:
  200. echo '          "shar: End of archive 1 (of 15)."'
  201. if test ! -d 'bwbasic-2.10' ; then
  202.     echo shar: Creating directory \"'bwbasic-2.10'\"
  203.     mkdir 'bwbasic-2.10'
  204. fi
  205. if test -f 'bwbasic-2.10/INSTALL' -a "${1}" != "-c" ; then 
  206.   echo shar: Will not clobber existing file \"'bwbasic-2.10/INSTALL'\"
  207. else
  208.   echo shar: Extracting \"'bwbasic-2.10/INSTALL'\" \(6264 characters\)
  209.   sed "s/^X//" >'bwbasic-2.10/INSTALL' <<'END_OF_FILE'
  210. XSome Notes on Installation of the Bywater BASIC Interpreter:
  211. X-----------------------------------------------------------
  212. X
  213. X0. Quick-Start Guide For Compiling
  214. X
  215. X   To use the default configuration (which is reasonable for most situations):
  216. X
  217. X   On Unix, type "configure; make".
  218. X   On MS-DOS using QuickC, type "nmake -f makefile.qcl".
  219. X
  220. X   You can skip the rest of this file unless you want to customize the
  221. X   BASIC dialect that is supported, or something goes wrong in the
  222. X   above commands.
  223. X
  224. X1. Compiler Requirements
  225. X
  226. X   Although earlier versions of bwBASIC would compile only with
  227. X   ANSI C compilers, versions 2.10 and higher can be compiled
  228. X   with "stock" C compilers, i.e., compilers that comply with
  229. X   the older Kernighan and Ritchie C standard.
  230. X
  231. X   Section I-B of bwbasic.h allows you to specify some compiler
  232. X   features.  If you have an ANSI C compiler, you needn't worry
  233. X   with this.  For stock C compilers, the default configuration
  234. X   presumes that your compiler supports signal() and raise()
  235. X   with the signal.h header, supports setjmp() and longjmp()
  236. X   with the setjmp.h header, and has a separate string.h
  237. X   header.  If your compiler does not have these features
  238. X   and the related header files, you can indicate this in
  239. X   section I-B by setting appropriate flags to FALSE.
  240. X
  241. X   
  242. X2. Configuration of header files
  243. X
  244. X   You may need to examine file "bwbasic.h" to make important
  245. X   changes for specific hardware and compiler configurations.
  246. X   You may also need to change "bwx_tty.h" if you are using the
  247. X   TTY implementation or "bwx_iqc.h" if you are using the version
  248. X   for PCs with Microsoft QuickC (see below on "implementations").
  249. X   If you want to redefine messages or even the BASIC command
  250. X   names, you will need to edit "bwb_mes.h".
  251. X
  252. X
  253. X3. Makefiles
  254. X
  255. X   Several makefiles are provided: "makefile.qcl" will compile
  256. X   the program utilizing the Microsoft QuickC (tm) line-oriented
  257. X   compiler on DOS-based p.c.'s, and "makefile" will compile the
  258. X   program on Unix-based computers utilizing either a stock C 
  259. X   compiler or Gnu C++. I have also compiled the program utilizing 
  260. X   Borland's Turbo C++ (tm) on DOS-based machines, although I have 
  261. X   not supplied a makefile for Turbo C++.
  262. X
  263. X   If you try the "IQC" implementation, you will need to alter
  264. X   makefile.qcl to include bwx_iqc.c (and bqx_iqc.obj) instead
  265. X   of bwx_tty.*.
  266. X
  267. X   
  268. X4. Implementations
  269. X
  270. X   The present status of bwBASIC allows two major implementations
  271. X   controlled by the IMP_TTY and IMP_IQC flags in bwbasic.h.
  272. X   IMP_TTY is the base implementation and presumes a simple
  273. X   TTY-style environment, with all keyboard and screen input
  274. X   and output directed through stdin and stdout. If IMP_TTY is
  275. X   defined as TRUE, then the file bwx_tty.h will be included,
  276. X   and a makefile should include compilation of bwx_tty.c.
  277. X   IMP_IQC is a somewhat more elaborate implementation for
  278. X   the IBM PC and compatible microcomputers utilizing the
  279. X   Microsoft QuickC compiler.  This allows some more elaborate
  280. X   commands (CLS and LOCATE) and the INKEY$ function, and
  281. X   allows greater control over output.  If IMP_IQC is defined
  282. X   as TRUE in bwbasic.h, then bwx_iqc.h will be included and
  283. X   bwx_iqc.c should be compiled in the makefile.
  284. X
  285. X   Only one of the flags IMP_TTY or IMP_IQC should be set
  286. X   to TRUE.
  287. X
  288. X   
  289. X5. Flags Controlling Groups of Commands and Functions 
  290. X
  291. X   There are a number of flags which control groups of commands
  292. X   and functions to be implemented.  
  293. X
  294. X   (core)        Commands and Functions in any implementation of
  295. X               bwBASIC; these are the ANSI Minimal BASIC core
  296. X
  297. X   INTERACTIVE        Commands supporting the interactive programming
  298. X               environment
  299. X
  300. X   COMMON_CMDS        Commands beyond ANSI Minimal BASIC which are common
  301. X               to Full ANSI BASIC and Microsoft BASICs
  302. X
  303. X   COMMON_FUNCS        Functions beyond the ANSI Mimimal BASIC core, but
  304. X               common to both ANSI Full BASIC and Microsoft-style
  305. X               BASIC varieties
  306. X
  307. X   UNIX_CMDS        Commands which require Unix-style directory and
  308. X               environment routines not specified in ANSI C
  309. X
  310. X   STRUCT_CMDS        Commands related to structured programming; all
  311. X               of these are part of the Full ANSI BASIC standard
  312. X
  313. X   ANSI_FUNCS        Functions unique to ANSI Full BASIC
  314. X
  315. X   MS_CMDS        Commands unique to Microsoft BASICs
  316. X
  317. X   MS_FUNCS        Functions unique to Microsoft BASICs
  318. X
  319. X
  320. X6. Configurations
  321. X
  322. X   The file bwbasic.h includes a number of configuration options
  323. X   that will automatically select groups of commands and functions
  324. X   according to predetermined patterns.  These are:
  325. X
  326. X   CFG_ANSIMINIMAL    Conforms to ANSI Minimal BASIC standard X3.60-1978.
  327. X
  328. X   CFG_COMMON          Small implementation with commands and functions
  329. X                        common to GWBASIC (tm) and ANSI full BASIC.
  330. X
  331. X   CFG_MSTYPE          Configuration similar to Microsoft line-oriented
  332. X                        BASICs.
  333. X
  334. X   CFG_ANSIFULL        Conforms to ANSI Full BASIC standard X3.113-1987
  335. X                        (subset at present).
  336. X
  337. X   CFG_CUSTOM        Custom Configuration specified by user.
  338. X
  339. X   Only one of these flags should be set to TRUE.
  340. X
  341. X
  342. X7. Adding Commands and Functions
  343. X
  344. X   In order to add a new command to bwBASIC, follow the following
  345. X   procedure:
  346. X
  347. X      (a) Write the command body using function bwb_null() in bwb_cmd.c
  348. X      as a template.  The command-body function (in C) must receive a
  349. X      pointer to a bwb_line structure, and must pass on a pointer to
  350. X      a bwb_line structure.  The preferred method for returning from
  351. X      a command-body function is: return bwb_zline( l ); this will
  352. X      discriminate between MULTISEG_LINES programs which advance to
  353. X      the next segment and those which advance to the next line.
  354. X
  355. X      (b) Add prototypes for the command-body function in bwbasic.h;
  356. X      you'll need one prototype with arguments in the ANSI_C section
  357. X      and one prototype without arguments in the non-ANSI_C section.
  358. X
  359. X      (c) Add the command to the command table in bwb_tbl.c in the
  360. X      group you have selected for it.
  361. X
  362. X      (d) Increment the number of commands for the group in which
  363. X      you have placed your command.  
  364. X
  365. X   The procedure for adding a new function is parallel to this, except that
  366. X   you should use fnc_null() in bwb_fnc.c as the template, and the
  367. X   function name must be added to the function table in bwb_tbl.c. 
  368. END_OF_FILE
  369.   if test 6264 -ne `wc -c <'bwbasic-2.10/INSTALL'`; then
  370.     echo shar: \"'bwbasic-2.10/INSTALL'\" unpacked with wrong size!
  371.   fi
  372.   # end of 'bwbasic-2.10/INSTALL'
  373. fi
  374. if test -f 'bwbasic-2.10/bwbasic.doc' -a "${1}" != "-c" ; then 
  375.   echo shar: Will not clobber existing file \"'bwbasic-2.10/bwbasic.doc'\"
  376. else
  377.   echo shar: Extracting \"'bwbasic-2.10/bwbasic.doc'\" \(58924 characters\)
  378.   sed "s/^X//" >'bwbasic-2.10/bwbasic.doc' <<'END_OF_FILE'
  379. X
  380. X
  381. X
  382. X
  383. X               Bywater BASIC Interpreter/Shell, version 2.10
  384. X               ---------------------------------------------
  385. X
  386. X                    Copyright (c) 1993, Ted A. Campbell
  387. X                  for bwBASIC version 2.10, 11 October 1993
  388. X
  389. X
  390. XCONTENTS:
  391. X
  392. X   1. DESCRIPTION
  393. X   2. TERMS OF USE
  394. X   3. QUICK REFERENCE LIST OF COMMANDS AND FUNCTIONS
  395. X   4. GENERAL NOTES ON USAGE
  396. X   5. EXPANDED REFERENCE FOR COMMANDS AND FUNCTIONS
  397. X   6. PREDEFINED VARIABLES
  398. X   7. UNIMPLEMENTED COMMANDS AND FUNCTIONS
  399. X      and AGENDA FOR DEVELOPMENT
  400. X   8. THE STORY OF BYWATER BASIC
  401. X   9. COMMUNICATIONS
  402. X
  403. X   The author wishes to express his thanks to Mr. David MacKenzie, 
  404. X   who assisted in the development Unix installation and configuration
  405. X   for this version.
  406. X
  407. X
  408. X1. DESCRIPTION
  409. X
  410. X   The Bywater BASIC Interpreter (bwBASIC) implements a large
  411. X   superset of the ANSI Standard for Minimal BASIC (X3.60-1978)
  412. X   and a significant subset of the ANSI Standard for Full BASIC
  413. X   (X3.113-1987) in C. It also offers shell programming facilities
  414. X   as an extension of BASIC. bwBASIC seeks to be as portable
  415. X   as possible.
  416. X
  417. X   bwBASIC can be configured to emulate features, commands, and
  418. X   functions available on different types of BASIC interpreters;
  419. X   see the file INSTALL for further installation information.
  420. X
  421. X   The interpreter is fairly slow.  Whenever faced with a choice
  422. X   between conceptual clarity and speed, I have consistently chosen
  423. X   the former.  The interpreter is the simplest design available,
  424. X   and utilizes no system of intermediate code, which would speed
  425. X   up considerably its operation.  As it is, each line is interpreted
  426. X   afresh as the interpreter comes to it.
  427. X
  428. X   bwBASIC implements one feature not available in previous BASIC
  429. X   interpreters: a shell command can be entered interactively at the
  430. X   bwBASIC prompt, and the interpreter will execute it under a
  431. X   command shell.  For instance, the command "dir *.bas" can be
  432. X   entered in bwBASIC (under DOS, or "ls -l *.bas" under UNIX) and
  433. X   it will be executed as from the operating system command line.
  434. X   Shell commands can also be given on numbered lines in a bwBASIC
  435. X   program, so that bwBASIC can be used as a shell programming
  436. X   language. bwBASIC's implementation of the RMDIR, CHDIR, MKDIR,
  437. X   NAME, KILL, ENVIRON, and ENVIRON$() commands and functions
  438. X   offer further shell-processing capabilities.
  439. X
  440. X
  441. X2. TERMS OF USE:
  442. X
  443. X   This version of Bywater BASIC is released under the terms of the 
  444. X   GNU General Public License (GPL), which is distributed with this 
  445. X   software in the file "COPYING".  The GPL specifies the terms 
  446. X   under which users may copy and use the software in this distribution.
  447. X
  448. X   A separate license is available for commercial distribution,
  449. X   for information on which you should contact the author.
  450. X
  451. X
  452. X3. QUICK REFERENCE LIST OF COMMANDS AND FUNCTIONS
  453. X
  454. X   Be aware that many of these commands and functions will not be
  455. X   available unless you have set certain flags in the header files
  456. X   (see the expanded reference section below for dependencies).
  457. X
  458. X   ABS( number )
  459. X   ASC( string$ )
  460. X   ATN( number )
  461. X   CALL subroutine-name
  462. X   CASE ELSE | IF partial-expression | constant
  463. X   CHAIN [MERGE] file-name [, line-number] [, ALL]
  464. X   CHDIR pathname
  465. X   CHR$( number )
  466. X   CINT( number )
  467. X   CLEAR
  468. X   CLOSE [[#]file-number]...
  469. X   CLS
  470. X   COMMON variable [, variable...]
  471. X   COS( number )
  472. X   CSNG( number )
  473. X   CVD( string$ )
  474. X   CVI( string$ )
  475. X   CVS( string$ )
  476. X   DATA constant[,constant]...
  477. X   DATE$
  478. X   DEF FNname(arg...)] = expression
  479. X   DEFDBL letter[-letter](, letter[-letter])...
  480. X   DEFINT letter[-letter](, letter[-letter])...
  481. X   DEFSNG letter[-letter](, letter[-letter])...
  482. X   DEFSTR letter[-letter](, letter[-letter])...
  483. X   DELETE line[-line]
  484. X   DIM variable(elements...)[variable(elements...)]...
  485. X   DO NUM|UNNUM
  486. X   DO [WHILE expression]
  487. X   EDIT
  488. X   ELSE
  489. X   ELSEIF
  490. X   END IF | FUNCTION | SELECT | SUB
  491. X   ENVIRON variable-string = string
  492. X   ENVIRON$( variable-string )
  493. X   EOF( device-number )
  494. X   ERASE variable[, variable]...
  495. X   ERL
  496. X   ERR
  497. X   ERROR number
  498. X   EXP( number )
  499. X   FIELD [#] device-number, number AS string-variable [, number AS string-variable...]
  500. X   FILES filespec$
  501. X   FUNCTION
  502. X   FOR counter = start TO finish [STEP increment]
  503. X   GET [#] device-number [, record-number]
  504. X   GOSUB line | label
  505. X   GOTO line | label
  506. X   HEX$( number )
  507. X   IF expression THEN [statement [ELSE statement]]
  508. X   INKEY$
  509. X   INPUT [# device-number]|[;]["prompt string";]list of variables
  510. X   INSTR( [start-position,] string-searched$, string-pattern$ )
  511. X   INT( number )
  512. X   KILL file-name
  513. X   LEFT$( string$, number-of-spaces )
  514. X   LEN( string$ )
  515. X   LET variable = expression
  516. X   LINE INPUT [[#] device-number,]["prompt string";] string-variable$
  517. X   LIST line[-line]
  518. X   LOAD file-name
  519. X   LOC( device-number )
  520. X   LOCATE line, column
  521. X   LOF( device-number )
  522. X   LOG( number )
  523. X   LOOP [UNTIL expression]
  524. X   LSET string-variable$ = expression
  525. X   MERGE file-name
  526. X   MID$( string$, start-position-in-string[, number-of-spaces ] )
  527. X   MKD$( number )
  528. X   MKDIR pathname
  529. X   MKI$( number )
  530. X   MKS$( number )
  531. X   NAME old-file-name AS new-file-name
  532. X   NEW
  533. X   NEXT [counter]
  534. X   OCT$( number )
  535. X   ON variable GOTO|GOSUB line[,line,line,...]
  536. X   ON ERROR GOSUB line
  537. X   OPEN "O"|"I"|"R", [#]device-number, file-name [,record length]
  538. X        file-name FOR INPUT|OUTPUT|APPEND AS [#]device-number [LEN = record-length]
  539. X   OPTION BASE number
  540. X   POS
  541. X   PRINT [# device-number,][USING format-string$;] expressions...
  542. X   PUT [#] device-number [, record-number]
  543. X   QUIT
  544. X   RANDOMIZE number
  545. X   READ variable[, variable]...
  546. X   REM string
  547. X   RESTORE line
  548. X   RETURN
  549. X   RIGHT$( string$, number-of-spaces )
  550. X   RMDIR pathname
  551. X   RND( number )
  552. X   RSET string-variable$ = expression
  553. X   RUN [line][file-name]
  554. X   SAVE file-name
  555. X   SELECT CASE expression
  556. X   SGN( number )
  557. X   SIN( number )
  558. X   SPACE$( number )
  559. X   SPC( number )
  560. X   SQR( number )
  561. X   STOP
  562. X   STR$( number )
  563. X   STRING$( number, ascii-value|string$ )
  564. X   SUB subroutine-name
  565. X   SWAP variable, variable
  566. X   SYSTEM
  567. X   TAB( number )
  568. X   TAN( number )
  569. X   TIME$
  570. X   TIMER
  571. X   TROFF
  572. X   TRON
  573. X   VAL( string$ )
  574. X   WEND
  575. X   WHILE expression
  576. X   WIDTH [# device-number,] number
  577. X   WRITE [# device-number,] element [, element ]....
  578. X   
  579. X
  580. X4. GENERAL NOTES ON USAGE:
  581. X
  582. X   4.a. Interactive Environment
  583. X
  584. X   An interactive environment is provided if the flag INTERACTIVE
  585. X   is defined as TRUE in bwbasic.h, so that a line with a
  586. X   line number can be entered at the bwBASIC prompt and it will be
  587. X   added to the program in memory.
  588. X
  589. X   Line numbers are not strictly required, but are useful if the
  590. X   interactive enviroment is used for programming.  For longer
  591. X   program entry one might prefer to use an ASCII text editor, and
  592. X   in this case lines can be entered without numbers. One can use
  593. X   DO NUM and DO UNNUM to number or unnumber lines. See also the
  594. X   documentation below for the pseudo-command EDIT.
  595. X
  596. X   4.b. Naming Conventions
  597. X
  598. X   Command names and function names are not case sensitive,
  599. X   so that "Run" and "RUN" and "run" are equivalent and "abs()"
  600. X   and "ABS()" and "Abs()" are equivalent. HOWEVER, variable
  601. X   names ARE case sensitive in bwbASIC, so that "d$" and "D$"
  602. X   are different variables.  This differs from some BASIC
  603. X   implementations where variable names are not case sensitive.
  604. X
  605. X   Variable names can use any alphabetic characters, the period
  606. X   and underscore characters and decimal digits (but not in the
  607. X   first position). They can be terminated with '#' or '!' to
  608. X   allow Microsoft-type names, even though the precision is
  609. X   irrelevant to bwBASIC.
  610. X
  611. X   4.c. Numerical Constants
  612. X
  613. X   Numerical constants may begin with a digit 0-9 (decimal), with
  614. X   the "&H" or "&h" (hexadecimal) or the "&o" or "&O" (octal).
  615. X   Decimal numbers may terminated with 'E', 'e', 'D', or 'd'
  616. X   followed by an exponent number to denote exponential notation.
  617. X   Decimal constants may also be terminated by the '#' or '!'
  618. X   to comply with Microsoft-style precision terminators, although
  619. X   the precision specified will be irrelevant to bwBASIC.
  620. X
  621. X   4.d. Command-Line Execution
  622. X
  623. X   A filename can be specified on the command line and will be
  624. X   LOADed and RUN immediately, so that the command line
  625. X
  626. X      bwbasic prog.bas
  627. X
  628. X   will load and execute "prog.bas".
  629. X
  630. X   4.e. Program Storage
  631. X
  632. X   All programs are stored as ASCII text files.
  633. X
  634. X   4.f. TRUE and FALSE
  635. X
  636. X   TRUE is defined as -1 and FALSE is defined as 0 in the default
  637. X   distribution of bwBASIC. These definitions can be changed by
  638. X   those compiling bwBASIC (see file BWBASIC.H).
  639. X
  640. X   4.g. Assignments
  641. X
  642. X   Assignment must be made to variables.  This differs from some
  643. X   implementations of BASIC where assignment can be made to a
  644. X   function.  Implication: "INSTR( 3, x$, y$ ) = z$" will not
  645. X   work under bwBASIC.
  646. X
  647. X   4.h. Operators and Precedence
  648. X
  649. X   bwBASIC recognizes the following operators, with their level
  650. X   of precedence given (1 = highest):
  651. X
  652. X      ^         1     exponentiation
  653. X      *            2     multiplication
  654. X      /            2    division
  655. X      \            3     integer division
  656. X      +            5     addition
  657. X      -            5     subtraction
  658. X      =            6     equality or assignment
  659. X      MOD        4    modulus (remainder) arithmetic
  660. X      <>        7    inequality
  661. X      <            8    less than
  662. X      >            9    greater than
  663. X      <=        10    less than or equal to
  664. X      =<        10    less than or equal to
  665. X      >=        11    greater than or equal to
  666. X      =>        11    greater than or equal to
  667. X      NOT        12    negation
  668. X      AND        13    conjunction
  669. X      OR        14    disjunction
  670. X      XOR        15    exclusive or
  671. X      IMP        16    implication
  672. X      EQV        17    equivalence
  673. X
  674. X   4.h. Numerical Precision (NOT)
  675. X
  676. X   bwBASIC utilizes numbers with only one level of precision. If
  677. X   the flag NUMBER_DOUBLE is defined as TRUE in bwbasic.h, the
  678. X   precision implemented will be that of the C "double" data type;
  679. X   otherwise (default) the precision will be that of the C "float"
  680. X   type.  At a number of points there are commands (or pseudo-
  681. X   commands) that seem to recognize Microsoft-style precision
  682. X   distinctions, but for the most part these are just work-around
  683. X   aliases to allow Microsoft-style programs to be run.
  684. X
  685. X
  686. X5. EXPANDED REFERENCE FOR COMMANDS AND FUNCTIONS
  687. X
  688. X   The "Dependencies" listed in the folowing reference materials
  689. X   refers to flags that must be set to TRUE in bwbasic.h for the
  690. X   associated command or function to be implemented.  These flags
  691. X   are as follows:
  692. X
  693. X   (core)        Commands and Functions in any implementation of
  694. X               bwBASIC; these are the ANSI Minimal BASIC core
  695. X
  696. X   INTERACTIVE        Commands supporting the interactive programming
  697. X               environment
  698. X
  699. X   COMMON_CMDS        Commands beyond ANSI Minimal BASIC which are common
  700. X               to Full ANSI BASIC and Microsoft BASICs
  701. X
  702. X   COMMON_FUNCS        Functions beyond the ANSI Mimimal BASIC core, but
  703. X               common to both ANSI Full BASIC and Microsoft-style
  704. X               BASIC varieties
  705. X
  706. X   UNIX_CMDS        Commands which require Unix-style directory and
  707. X               environment routines not specified in C
  708. X
  709. X   STRUCT_CMDS        Commands related to structured programming; all
  710. X               of these are part of the Full ANSI BASIC standard
  711. X
  712. X   ANSI_FUNCS        Functions unique to ANSI Full BASIC
  713. X
  714. X   MS_CMDS        Commands unique to Microsoft BASICs
  715. X
  716. X   MS_FUNCS        Functions unique to Microsoft BASICs
  717. X
  718. X
  719. X   ------------------------------------------
  720. X
  721. X   Function:     ABS( number )
  722. X
  723. X   Description:  ABS returns the absolute value of the argument 'number'.
  724. X
  725. X   Dependencies: (core)
  726. X
  727. X   ------------------------------------------
  728. X
  729. X   Function:     ASC( string$ )
  730. X
  731. X   Description:  ASC returns the ASCII code for the first letter in
  732. X                 the argument string$.
  733. X
  734. X   Dependencies: MS_FUNCS
  735. X
  736. X   ------------------------------------------
  737. X
  738. X   Function:     ATN( number )
  739. X
  740. X   Description:  ATN returns the arctangent value of the argument 'number'
  741. X                 in radians.
  742. X
  743. X   Dependencies: (core)
  744. X
  745. X   ------------------------------------------
  746. X
  747. X   Command:      CALL subroutine-name
  748. X
  749. X   Description:  CALL calls a named subroutine (see SUB and END SUB).
  750. X
  751. X   Dependencies: STRUCT_CMDS
  752. X
  753. X   ------------------------------------------
  754. X
  755. X   Command:      CASE ELSE | IF partial-expression | constant
  756. X
  757. X   Description:  CASE introduces an element of a SELECT CASE statement
  758. X                 (see SELECT CASE). CASE IF introduces a conditional
  759. X                 SELECT CASE element, and CASE ELSE introduces a
  760. X         default SELECT CASE element.
  761. X
  762. X   Dependencies: STRUCT_CMDS
  763. X
  764. X   ------------------------------------------
  765. X
  766. X   Command:      CHAIN [MERGE] file-name [, line-number] [, ALL]
  767. X
  768. X   Description:  CHAIN passes control to another BASIC program.
  769. X                 Variables declared COMMON (q.v.) will be passed
  770. X                 to the new program.
  771. X
  772. X   Dependencies: COMMON_CMDS
  773. X
  774. X   ------------------------------------------
  775. X
  776. X   Command:      CHDIR pathname$
  777. X
  778. X   Description:  CHDIR changes the current directory to that indicated
  779. X                 by the argument pathname$.
  780. X
  781. X   Dependencies: UNIX_CMDS
  782. X
  783. X   ------------------------------------------
  784. X
  785. X   Function:     CHR$( number )
  786. X
  787. X   Description:  CHR$ returns a one-character string with the character
  788. X                 corresponding to the ASCII code indicated by argument
  789. X                 'number'.
  790. X
  791. X   Dependencies: COMMON_FUNCS
  792. X
  793. X   ------------------------------------------
  794. X
  795. X   Function:     CINT( number )
  796. X
  797. X   Description:  CINT returns the truncated integer for the argument
  798. X                 'number'.
  799. X
  800. X   Dependencies: MS_FUNCS
  801. X
  802. X   ------------------------------------------
  803. X
  804. X   Command:      CLEAR
  805. X
  806. X   Description:  CLEAR sets all numerical variables to 0, and all
  807. X                 string variables to null.
  808. X
  809. X   Dependencies: COMMON_CMDS
  810. X
  811. X   ------------------------------------------
  812. X
  813. X   Command:      CLOSE [[#]file-number]...
  814. X
  815. X   Description:  CLOSE closes the file indicated by file-number
  816. X                 (see OPEN).
  817. X
  818. X   Dependencies: COMMON_CMDS
  819. X
  820. X   ------------------------------------------
  821. X
  822. X   Command:      CLS
  823. X
  824. X   Description:  CLS clears the display screen (IBM and compatibles
  825. X                 only as of version 2.10).
  826. X
  827. X   Dependencies: IMP_IQC and IMP_CMDLOC
  828. X
  829. X   ------------------------------------------
  830. X
  831. X   Command:      CMDS
  832. X
  833. X   Description:  CMDS is a debugging command that prints a list
  834. X                 of all implemented bwBASIC commands.
  835. X
  836. X   Dependencies: DEBUG
  837. X
  838. X   ------------------------------------------
  839. X
  840. X   Command:      COMMON variable [, variable...]
  841. X
  842. X   Description:  COMMON designates variables to be passed to a CHAINed
  843. X                 program (see CHAIN).
  844. X
  845. X   Dependencies: COMMON_CMDS
  846. X
  847. X   ------------------------------------------
  848. X
  849. X   Function:     COS( number )
  850. X
  851. X   Description:  COS returns the cosine of the argument 'number'
  852. X                 in radians.
  853. X
  854. X   Dependencies: (core)
  855. X
  856. X   ------------------------------------------
  857. X
  858. X   Function:     CSNG( number )
  859. X
  860. X   Description:  CSNG is a pseudo-function that has no effect under
  861. X                 bwBASIC.  It replicates a Microsoft-type command
  862. X                 that would convert the 'number' to single-precision.
  863. X
  864. X   Dependencies: MS_FUNCS
  865. X
  866. X   ------------------------------------------
  867. X
  868. X   Function:     CVD( string$ )
  869. X
  870. X   Description:  CVD converts the argument string$ into a bwBASIC
  871. X                 number (precision is irrelevant in bwBASIC since
  872. X                 bwBASIC numbers have only one precision).
  873. X
  874. X   Implenentation-Specific Notes:
  875. X
  876. X   CVD(), CVI(), CVS(), MKI$(), MKD$(), MKS$(): These functions
  877. X   are implemented, but are dependent on a) the sizes for integer,
  878. X   float, and double values on particular systems, and b) how
  879. X   particular versions of C store these numerical values. The
  880. X   implication is that data files created using these functions
  881. X   on a DOS-based microcomputer may not be translated correctly
  882. X   by bwBASIC running on a Unix-based computer.  Similarly, data
  883. X   files created by bwBASIC compiled by one version of C may not be
  884. X   readable by bwBASIC compiled by another version of C (even under
  885. X   the same operating system). So be careful with these.
  886. X
  887. X   Dependencies: MS_FUNCS
  888. X
  889. X   ------------------------------------------
  890. X
  891. X   Function:     CVI( string$ )
  892. X
  893. X   Description:  CVI converts the argument string$ into a bwBASIC
  894. X                 number (precision is irrelevant in bwBASIC since
  895. X                 bwBASIC numbers have only one precision; see also
  896. X                 the note on CVD).
  897. X
  898. X   Dependencies: MS_FUNCS
  899. X
  900. X   ------------------------------------------
  901. X
  902. X   Function:     CVS( string$ )
  903. X
  904. X   Description:  CVI converts the argument string$ into a bwBASIC
  905. X                 number (precision is irrelevant in bwBASIC since
  906. X                 bwBASIC numbers have only one precision; see also
  907. X                 the note on CVD).
  908. X
  909. X   Dependencies: MS_FUNCS
  910. X
  911. X   ------------------------------------------
  912. X
  913. X   Command:      DATA constant[,constant]...
  914. X
  915. X   Description:  DATA stores numerical and string constants to be
  916. X                 accessed by READ (q.v.).
  917. X
  918. X   Dependencies: (core)
  919. X
  920. X   ------------------------------------------
  921. X
  922. X   Function:     DATE$
  923. X
  924. X   Description:  DATE$ returns the current date based on the computer's
  925. X                 internal clock as a string in the form "YYYY-MM-DD".
  926. X                 As implemented under bwBASIC, DATE$ cannot be used for
  927. X                 assignment (i.e., to set the system date).
  928. X
  929. X   Note:     bwBASIC presently (v2.10) does not allow assignment
  930. X         to a function.
  931. X
  932. X   Dependencies: COMMON_FUNCS
  933. X
  934. X   ------------------------------------------
  935. X
  936. X   Command:      DEF FNname(arg...)] = expression
  937. X
  938. X   Description:  DEF defines a user-written function.  This function
  939. X                 corresponds to Microsoft-type implementation, although
  940. X                 in bwBASIC DEF is a working equivalent of FUNCTION.
  941. X
  942. X   Dependencies: (core)
  943. X
  944. X   ------------------------------------------
  945. X
  946. X   Command:      DEFDBL letter[-letter](, letter[-letter])...
  947. X
  948. X   Description:  DEFDBL declares variables with single-letter names
  949. X                 as numerical variables (precision is irrelevant in
  950. X                 bwBASIC).
  951. X
  952. X   Dependencies: MS_CMDS
  953. X
  954. X   ------------------------------------------
  955. X
  956. X   Command:      DEFINT letter[-letter](, letter[-letter])...
  957. X
  958. X   Description:  DEFINT declares variables with single-letter names
  959. X                 as numerical variables (precision is irrelevant in
  960. X                 bwBASIC).
  961. X
  962. X   Dependencies: MS_CMDS
  963. X
  964. X   ------------------------------------------
  965. X
  966. X   Command:      DEFSNG letter[-letter](, letter[-letter])...
  967. X
  968. X   Description:  DEFSNG declares variables with single-letter names
  969. X                 as numerical variables (precision is irrelevant in
  970. X                 bwBASIC).
  971. X
  972. X   Dependencies: MS_CMDS
  973. X
  974. X   ------------------------------------------
  975. X
  976. X   Command:      DEFSTR letter[-letter](, letter[-letter])...
  977. X
  978. X   Description:  DEFSTR declares variables with single-letter names
  979. X                 as string variables.
  980. X
  981. X   Dependencies: MS_CMDS
  982. X
  983. X   ------------------------------------------
  984. X
  985. X   Command:      DELETE line[-line]
  986. X
  987. X   Description:  DELETE deletes program lines indicated by the
  988. X                 argument(s). If you want to use DELETE for non-
  989. X                 numbered programs, first use DO NUM, then DELETE,
  990. X                 then DO UNNUM.
  991. X
  992. X   Dependencies: INTERACTIVE
  993. X
  994. X   ------------------------------------------
  995. X
  996. X   Command:      DIM variable(elements...)[variable(elements...)]...
  997. X
  998. X   Description:  DIM specifies variables that have more than one
  999. X                 element in a single dimension, i.e., arrayed
  1000. X                 variables.
  1001. X
  1002. X   Note:         As implemented under bwBASIC, DIM accepts only
  1003. X                 parentheses as delimiters for variable fields.
  1004. X                 (Some BASICs allow the use of square brackets.)
  1005. X
  1006. X   Dependencies: (core)
  1007. X
  1008. X   ------------------------------------------
  1009. X
  1010. X   Command:      DO NUM|UNNUM
  1011. X
  1012. X   Description:  DO NUM numbers all lines in a program.  The first
  1013. X                 line is given the number 10, and subsequent lines
  1014. X                 are numbered consecutively in multiples of 10. DO
  1015. X                 UNNUM removes all line numbers from a program.
  1016. X                 NOTE that these functions do nothing to line
  1017. X                 numbers, e.g., following a GOSUB or GOTO statement;
  1018. X                 these commands cannot be used as a replacement for
  1019. X                 RENUM (available in some systems, but not bwBASIC).
  1020. X                 With these commands, however, one can develop
  1021. X                 unnumbered programs by entering new lines with numbers,
  1022. X                 then running DO UNNUM to remove the line numbers.
  1023. X                 Together with LOAD and SAVE (q.v.) one can use
  1024. X                 bwBASIC as a primitive text editor.
  1025. X
  1026. X   Dependencies: INTERACTIVE
  1027. X
  1028. X   ------------------------------------------
  1029. X
  1030. X   Command:      DO [WHILE expression]
  1031. X
  1032. X   Description:  DO implements a number of forms of program loops.
  1033. X                 DO...LOOP simply loops; the only way out is by
  1034. X                 EXIT; DO WHILE...LOOP loops while "expression" is
  1035. X                 true (this is equivalent to the older WHILE-WEND
  1036. X                 loop, also implemented in bwBASIC); DO...LOOP UNTIL
  1037. X                 loops until the expression following UNTIL is true.
  1038. X
  1039. X   Dependencies: STRUCT_CMDS
  1040. X
  1041. X   ------------------------------------------
  1042. X
  1043. X   Command:      EDIT
  1044. X
  1045. X   Description:  EDIT is a pseudo-command which calls the text editor
  1046. X                 specified in the variable BWB.EDITOR$ to edit the
  1047. X                 program in memory.  After the call to the text editor,
  1048. X                 the (edited) prgram is reloaded into memory.  The user
  1049. X                 normally must specific a valid path and filename in
  1050. X                 BWB.EDITOR$ before this command will be useful.
  1051. X
  1052. X   Dependencies: COMMON_CMDS
  1053. X
  1054. X   ------------------------------------------
  1055. X
  1056. X   Command:      ELSE
  1057. X
  1058. X   Description:  ELSE introduces a default condition in a multi-line IF
  1059. X                 statement.
  1060. X
  1061. X   Dependencies: STRUCT_CMDS
  1062. X
  1063. X   ------------------------------------------
  1064. X
  1065. X   Command:      ELSEIF
  1066. X
  1067. X   Description:  ELSEIF introduces a secondary condition in a multi-
  1068. X                 line IF statement.
  1069. X
  1070. X   Dependencies: STRUCT_CMDS
  1071. X
  1072. X   ------------------------------------------
  1073. X
  1074. X   Command:      END IF | FUNCTION | SELECT | SUB
  1075. X
  1076. X   Description:  END IF ends a multi-line IF statement. END FUNCTION
  1077. X                 ends a multi-line function definition. END SELECT
  1078. X                 ends a SELECT CASE statement.  END SUB ends a multi-
  1079. X                 line subroutine definition.
  1080. X
  1081. X   Dependencies: STRUCT_CMDS
  1082. X
  1083. X   ------------------------------------------
  1084. X
  1085. X   Command:      ENVIRON variable-string$ = string$
  1086. X
  1087. X   Description:  ENVIRON sets the environment variable identified by
  1088. X                 variable-string$ to string$.
  1089. X
  1090. X                 It might be noted that this differs from the implementation
  1091. X                 of ENVIRON in some versions of BASIC, but bwBASIC's ENVIRON
  1092. X                 allows BASIC variables to be used on either side of the equals
  1093. X                 sign.  Note that the function ENVIRON$() is different from the
  1094. X                 command, and be aware of the fact that in some operating systems
  1095. X                 an environment variable set within a program will not be passed
  1096. X                 to its parent shell.
  1097. X
  1098. X   Dependencies: UNIX_CMDS
  1099. X
  1100. X   ------------------------------------------
  1101. X
  1102. X   Function:     ENVIRON$( variable-string$ )
  1103. X
  1104. X   Description:  ENVIRON$ returns the environment variable associated with
  1105. X                 the name variable-string$.
  1106. X
  1107. X   Dependencies: MS_FUNCS
  1108. X
  1109. X   ------------------------------------------
  1110. X
  1111. X   Function:     EOF( device-number )
  1112. X
  1113. X   Description:  EOF returns TRUE (-1) if the device associated with
  1114. X                 device-number is at the end-of-file, otherwise it
  1115. X                 returns FALSE (0).
  1116. X
  1117. X   Dependencies: MS_FUNCS
  1118. X
  1119. X   ------------------------------------------
  1120. X
  1121. X   Command:      ERASE variable[, variable]...
  1122. X
  1123. X   Description:  ERASE eliminates arrayed variables from a program.
  1124. X
  1125. X   Dependencies: COMMON_CMDS
  1126. X
  1127. X   ------------------------------------------
  1128. X
  1129. X   Function:     ERL
  1130. X
  1131. X   Description:  ERL returns the line number of the most recent error.
  1132. X
  1133. X   Dependencies: MS_FUNCS
  1134. X
  1135. X   ------------------------------------------
  1136. X
  1137. X   Function:     ERR
  1138. X
  1139. X   Description:  ERR returns the error number of the most recent error.
  1140. X
  1141. X                 Note that if PROG_ERRORS has been defined when bwBASIC is
  1142. X                 compiled, the ERR variable will not be set correctly upon
  1143. X                 errors.  It only works when standard error messages are used.
  1144. X
  1145. X   Dependencies: MS_FUNCS
  1146. X
  1147. X   ------------------------------------------
  1148. X
  1149. X   Command:      ERROR number
  1150. X
  1151. X   Description:  ERROR simulates an error, i.e., displays the message
  1152. X                 appropriate for that error. This command is helpful
  1153. X                 in writing ON ERROR GOSUB routines that can identify
  1154. X                 a few errors for special treatment and then ERROR ERR
  1155. X                 (i.e., default handling) for all others.
  1156. X
  1157. X   Dependencies: COMMON_CMDS
  1158. X
  1159. X   ------------------------------------------
  1160. X
  1161. X   Command:      EXIT [FOR]
  1162. X
  1163. X   Description:  EXIT by itself exits from a DO...LOOP loop;
  1164. X            EXIT FOR exits from a FOR...NEXT loop.
  1165. X
  1166. X   Dependencies: STRUCT_CMDS
  1167. X
  1168. X   ------------------------------------------
  1169. X
  1170. X   Function:     EXP( number )
  1171. X
  1172. X   Description:  EXP returns the exponential value of 'number'.
  1173. X
  1174. X   Dependencies: (core)
  1175. X
  1176. X   ------------------------------------------
  1177. X
  1178. X   Command:      FIELD [#] device-number, number AS string-variable$ [, number AS string-variable$...]
  1179. X
  1180. X   Description:  FIELD allocates space in a random file buffer for device
  1181. X                 indicated by device-number, allocating 'number' bytes
  1182. X                 and assigning the bytes at this position to the variable
  1183. X                 string-variable$.
  1184. X
  1185. X   Dependencies: COMMON_CMDS
  1186. X
  1187. X   ------------------------------------------
  1188. X
  1189. X   Command:      FILES filespec$
  1190. X
  1191. X   Description:  FILES is a pseudocommand that invokes the directory program
  1192. X                 specified in the variable BWB.FILES$ with the argument
  1193. X                 filespec$.  Normally, the user must set this variable
  1194. X                 before FILES can be used.  E.g., for PC-type computers,
  1195. X
  1196. X                    BWB.FILES$ = "DIR"
  1197. X
  1198. X                 will work, for Unix machines,
  1199. X
  1200. X                    BWB.FILES$ = "ls -l"
  1201. X
  1202. X                 etc.
  1203. X
  1204. X   Dependencies: COMMON_CMDS
  1205. X
  1206. X   ------------------------------------------
  1207. X
  1208. X   Command:      FNCS
  1209. X
  1210. X   Description:  CMDS is a debugging command that prints a list
  1211. X                 of all pre-defined bwBASIC functions.
  1212. X
  1213. X   Dependencies: DEBUG
  1214. X
  1215. X   ------------------------------------------
  1216. X
  1217. X   Command:      FUNCTION
  1218. X
  1219. X   Description:  FUNCTION introduces a function definition, normally
  1220. X                 ending with END FUNCTION.  In bwBASIC, FUNCTION and
  1221. X                 DEF are qorking equivalents, so either can be used
  1222. X                 with single-line function definitions or with multi-
  1223. X                 line definitions terminated by END FUNCTION.
  1224. X
  1225. X   Dependencies: STRUCT_CMDS
  1226. X
  1227. X   ------------------------------------------
  1228. X
  1229. X   Command:      FOR counter = start TO finish [STEP increment]
  1230. X
  1231. X   Description:  FOR initiates a FOR-NEXT loop with the variable
  1232. X                 'counter' initially set to 'start' and incrementing
  1233. X                 in 'increment' steps (default is 1) until 'counter'
  1234. X                 equals 'finish'.
  1235. X
  1236. X   Dependencies: (core)
  1237. X
  1238. X   ------------------------------------------
  1239. X
  1240. X   Command:      GET [#] device-number [, record-number]
  1241. X
  1242. X   Description:  GET reads the next reacord from a random-access file
  1243. X                 or device into the buffer associated with that file.
  1244. X                 If record-number is specified, the GET command reads the
  1245. X                 specified record.
  1246. X
  1247. X   Dependencies: COMMON_CMDS
  1248. X
  1249. X   ------------------------------------------
  1250. X
  1251. X   Command:      GOSUB line | label
  1252. X
  1253. X   Description:  GOSUB initiates a subroutine call to the line (or label)
  1254. X                 specified.  The subroutine must end with RETURN.
  1255. X
  1256. X   Dependencies: (core), but STRUCT_CMDS for labels
  1257. X
  1258. X   ------------------------------------------
  1259. X
  1260. X   Command:      GOTO line | label
  1261. X
  1262. X   Description:  GOTO branches program execution to the specified line
  1263. X                 (or label).
  1264. X
  1265. X   Dependencies: (core), but STRUCT_CMDS for labels
  1266. X
  1267. X   ------------------------------------------
  1268. X
  1269. X   Function:     HEX$( number )
  1270. X
  1271. X   Description:  HEX$ returns a string giving the hexadecimal (base 16)
  1272. X                 value for the 'number'.
  1273. X
  1274. X   Dependencies: MS_FUNCS
  1275. X
  1276. X   ------------------------------------------
  1277. X
  1278. X   Command:      IF expression THEN [statement [ELSE statement]]
  1279. X
  1280. X   Description:  IF evaluates 'expression' and performs the THEN
  1281. X                 statement if it is true or (optionally) the
  1282. X                 ELSE statement if it is FALSE.  If STRUCT_CMDS
  1283. X                 is set to TRUE, bwBASIC allows multi-line IF
  1284. X                 statements with ELSE and ELSEIF cases, ending
  1285. X                 with END IF.
  1286. X
  1287. X   Dependencies: (core), STRUCT_CMDS for multi-line IF statements
  1288. X
  1289. X   ------------------------------------------
  1290. X
  1291. X   Function:     INKEY$
  1292. X
  1293. X   Description:  INKEY$ reads the status of the keyboard, and a single
  1294. X            keypress, if available. If a keypress is not available,
  1295. X            then INKEY$ immediately returns a null string ("").
  1296. X            Currently (v2.10) implemented in bwx_iqc.c only.
  1297. X
  1298. X   Dependencies: IMP_IQC and IMP_CMDLOC
  1299. X
  1300. X   ------------------------------------------
  1301. X
  1302. X   Command:      INPUT [# device-number]|[;]["prompt string";]list of variables
  1303. X
  1304. X   Description:  INPUT allows input from the terminal or a device
  1305. X                 specified by device-number.  If terminal, the "prompt
  1306. X                 string" is output, and input is assigned to the
  1307. X                 appropriate variables specified.
  1308. X
  1309. X                 bwBASIC does not support the optional feature of INPUT
  1310. X                 that suppresses the carriage-return and line-feed at the end
  1311. X                 of the input.  This is because C alone does not provide for any
  1312. X                 means of input other than CR-LF-terminated strings.
  1313. X
  1314. X   Dependencies: (core)
  1315. X
  1316. X   ------------------------------------------
  1317. X
  1318. X   Function:     INSTR( [start-position,] string-searched$, string-pattern$ )
  1319. X
  1320. X   Description:  INSTR returns the position at which string-pattern$
  1321. X                 occurs in string-searched$, beginning at start-position.
  1322. X                 As implemented in bwBASIC, INSTR cannot be used for
  1323. X                 assignments.
  1324. X
  1325. X   Note:     bwBASIC presently (v2.10) does not allow assignment
  1326. X         to a function.
  1327. X
  1328. X   Dependencies: MS_FUNCS
  1329. X
  1330. X   ------------------------------------------
  1331. X
  1332. X   Function:     INT( number )
  1333. X
  1334. X   Description:  INT returns the largest integer less than or equal to
  1335. X                 the argument 'number'. NOTE that this is not a "truncated"
  1336. X                 integer function, for which see CINT.
  1337. X
  1338. X   Dependencies: (core)
  1339. X
  1340. X   ------------------------------------------
  1341. X
  1342. X   Command:      KILL file-name$
  1343. X
  1344. X   Description:  KILL deletes the file specified by file-name$.
  1345. X
  1346. X   Dependencies: UNIX_CMDS
  1347. X
  1348. X   ------------------------------------------
  1349. X
  1350. X   Function:     LEFT$( string$, number-of-spaces )
  1351. X
  1352. X   Description:  LEFT$ returns a substring a string$ with number-of-spaces
  1353. X                 from the left (beginning) of the string). As implemented
  1354. X                 under bwBASIC, it cannot be used for assignment.
  1355. X
  1356. X   Dependencies: MS_FUNCS
  1357. X
  1358. X   ------------------------------------------
  1359. X
  1360. X   Function:     LEN( string$ )
  1361. X
  1362. X   Description:  LEN returns the length in bytes of string$.
  1363. X
  1364. X   Dependencies: COMMON_FUNCS
  1365. X
  1366. X   ------------------------------------------
  1367. X
  1368. X   Command:      LET variable = expression
  1369. X
  1370. X   Description:  LET assigns the value of 'expression' to the variable.
  1371. X                 As currently implemented, bwBASIC supports implied LET
  1372. X                 statements (e.g., "X = 4.5678" at the beginning of
  1373. X                 a line or line segment, but does not support assignment
  1374. X                 to multiple variables (e.g., "x, y, z = 3.141596").
  1375. X
  1376. X   Dependencies: (core)
  1377. X
  1378. X   ------------------------------------------
  1379. X
  1380. X   Command:      LINE INPUT [[#] device-number,]["prompt string";] string-variable$
  1381. X
  1382. X   Description:  LINE INPUT reads entire line from the keyboard or a file
  1383. X                 or device into string-variable$.  If input is from the
  1384. X                 keyboard (stdin), then "prompt string" will be printed
  1385. X                 first.  Unlike INPUT, LINE INPUT reads a whole line,
  1386. X                 not stopping for comma-delimited data items.
  1387. X
  1388. X   Dependencies: COMMON_CMDS
  1389. X
  1390. X   ------------------------------------------
  1391. X
  1392. X   Command:      LIST line[-line]
  1393. X
  1394. X   Description:  LIST lists program lines as specified in its argument.
  1395. X
  1396. X   Dependencies: INTERACTIVE
  1397. X
  1398. X   ------------------------------------------
  1399. X
  1400. X   Command:      LOAD file-name
  1401. X
  1402. X   Description:  LOAD loads an ASCII BASIC program into memory.
  1403. X
  1404. X   Dependencies: INTERACTIVE
  1405. X
  1406. X   ------------------------------------------
  1407. X
  1408. X   Function:     LOC( device-number )
  1409. X
  1410. X   Description:  LOC returns the next record that GET or PUT statements
  1411. X                 will use.
  1412. X
  1413. X   Dependencies: MS_FUNCS
  1414. X
  1415. X   ------------------------------------------
  1416. X
  1417. X   Command:      LOCATE line, column
  1418. X
  1419. X   Description:  LOCATE addresses trhe curor to a specified line and
  1420. X         column. Currently (v2.10) implemented in bwx_iqc.c only.
  1421. X
  1422. X   Dependencies: IMP_IQC and IMP_CMDLOC
  1423. X
  1424. X   ------------------------------------------
  1425. X
  1426. X   Function:     LOF( device-number )
  1427. X
  1428. X   Description:  LOF returns the length of a file (specified by device-number)
  1429. X                 in bytes.
  1430. X
  1431. X   Dependencies: MS_FUNCS
  1432. X
  1433. X   ------------------------------------------
  1434. X
  1435. X   Function:     LOG( number )
  1436. X
  1437. X   Description:  LOG returns the natural logarithm of the argument 'number'.
  1438. X
  1439. X   Dependencies: (core)
  1440. X
  1441. X   ------------------------------------------
  1442. X
  1443. X   Command:      LOOP [UNTIL expression]
  1444. X
  1445. X   Description:  LOOP terminates a program loop:  see DO.
  1446. X
  1447. X   Dependencies: STRUCT_CMDS
  1448. X
  1449. X   ------------------------------------------
  1450. X
  1451. X   Command:      LSET string-variable$ = expression
  1452. X
  1453. X   Description:  LSET transfers data from 'expression' to the left-hand
  1454. X                 side of a string variable or random access buffer field.
  1455. X
  1456. X   Dependencies: COMMON_CMDS
  1457. X
  1458. X   ------------------------------------------
  1459. X
  1460. X   Command:      MERGE file-name
  1461. X
  1462. X   Description:  MERGE adds program lines from 'file-name' to the program
  1463. X                 in memory.  Unlike LOAD, it does not clear the program
  1464. X                 currently in memory.
  1465. X
  1466. X   Dependencies: COMMON_CMDS
  1467. X
  1468. X   ------------------------------------------
  1469. X
  1470. X   Function:     MID$( string$, start-position-in-string[, number-of-spaces ] )
  1471. X
  1472. X   Description:  MID$ returns a substring of string$ beginning at
  1473. X                 start-position-in-string and continuing for
  1474. X                 number-of-spaces bytes.
  1475. X
  1476. X   Dependencies: MS_FUNCS
  1477. X
  1478. X   ------------------------------------------
  1479. X
  1480. X   Command:      MKDIR pathname$
  1481. X
  1482. X   Description:  MKDIR creates a new directory path as specified by
  1483. X                 pathname$.
  1484. X
  1485. X   Dependencies: UNIX_CMDS
  1486. X
  1487. X   ------------------------------------------
  1488. X
  1489. X   Function:     MKD$( number )
  1490. X
  1491. X   Description:  MKD$, MKI$, and MKS$ are all equivalent in bwBASIC.
  1492. X                 They convert the numerical value 'number' into a string
  1493. X                 which can be stored in a more compressed form in a file
  1494. X                 (especially for random file access).  Since bwBASIC does
  1495. X                 not recognize differences in precision, these commands
  1496. X                 are effectively equivalent.
  1497. X
  1498. X   Dependencies: MS_FUNCS
  1499. X
  1500. X   ------------------------------------------
  1501. X
  1502. X   Function:     MKI$( number )
  1503. X
  1504. X   Description:  Equivalent to MKD$ (q.v.)
  1505. X
  1506. X   Dependencies: MS_FUNCS
  1507. X
  1508. X   ------------------------------------------
  1509. X
  1510. X   Function:     MKS$( number )
  1511. X
  1512. X   Description:  Equivalent to MKD$ (q.v.).
  1513. X
  1514. X   Dependencies: MS_FUNCS
  1515. X
  1516. X   ------------------------------------------
  1517. X
  1518. X   Command:      NAME old-file-name AS new-file-name
  1519. X
  1520. X   Description:  NAME renames an existing file (old-file-name) as
  1521. X                 new-file-name.
  1522. X
  1523. X   Dependencies: UNIX_CMDS
  1524. X
  1525. X   ------------------------------------------
  1526. X
  1527. X   Command:      NEW
  1528. X
  1529. X   Description:  NEW deletes the program in memory and clears all
  1530. X                 variables.
  1531. X
  1532. X   Dependencies: INTERACTIVE
  1533. X
  1534. X   ------------------------------------------
  1535. X
  1536. X   Command:      NEXT [counter-variable]
  1537. X
  1538. X   Description:  NEXT comes at the end of a FOR-NEXT loop; see FOR.
  1539. X
  1540. X   Dependencies: (core)
  1541. X
  1542. X   ------------------------------------------
  1543. X
  1544. X   Function:     OCT$( number )
  1545. X
  1546. X   Description:  OCT$ returns a string giving the octal (base 8)
  1547. X                 representation of 'number'.
  1548. X
  1549. X   Dependencies: MS_FUNCS
  1550. X
  1551. X   ------------------------------------------
  1552. X
  1553. X   Command:      ON variable GOTO|GOSUB line[,line,line,...]
  1554. X
  1555. X   Description:  ON either branches (GOTO) or calls a subroutine
  1556. X                 (GOSUB) based on the rounded value of variable;
  1557. X                 if it is 1, the first line is called, if 2, the second
  1558. X                 line is called, etc.
  1559. X
  1560. X   Dependencies: (core)
  1561. X
  1562. X   ------------------------------------------
  1563. X
  1564. X   Command:      ON ERROR GOSUB line|label
  1565. X
  1566. X   Description:  ON ERROR sets up an error handling subroutine. See
  1567. X                 also ERROR.
  1568. X
  1569. X   Dependencies: COMMON_CMDS, STRUCT_CMDS for labels
  1570. X
  1571. X   ------------------------------------------
  1572. X
  1573. X   Command:      OPEN "O"|"I"|"R", [#]device-number, file-name [,record length]
  1574. X                      file-name FOR INPUT|OUTPUT|APPEND AS [#]device-number [LEN = record-length]
  1575. X
  1576. X   Description:  OPEN allocates random access memory for access to a disk
  1577. X                 file or other device.  Note that two quite different forms
  1578. X                 of the OPEN statement are supported. In the first form,
  1579. X                 "O" (note that these letters must be encased in quotation
  1580. X                 marks) denotes sequential output, "I" denotes sequential
  1581. X                 input, and "R" denotes random-access input and output.
  1582. X                 Once OPEN, any number of operations can be performed
  1583. X                 on a device (see WRITE #, INPUT #, PRINT #, etc.).
  1584. X
  1585. X   Dependencies: COMMON_CMDS
  1586. X
  1587. X   ------------------------------------------
  1588. X
  1589. X   Command:      OPTION BASE number
  1590. X
  1591. X   Description:  OPTION BASE sets the lowest value for array subscripts,
  1592. X                 either 0 or 1.
  1593. X
  1594. X   Dependencies: (core)
  1595. X
  1596. X   ------------------------------------------
  1597. X
  1598. X   Function:     POS
  1599. X
  1600. X   Description:  POS returns the current cursor position in the line.
  1601. X
  1602. X   Dependencies: COMMON_FUNCS
  1603. X
  1604. X   ------------------------------------------
  1605. X
  1606. X   Command:      PRINT [# device-number,][USING format-string$;] expressions...
  1607. X
  1608. X   Description:  PRINT outputs text to the screen or to a file or device
  1609. X                 specified by device-number. In the current implementation
  1610. X                 of bwBASIC, expressions to be printed must be separated by
  1611. X                 the comma (tabbed output), the semicolon (immediate
  1612. X                 sequential output) or the plus sign (immediate sequential
  1613. X                 output by string concatenation).  Expressions separated
  1614. X                 by blanks or tabs are not supported. If USING is specified,
  1615. X                 a number of formatting marks may appear in the format
  1616. X                 string:
  1617. X
  1618. X                    !    prints the first character of a string
  1619. X
  1620. X                    \\    prints 2+x characters of a string, where x =
  1621. X                        the number of spaces between the backslashes
  1622. X
  1623. X                    &    variable-length string field
  1624. X
  1625. X                    #    represents a single digit in output format for
  1626. X                        a number
  1627. X
  1628. X                    .    decimal point in a number
  1629. X
  1630. X                    +    sign of a number (will output + or -)
  1631. X
  1632. X                    -    trailing minus after a number
  1633. X
  1634. X                    **    fill leading spaces with asterisks
  1635. X
  1636. X                    $$    output dollar sign in front of a number
  1637. X
  1638. X                    ^^    output number in exponential format
  1639. X
  1640. X                    _    output next character literally
  1641. X
  1642. X                 As currently implemented, the exponential format
  1643. X                 will be that used by the C compiler.
  1644. X
  1645. X   Dependencies: (core), COMMON_FUNCS for USING
  1646. X
  1647. X   ------------------------------------------
  1648. X
  1649. X   Command:      PUT [#] device-number [, record-number]
  1650. X
  1651. X   Description:  PUT outputs the next available record or the record
  1652. X                 specified by record-number to the file or device
  1653. X                 denoted by device-number.
  1654. X
  1655. X   Dependencies: COMMON_CMDS
  1656. X
  1657. X   ------------------------------------------
  1658. X
  1659. X   Command:      QUIT
  1660. X
  1661. X   Description:  QUIT is a synonym for SYSTEM; with INTERACTIVE
  1662. X         environment, it exits the program to the 
  1663. X         operating system (or the calling program).
  1664. X
  1665. X   Dependencies: INTERACTIVE
  1666. X
  1667. X   ------------------------------------------
  1668. X
  1669. X   Command:      RANDOMIZE number
  1670. X
  1671. X   Description:  RANDOMIZE seeds the random number generator (see RND).
  1672. X                 Under bwBASIC, the TIMER function (q.v.) can be used
  1673. X                 to supply a 'number' seed for the random number
  1674. X                 generator.
  1675. X
  1676. X   Dependencies: (core)
  1677. X
  1678. X   ------------------------------------------
  1679. X
  1680. X   Command:      READ variable[, variable]...
  1681. X
  1682. X   Description:  READ reads values from DATA statements and assigns these
  1683. X                 values to the named variables.  Variable types in a READ
  1684. X                 statement must match the data types in DATA statements
  1685. X                 as they are occurred.  See also DATA and RESTORE.
  1686. X
  1687. X   Dependencies: (core)
  1688. X
  1689. X   ------------------------------------------
  1690. X
  1691. X   Command:      REM string
  1692. X
  1693. X   Description:  REM allows remarks to be included in a program. As
  1694. X                 currently implemented, the entire line following
  1695. X                 REM is ignored by the interpreter (thus, even if
  1696. X                 MULTISEG_LINES is set, a REM line will not be able
  1697. X                 to find a segment delimiter (":") followed by another
  1698. X                 line segment with command.  bwBASIC does not currently
  1699. X                 implement the Microsoft-style use of the single quotation
  1700. X                 mark to denote remarks.
  1701. X
  1702. X   Dependencies: (core)
  1703. X
  1704. X   ------------------------------------------
  1705. X
  1706. X   Command:      RESTORE line
  1707. X
  1708. X   Description:  RESTORE resets the line and position counters for DATA
  1709. X                 and READ statements to the top of the program file or
  1710. X                 to the beginning of the specified line.  (Currently this
  1711. X                 must be a line number.)
  1712. X
  1713. X   Dependencies: (core)
  1714. X
  1715. X   ------------------------------------------
  1716. X
  1717. X   Command:      RETURN
  1718. X
  1719. X   Description:  RETURN concludes a subroutine called by GOSUB.
  1720. X
  1721. X   Dependencies: (core)
  1722. X
  1723. X   ------------------------------------------
  1724. X
  1725. X   Function:     RIGHT$( string$, number-of-spaces )
  1726. X
  1727. X   Description:  RIGHT$ returns a substring a string$ with number-of-spaces
  1728. X                 from the right (end) of the string). As implemented
  1729. X                 under bwBASIC, it cannot be used for assignment.
  1730. X
  1731. X   Dependencies: MS_FUNCS
  1732. X
  1733. X   ------------------------------------------
  1734. X
  1735. X   Command:      RMDIR pathname
  1736. X
  1737. X   Description:  RMDIR deletes the directory path indicated by pathname.
  1738. X
  1739. X   Dependencies: UNIX_CMDS
  1740. X
  1741. X   ------------------------------------------
  1742. X
  1743. X   Function:     RND( number )
  1744. X
  1745. X   Description:  RND returns a pseudo-random number.  The 'number' value
  1746. X                 is ignored by bwBASIC if supplied. The RANDOMIZE
  1747. X                 command (q.v.) reseeds the random-number generator.
  1748. X
  1749. X   Dependencies: (core)
  1750. X
  1751. X   ------------------------------------------
  1752. X
  1753. X   Command:      RSET string-variable$ = expression
  1754. X
  1755. X   Description:  RSET transfers data from 'expression' to the right-hand
  1756. X                 side of a string variable or random access buffer field.
  1757. X
  1758. X   Dependencies: COMMON_CMDS
  1759. X
  1760. X   ------------------------------------------
  1761. X
  1762. X   Command:      RUN [line][file-name$]
  1763. X
  1764. X   Description:  RUN executes the program in memory.  If a file-name$ is
  1765. X                 supplied, then the specified file is loaded into memory
  1766. X                 and executed.  If a line number is supplied, then execution
  1767. X                 begins at that line.
  1768. X
  1769. X   Dependencies: INTERACTIVE
  1770. X
  1771. X   ------------------------------------------
  1772. X
  1773. X   Command:      SAVE file-name$
  1774. X
  1775. X   Description:  SAVE saves the program in memory to file-name$. bwBASIC
  1776. X                 only saves files in ASCII format.
  1777. X
  1778. X   Dependencies: INTERACTIVE
  1779. X
  1780. X   ------------------------------------------
  1781. X
  1782. X   Command:      SELECT CASE expression
  1783. X
  1784. X   Description:  SELECT CASE introduces a multi-line conditional selection
  1785. X                 statement.  The expression given as the argument to SELECT
  1786. X                 CASE will be evaluated by CASE statements following.  The
  1787. X                 SELECT CASE statement conclludes with an END SELECT
  1788. X                 statement.
  1789. X
  1790. X                 As currently implemented, CASE statements may be followed
  1791. X                 by string values, but in this case only simple comparisons
  1792. X                 (equals, not equals) can be performed. 
  1793. X
  1794. X   Dependencies: STRUCT_CMDS
  1795. X
  1796. X   ------------------------------------------
  1797. X
  1798. X   Function:     SGN( number )
  1799. X
  1800. X   Description:  SGN returns the sign of the argument 'number', +1
  1801. X                 for positive numbers, 0 for 0, and -1 for negative numbers.
  1802. X
  1803. X   Dependencies: (core)
  1804. X
  1805. X   ------------------------------------------
  1806. X
  1807. X   Function:     SIN( number )
  1808. X
  1809. X   Description:  SIN returns the sine of the argument 'number'
  1810. X                 in radians.
  1811. X
  1812. X   Dependencies: (core)
  1813. X
  1814. X   ------------------------------------------
  1815. X
  1816. X   Function:     SPACE$( number )
  1817. X
  1818. X   Description:  SPACE$ returns a string of blank spaces 'number'
  1819. X                 bytes long.
  1820. X
  1821. X   Dependencies: MS_FUNCS
  1822. X
  1823. X   ------------------------------------------
  1824. X
  1825. X   Function:     SPC( number )
  1826. X
  1827. X   Description:  SPC returns a string of blank spaces 'number'
  1828. X                 bytes long.
  1829. X
  1830. X   Dependencies: MS_FUNCS
  1831. X
  1832. X   ------------------------------------------
  1833. X
  1834. X   Function:     SQR( number )
  1835. X
  1836. X   Description:  SQR returns the square root of the argument 'number'.
  1837. X
  1838. X   Dependencies: (core)
  1839. X
  1840. X   ------------------------------------------
  1841. X
  1842. X   Command:      STOP
  1843. X
  1844. X   Description:  STOP interrupts program execution. As implemented under
  1845. X                 bwBASIC, STOP issues a SIGINT signal.
  1846. X
  1847. X   Dependencies: (core)
  1848. X
  1849. X   ------------------------------------------
  1850. X
  1851. X   Function:     STR$( number )
  1852. X
  1853. X   Description:  STR$ returns a string giving the decimal (base 10)
  1854. X                 representation of the argument 'number'.
  1855. X
  1856. X   Dependencies: COMMON_FUNCS
  1857. X
  1858. X   ------------------------------------------
  1859. X
  1860. X   Function:     STRING$( number, ascii-value|string$ )
  1861. X
  1862. X   Description:  STRING$ returns a string 'number' bytes long consisting
  1863. X                 of either the first character of string$ or the character
  1864. X                 answering to the ASCII value ascii-value.
  1865. X
  1866. X   Dependencies: MS_FUNCS
  1867. X
  1868. X   ------------------------------------------
  1869. X
  1870. X   Command:      SUB subroutine-name
  1871. X
  1872. X   Description:  SUB introduces a named, multi-line subroutine. The
  1873. X                 subroutine is called by a CALL statement, and concludes
  1874. X                 with an END SUB statement.
  1875. X
  1876. X   Dependencies: STRUCT_CMDS
  1877. X
  1878. X   ------------------------------------------
  1879. X
  1880. X   Command:      SWAP variable, variable
  1881. X
  1882. X   Description:  SWAP swaps the values of two variables. The two variables
  1883. X                 must be of the same type (either numerical or string).
  1884. X
  1885. X   Dependencies: COMMON_CMDS
  1886. X
  1887. X   ------------------------------------------
  1888. X
  1889. X   Command:      SYSTEM
  1890. X
  1891. X   Description:  SYSTEM exits from bwBASIC to the calling program or
  1892. X                 (more usually) the operating system.
  1893. X
  1894. X   Dependencies: INTERACTIVE
  1895. X
  1896. X   ------------------------------------------
  1897. X
  1898. X   Function:     TAB( number )
  1899. X
  1900. X   Description:  TAB outputs spaces until the column indicated by
  1901. X                 'number' has been reached.
  1902. X
  1903. X   Dependencies: (core)
  1904. X
  1905. X   ------------------------------------------
  1906. X
  1907. X   Function:     TAN( number )
  1908. X
  1909. X   Description:  TAN returns the tangent of the argument 'number'
  1910. X                 in radians.
  1911. X
  1912. X   Dependencies: (core)
  1913. X
  1914. X   ------------------------------------------
  1915. X
  1916. X   Function:     TIME$
  1917. X
  1918. X   Description:  TIME$ returns the current time based on the computer's
  1919. X                 internal clock as a string in the form "HH-MM-SS".
  1920. X                 As implemented under bwBASIC, TIME$ cannot be used for
  1921. X                 assignment (i.e., to set the system time).
  1922. X
  1923. X   Note:     bwBASIC presently (v2.10) does not allow assignment
  1924. X         to a function.
  1925. X
  1926. X   Dependencies: COMMON_FUNCS
  1927. X
  1928. X   ------------------------------------------
  1929. X
  1930. X   Function:     TIMER
  1931. X
  1932. X   Description:  TIMER returns the time in the system clock in seconds
  1933. X                 elapsed since midnight.
  1934. X
  1935. X   Dependencies: MS_FUNCS
  1936. X
  1937. X   ------------------------------------------
  1938. X
  1939. X   Command:      TROFF
  1940. X
  1941. X   Description:  TROFF turns of the trace facility; see TRON.
  1942. X
  1943. X   Dependencies: COMMON_CMDS
  1944. X
  1945. X   ------------------------------------------
  1946. X
  1947. X   Command:      TRON
  1948. X
  1949. X   Description:  TRON turns on the trace facility. This facility will print
  1950. X                 each line number in square brackets as the program is
  1951. X                 executed.  This is useful in debugging programs with
  1952. X                 line numbers.  To debug an unnumbered program with
  1953. X                 TRON, call DO NUM first, but remember to call DO UNNUM
  1954. X                 before you save the program later.
  1955. X
  1956. X   Dependencies: COMMON_CMDS
  1957. X
  1958. X   ------------------------------------------
  1959. X
  1960. X   Function:     VAL( string$ )
  1961. X
  1962. X   Description:  VAL returns the numerical value of the string$.
  1963. X
  1964. X   Dependencies: COMMON_FUNCS
  1965. X
  1966. X   ------------------------------------------
  1967. X
  1968. X   Command:      VARS
  1969. X
  1970. X   Description:  VARS is a debugging command which prints a list of
  1971. X                 all variables defined which have global scope.
  1972. X
  1973. X   Dependencies: DEBUG
  1974. X
  1975. X   ------------------------------------------
  1976. X
  1977. X   Command:      WEND
  1978. X
  1979. X   Description:  WEND concludes a WHILE-WEND loop; see WHILE.
  1980. X
  1981. X   Dependencies: COMMON_CMDS
  1982. X
  1983. X   ------------------------------------------
  1984. X
  1985. X   Command:      WHILE expression
  1986. X
  1987. X   Description:  WHILE initiates a WHILE-WEND loop.  The loop ends with
  1988. X                 WEND, and execution reiterates through the loop as
  1989. X                 long as the 'expression' is TRUE (-1).
  1990. X
  1991. X   Dependencies: COMMON_CMDS
  1992. X
  1993. X   ------------------------------------------
  1994. X
  1995. X   Command:      WIDTH [# device-number,] number
  1996. X
  1997. X   Description:  WIDTH sets screen or device output to 'number'
  1998. X                 columns.  device-number specifies the device
  1999. X                 or file for oputput.
  2000. X
  2001. X   Dependencies: COMMON_CMDS
  2002. X
  2003. X   ------------------------------------------
  2004. X
  2005. X   Command:      WRITE [# device-number,] element [, element ]....
  2006. X
  2007. X   Description:  WRITE outputs variables to the screen or to a file
  2008. X                 or device specified by device-number.  Commas
  2009. X                 are inserted between expressions output, and strings
  2010. X                 are enclosed in quotation marks.
  2011. X
  2012. X   Dependencies: COMMON_CMDS
  2013. X
  2014. X   ------------------------------------------
  2015. X
  2016. X
  2017. X6. PREDEFINED VARIABLES
  2018. X
  2019. X   BWB.EDITOR$
  2020. X   BWB.FILES$
  2021. X   BWB.PROMPT$
  2022. X   BWB.IMPLEMENTATION$
  2023. X
  2024. X   The commands EDIT and FILES are pseudo-commands that launch
  2025. X   shell programs named in the variables BWB.EDITOR$ and BWB.FILES$,
  2026. X   respectively.  The default values for these variables can
  2027. X   be changed in bwbasic.h (DEF_EDITOR and DEF_FILES), or they
  2028. X   can be changed on the fly by the user.  An idea might be to
  2029. X   initialize these variables in "profile.bas" for specific
  2030. X   implementations; for instance, BWB.FILES$ might be defined as
  2031. X   "ls -l" on Unix systems or "dir" on DOS systems.
  2032. X
  2033. X   The preset variable BWB.PROMPT$ can be used to set the prompt
  2034. X   string for bwBASIC.  Again, it is suggested that a user-
  2035. X   selected promptcan be set up in a "profile.bas" to be
  2036. X   initialized each time bwBASIC starts.  Note that special
  2037. X   characters can be added to the prompt string, e.g.,
  2038. X
  2039. X      BWB.PROMPT$ = "Ok"+CHR$(10)
  2040. X
  2041. X   will give an "Ok" prompt followed by a linefeed.
  2042. X
  2043. X   The preset variable BWB.IMPLEMENTATION$ will return "TTY" for
  2044. X   the bwx_tty implementation and will return "IQC" for the
  2045. X   IBM PC or Compatibles with QuickC (bwx_iqc) implementation.
  2046. X   This may be useful in determing which commands and functions
  2047. X   (specifically CLS, LOCATE, and INKEY$) may be available. 
  2048. X
  2049. X
  2050. X7. UNIMPLEMENTED COMMANDS AND FUNCTIONS, and AGENDA FOR DEVELOPMENT
  2051. X
  2052. X   There are some items not implemented that have been so long
  2053. X   a part of standard BASICs that their absence will seem surprising.
  2054. X   In each case, though, their implementation would require opera-
  2055. X   ting-system-specific functions or terminal-specific functions
  2056. X   that cannot be universally provided. Some specific examples:
  2057. X
  2058. X   CLOAD    Relies on CP/M or MSDOS conventions for binary
  2059. X                executable files. 
  2060. X
  2061. X   CONT        See RESUME below (programmer ignorance?).
  2062. X
  2063. X   DEF USR    Relies on CP/M or MSDOS conventions for binary
  2064. X                executable files. 
  2065. X
  2066. X   FRE()    The ability to report the amount of free memory
  2067. X        remaining is system-specific due to varying patterns
  2068. X        of memory allocation and access; consequently this
  2069. X        ability is not present in ANSI or earlier versions 
  2070. X                of C and this function is not available in bwBASIC.
  2071. X
  2072. X   INPUT$()    C by itself is not able to read unechoed keyboard 
  2073. X        input, and can read keyboard input only after a 
  2074. X        Carriage-Return has been entered.
  2075. X
  2076. X   INP        Calls to hardware ports, like machine-language
  2077. X           routines, are highly system-specific and cannot
  2078. X           be implemented in C alone.
  2079. X
  2080. X   LLIST    See LPRINT below.
  2081. X
  2082. X   LPOS        See LPRINT below.
  2083. X
  2084. X   LPRINT    and LLIST, etc., require access to a printer device,
  2085. X           and this varies from one system to another. Users
  2086. X           might try OPENing the printer device on their own
  2087. X           operating system (e.g., "/dev/lp" on Unix systems,
  2088. X           or "PRN" under DOS) and see if printing can be done
  2089. X           from bwBASIC in this way.
  2090. X
  2091. X   NULL        In this case, I am convinced that NULL is no longer
  2092. X        necessary, since very few printers now require NULLs
  2093. X        at the end of lines.
  2094. X
  2095. X   OUT        See INP above (calls to hardware ports).
  2096. X
  2097. X   PEEK()    PEEK and POKE enabled earlier BASICs to address
  2098. X           particular memory locations. Although bwBASIC
  2099. X           could possibly implement this command (POKE) and
  2100. X           this function (PEEK()), the limitation would be
  2101. X           highly limited by the different systems for
  2102. X           memory access in different systems.
  2103. X
  2104. X   POKE        see PEEK() above.
  2105. X
  2106. X   RENUM    Since unnumbered lines can be entered and
  2107. X           executed under bwBASIC, it would not be
  2108. X           possible to implement a RENUM routine.
  2109. X           Instead, bwBASIC uses DO NUM and DO UNNUM.
  2110. X
  2111. X   RESUME    Is this possible under C? If so, I
  2112. X           simply have failed to figure it out yet.
  2113. X           Mea culpa (but not maxima).
  2114. X
  2115. X   USR        See CALL and DEF USR above (machine language
  2116. X           subroutines).
  2117. X
  2118. X   VARPTR    See PEEK and POKE above.
  2119. X
  2120. X   WAIT        See INP and OUT above.
  2121. X
  2122. X   There are other commands, functions, and implementation details
  2123. X   that I am working on, and which are on the agenda list for future
  2124. X   versions of bwBASIC.  These agenda include:
  2125. X
  2126. X   PARACT    i.e., the ability to execute PARallel ACTions. This
  2127. X           is described in ANSI BASIC, although I have not seen it
  2128. X           implemented before.  It will offer a rough, non-
  2129. X           preemptive form of multitasking within the scope
  2130. X           of a BASIC program. Programmers will note points at which
  2131. X           there are already hooks for PARACT in bwBASIC.
  2132. X
  2133. X   XMEM        PC-type computers need to be able to use extended
  2134. X           memory.  If we could use extended memory for program
  2135. X           lines, variables, and function defitions, we could
  2136. X           write much longer programs.  This would entail,
  2137. X           however, a fairly serious rewriting of the program
  2138. X           to utilize memory handles for these storage features
  2139. X           instead of direct memory pointers.
  2140. X
  2141. X   Windows    The addition of memory handles in addition to the
  2142. X           non-preemptive execution of program lines (in a
  2143. X           crude form, already present) will make it possible
  2144. X           to develop implementations for Windows and perhaps
  2145. X           for other graphical user interfaces.  But what form
  2146. X           should this take?  I have in mind presently a BASIC
  2147. X           that would run in the background, appearing only
  2148. X           as an icon in the GUI space, with pop-up editors
  2149. X           and output windows. Thus, the interpreted language
  2150. X        would serve a purpose something like 'cron' (a task
  2151. X        scheduler) under Unix systems. You may have some
  2152. X        reflections that would help me in this.
  2153. X
  2154. X   Graphics    Here we face fairly critical differences in different
  2155. X           styles and implementations of graphics, e.g., between
  2156. X           GWBASIC, ANSI BASIC, VisualBASIC, etc. But it's
  2157. X           possible that Graphics commands and functions could
  2158. X           be added. These would all be implementation-specific.
  2159. X
  2160. X   The ANSI Standard for full BASIC does not specify which particular
  2161. X   commands or functions must be implemented, and in fact the standard
  2162. X   is very robust.  Perhaps no implementation of BASIC would ever
  2163. X   include all of the items, but some ANSI commands and functions which
  2164. X   remain unimplemented are:
  2165. X
  2166. X   ACCESS
  2167. X   ANGLE
  2168. X   AREA
  2169. X   ARITHMETIC
  2170. X   ARRAY
  2171. X   ASK
  2172. X   BSTR
  2173. X   BVAL
  2174. X   CEIL
  2175. X   CELLS
  2176. X   CLIP
  2177. X   COLLATE
  2178. X   CONNECT
  2179. X   COSH
  2180. X   DATUM
  2181. X   DEBUG
  2182. X   DECIMAL
  2183. X   DECLARE
  2184. X   DEGREES
  2185. X   DEVICE
  2186. X   DISCONNECT
  2187. X   DISPLAY
  2188. X   DOT
  2189. X   DRAW
  2190. X   ERASE
  2191. X   EVENT
  2192. X   EXCEPTION
  2193. X   GRAPH
  2194. X   HANDLER
  2195. X   IMAGE
  2196. X   KEY
  2197. X   LCASE
  2198. X   LINES
  2199. X   LOG10
  2200. X   LOG2
  2201. X   MAT
  2202. X   MIX
  2203. X   MULTIPOINT
  2204. X   OUTIN
  2205. X   OUTPUT
  2206. X   PARACT
  2207. X   PICTURE
  2208. X   PIXEL
  2209. X   PLOT
  2210. X   POINTS
  2211. X   RADIANS
  2212. X   RECEIVE
  2213. X   RENUMBER
  2214. X   REWRITE
  2215. X   ROTATE
  2216. X   ROUND
  2217. X   SEIZE
  2218. X   SEND
  2219. X   SHIFT
  2220. X   SINH
  2221. X   TANH
  2222. X   TIMEOUT
  2223. X   TRACE
  2224. X   TRANSFORM
  2225. X   TRUNCATE
  2226. X   UBOUND
  2227. X   UCASE
  2228. X   VIEWPORT
  2229. X   WAIT
  2230. X   VIEWPORT
  2231. X   ZONEWIDTH
  2232. X
  2233. X
  2234. X8. THE STORY OF BYWATER BASIC
  2235. X
  2236. X   This program was originally begun in 1982 by my grandmother, Mrs.
  2237. X   Verda Spell of Beaumont, TX.  She was writing the program using
  2238. X   an ANSI C compiler on an Osborne I CP/M computer and although my
  2239. X   grandfather (Lockwood Spell) had bought an IBM PC with 256k of
  2240. X   RAM my grandmother would not use it, paraphrasing George Herbert
  2241. X   to the effect that "He who cannot in 64k program, cannot in 512k."
  2242. X   She had used Microsoft BASIC and although she had nothing against
  2243. X   it she said repeatedly that she didn't understand why Digital
  2244. X   Research didn't "sue the socks off of Microsoft" for version 1.0
  2245. X   of MSDOS and so I reckon that she hoped to undercut Microsoft's
  2246. X   entire market and eventually build a new software empire on
  2247. X   the North End of Beaumont. Her programming efforts were cut
  2248. X   tragically short when she was thrown from a Beaumont to Port
  2249. X   Arthur commuter train in the summer of 1986. I found the source
  2250. X   code to bwBASIC on a single-density Osborne diskette in her knitting
  2251. X   bag and eventually managed to have it all copied over to a PC
  2252. X   diskette. I have revised it slightly prior to this release. You
  2253. X   should know, though, that I myself am an historian, not a programmer.
  2254. X
  2255. X
  2256. X9. COMMUNICATIONS:
  2257. X
  2258. X   email:  tcamp@delphi.com
  2259. X
  2260. END_OF_FILE
  2261.   if test 58924 -ne `wc -c <'bwbasic-2.10/bwbasic.doc'`; then
  2262.     echo shar: \"'bwbasic-2.10/bwbasic.doc'\" unpacked with wrong size!
  2263.   fi
  2264.   # end of 'bwbasic-2.10/bwbasic.doc'
  2265. fi
  2266. if test ! -d 'bwbasic-2.10/bwbtest' ; then
  2267.     echo shar: Creating directory \"'bwbasic-2.10/bwbtest'\"
  2268.     mkdir 'bwbasic-2.10/bwbtest'
  2269. fi
  2270. if test -f 'bwbasic-2.10/bwbtest/dataread.bas' -a "${1}" != "-c" ; then 
  2271.   echo shar: Will not clobber existing file \"'bwbasic-2.10/bwbtest/dataread.bas'\"
  2272. else
  2273.   echo shar: Extracting \"'bwbasic-2.10/bwbtest/dataread.bas'\" \(505 characters\)
  2274.   sed "s/^X//" >'bwbasic-2.10/bwbtest/dataread.bas' <<'END_OF_FILE'
  2275. X10 rem DATAREAD.BAS -- Test DATA, READ, and RESTORE Statements 
  2276. X20 print "DATAREAD.BAS -- Test DATA, READ, and RESTORE Statements" 
  2277. X30 DATA "Ted", 56.789 
  2278. X40 REM just to see if it advances correctly 
  2279. X50 DATA "Dale", 45.678 
  2280. X    60 READ N$, NUMBER, ANOTHER$ 
  2281. X    70 READ ANUMBER 
  2282. X    80 PRINT "Data read: ";N$;" ";NUMBER;" ";ANOTHER$;" ";ANUMBER 
  2283. X90 RESTORE 30 
  2284. X    100 READ ANOTHER$ 
  2285. X    110 READ ANUMBER, N$,NUMBER 
  2286. X    120 PRINT "After RESTORE:" 
  2287. X    130 PRINT "Data read: ";ANOTHER$;" ";ANUMBER;" ";N$;" ";NUMBER 
  2288. X140 END 
  2289. END_OF_FILE
  2290.   if test 505 -ne `wc -c <'bwbasic-2.10/bwbtest/dataread.bas'`; then
  2291.     echo shar: \"'bwbasic-2.10/bwbtest/dataread.bas'\" unpacked with wrong size!
  2292.   fi
  2293.   # end of 'bwbasic-2.10/bwbtest/dataread.bas'
  2294. fi
  2295. echo shar: End of archive 1 \(of 15\).
  2296. cp /dev/null ark1isdone
  2297. MISSING=""
  2298. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  2299.     if test ! -f ark${I}isdone ; then
  2300.     MISSING="${MISSING} ${I}"
  2301.     fi
  2302. done
  2303. if test "${MISSING}" = "" ; then
  2304.     echo You have unpacked all 15 archives.
  2305.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2306. else
  2307.     echo You still must unpack the following archives:
  2308.     echo "        " ${MISSING}
  2309. fi
  2310. exit 0
  2311. exit 0 # Just in case...
  2312.