⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bwbasic.doc

📁 这是一个简易的basic语言解释器, 可供我们学习和改进.
💻 DOC
📖 第 1 页 / 共 4 页
字号:
                 occurs in string-searched$, beginning at start-position.                 As implemented in bwBASIC, INSTR cannot be used for                 assignments.   Note:	 bwBASIC presently (v2.10) does not allow assignment		 to a function.   Dependencies: MS_FUNCS   ------------------------------------------   Function:     INT( number )   Description:  INT returns the largest integer less than or equal to                 the argument 'number'. NOTE that this is not a "truncated"                 integer function, for which see CINT.   Dependencies: (core)   ------------------------------------------   Command:      KILL file-name$   Description:  KILL deletes the file specified by file-name$.   Dependencies: UNIX_CMDS   ------------------------------------------   Function:     LEFT$( string$, number-of-spaces )   Description:  LEFT$ returns a substring a string$ with number-of-spaces                 from the left (beginning) of the string). As implemented                 under bwBASIC, it cannot be used for assignment.   Dependencies: MS_FUNCS   ------------------------------------------   Function:     LEN( string$ )   Description:  LEN returns the length in bytes of string$.   Dependencies: COMMON_FUNCS   ------------------------------------------   Command:      LET variable = expression   Description:  LET assigns the value of 'expression' to the variable.                 As currently implemented, bwBASIC supports implied LET                 statements (e.g., "X = 4.5678" at the beginning of                 a line or line segment, but does not support assignment                 to multiple variables (e.g., "x, y, z = 3.141596").   Dependencies: (core)   ------------------------------------------   Command:      LINE INPUT [[#] device-number,]["prompt string";] string-variable$   Description:  LINE INPUT reads entire line from the keyboard or a file                 or device into string-variable$.  If input is from the                 keyboard (stdin), then "prompt string" will be printed                 first.  Unlike INPUT, LINE INPUT reads a whole line,                 not stopping for comma-delimited data items.   Dependencies: COMMON_CMDS   ------------------------------------------   Command:      LIST line[-line]   Description:  LIST lists program lines as specified in its argument.   Dependencies: INTERACTIVE   ------------------------------------------   Command:      LOAD file-name   Description:  LOAD loads an ASCII BASIC program into memory.   Dependencies: INTERACTIVE   ------------------------------------------   Function:     LOC( device-number )   Description:  LOC returns the next record that GET or PUT statements                 will use.   Dependencies: MS_FUNCS   ------------------------------------------   Command:      LOCATE line, column   Description:  LOCATE addresses trhe curor to a specified line and		 column. Currently (v2.10) implemented in bwx_iqc.c only.   Dependencies: IMP_IQC and IMP_CMDLOC   ------------------------------------------   Function:     LOF( device-number )   Description:  LOF returns the length of a file (specified by device-number)                 in bytes.   Dependencies: MS_FUNCS   ------------------------------------------   Function:     LOG( number )   Description:  LOG returns the natural logarithm of the argument 'number'.   Dependencies: (core)   ------------------------------------------   Command:      LOOP [UNTIL expression]   Description:  LOOP terminates a program loop:  see DO.   Dependencies: STRUCT_CMDS   ------------------------------------------   Command:      LSET string-variable$ = expression   Description:  LSET transfers data from 'expression' to the left-hand                 side of a string variable or random access buffer field.   Dependencies: COMMON_CMDS   ------------------------------------------   Command:      MERGE file-name   Description:  MERGE adds program lines from 'file-name' to the program                 in memory.  Unlike LOAD, it does not clear the program                 currently in memory.   Dependencies: COMMON_CMDS   ------------------------------------------   Function:     MID$( string$, start-position-in-string[, number-of-spaces ] )   Description:  MID$ returns a substring of string$ beginning at                 start-position-in-string and continuing for                 number-of-spaces bytes.   Dependencies: MS_FUNCS   ------------------------------------------   Command:      MKDIR pathname$   Description:  MKDIR creates a new directory path as specified by                 pathname$.   Dependencies: UNIX_CMDS   ------------------------------------------   Function:     MKD$( number )   Description:  MKD$, MKI$, and MKS$ are all equivalent in bwBASIC.                 They convert the numerical value 'number' into a string                 which can be stored in a more compressed form in a file                 (especially for random file access).  Since bwBASIC does                 not recognize differences in precision, these commands                 are effectively equivalent.   Dependencies: MS_FUNCS   ------------------------------------------   Function:     MKI$( number )   Description:  Equivalent to MKD$ (q.v.)   Dependencies: MS_FUNCS   ------------------------------------------   Function:     MKS$( number )   Description:  Equivalent to MKD$ (q.v.).   Dependencies: MS_FUNCS   ------------------------------------------   Command:      NAME old-file-name AS new-file-name   Description:  NAME renames an existing file (old-file-name) as                 new-file-name.   Dependencies: UNIX_CMDS   ------------------------------------------   Command:      NEW   Description:  NEW deletes the program in memory and clears all                 variables.   Dependencies: INTERACTIVE   ------------------------------------------   Command:      NEXT [counter-variable]   Description:  NEXT comes at the end of a FOR-NEXT loop; see FOR.   Dependencies: (core)   ------------------------------------------   Function:     OCT$( number )   Description:  OCT$ returns a string giving the octal (base 8)                 representation of 'number'.   Dependencies: MS_FUNCS   ------------------------------------------   Command:      ON variable GOTO|GOSUB line[,line,line,...]   Description:  ON either branches (GOTO) or calls a subroutine                 (GOSUB) based on the rounded value of variable;                 if it is 1, the first line is called, if 2, the second                 line is called, etc.   Dependencies: (core)   ------------------------------------------   Command:      ON ERROR GOSUB line|label   Description:  ON ERROR sets up an error handling subroutine. See                 also ERROR.   Dependencies: COMMON_CMDS, STRUCT_CMDS for labels   ------------------------------------------   Command:      OPEN "O"|"I"|"R", [#]device-number, file-name [,record length]                      file-name FOR INPUT|OUTPUT|APPEND AS [#]device-number [LEN = record-length]   Description:  OPEN allocates random access memory for access to a disk                 file or other device.  Note that two quite different forms                 of the OPEN statement are supported. In the first form,                 "O" (note that these letters must be encased in quotation                 marks) denotes sequential output, "I" denotes sequential                 input, and "R" denotes random-access input and output.                 Once OPEN, any number of operations can be performed                 on a device (see WRITE #, INPUT #, PRINT #, etc.).   Dependencies: COMMON_CMDS   ------------------------------------------   Command:      OPTION BASE number   Description:  OPTION BASE sets the lowest value for array subscripts,                 either 0 or 1.   Dependencies: (core)   ------------------------------------------   Function:     POS   Description:  POS returns the current cursor position in the line.   Dependencies: COMMON_FUNCS   ------------------------------------------   Command:      PRINT [# device-number,][USING format-string$;] expressions...   Description:  PRINT outputs text to the screen or to a file or device                 specified by device-number. In the current implementation                 of bwBASIC, expressions to be printed must be separated by                 the comma (tabbed output), the semicolon (immediate                 sequential output) or the plus sign (immediate sequential                 output by string concatenation).  Expressions separated                 by blanks or tabs are not supported. If USING is specified,                 a number of formatting marks may appear in the format                 string:                    !	prints the first character of a string                    \\	prints 2+x characters of a string, where x =                        the number of spaces between the backslashes                    &	variable-length string field                    #	represents a single digit in output format for                    	a number                    .	decimal point in a number                    +	sign of a number (will output + or -)                    -	trailing minus after a number                    **	fill leading spaces with asterisks                    $$	output dollar sign in front of a number                    ^^	output number in exponential format                    _	output next character literally                 As currently implemented, the exponential format                 will be that used by the C compiler.   Dependencies: (core), COMMON_FUNCS for USING   ------------------------------------------   Command:      PUT [#] device-number [, record-number]   Description:  PUT outputs the next available record or the record                 specified by record-number to the file or device                 denoted by device-number.   Dependencies: COMMON_CMDS   ------------------------------------------   Command:      QUIT   Description:  QUIT is a synonym for SYSTEM; with INTERACTIVE		 environment, it exits the program to the 		 operating system (or the calling program).   Dependencies: INTERACTIVE   ------------------------------------------   Command:      RANDOMIZE number   Description:  RANDOMIZE seeds the random number generator (see RND).                 Under bwBASIC, the TIMER function (q.v.) can be used                 to supply a 'number' seed for the random number                 generator.   Dependencies: (core)   ------------------------------------------   Command:      READ variable[, variable]...   Description:  READ reads values from DATA statements and assigns these                 values to the named variables.  Variable types in a READ                 statement must match the data types in DATA statements                 as they are occurred.  See also DATA and RESTORE.   Dependencies: (core)   ------------------------------------------   Command:      REM string   Description:  REM allows remarks to be included in a program. As                 currently implemented, the entire line following                 REM is ignored by the interpreter (thus, even if                 MULTISEG_LINES is set, a REM line will not be able                 to find a segment delimiter (":") followed by another                 line segment with command.  bwBASIC does not currently                 implement the Microsoft-style use of the single quotation                 mark to denote remarks.   Dependencies: (core)   ------------------------------------------   Command:      RESTORE line   Description:  RESTORE resets the line and position counters for DATA                 and READ statements to the top of the program file or                 to the beginning of the specified line.  (Currently this                 must be a line number.)   Dependencies: (core)   ------------------------------------------   Command:      RETURN   Description:  RETURN concludes a subroutine called by GOSUB.   Dependencies: (core)   ------------------------------------------   Function:     RIGHT$( string$, number-of-spaces )   Description:  RIGHT$ returns a substring a string$ with number-of-spaces                 from the right (end) of the string). As implemented                 under bwBASIC, it cannot be used for assignment.   Dependencies: MS_FUNCS   ------------------------------------------   Command:      RMDIR pathname   Description:  RMDIR deletes the directory path indicated by pathname.   Dependencies: UNIX_CMDS   ------------------------------------------   Function:     RND( number )   Description:  RND returns a pseudo-random number.  The 'number' value                 is ignored by bwBASIC if supplied. The RANDOMIZE                 command (q.v.) reseeds the random-number generator.   Dependencies: (core)   ------------------------------------------   Command:      RSET string-variable$ = expression   Description:  RSET transfers data from 'expression' to the right-hand                 side of a string variable or random access buffer field.   Dependencies: COMMON_CMDS   ------------------------------------------   Command:      RUN [line][file-name$]   Description:  RUN executes the program in memory.  If a file-name$ is                 supplied, then the specified file is loaded into memory                 and executed.  If a line number is supplied, then execution                 begins at that line.   Dependencies: INTERACTIVE   ------------------------------------------   Command:      SAVE file-name$   Description:  SAVE saves the program in memory to file-name$. bwBASIC                 only saves files in ASCII format.   Dependencies: INTERACTIVE   ------------------------------------------   Command:      SELECT CASE expression   Description:  SELECT CASE introduces a multi-line conditional selection                 statement.  The expression given as the argument to SELECT                 CASE will be evaluated by CASE statements following.  The                 SELECT CASE statement conclludes with an END SELECT                 statement.                 As currently implemented, CASE statements may be followed                 by string values, but in this case only simple comparisons

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -