📄 bwbasic.doc
字号:
Description: COS returns the cosine of the argument 'number' in radians. Dependencies: (core) ------------------------------------------ Function: CSNG( number ) Description: CSNG is a pseudo-function that has no effect under bwBASIC. It replicates a Microsoft-type command that would convert the 'number' to single-precision. Dependencies: MS_FUNCS ------------------------------------------ Function: CVD( string$ ) Description: CVD converts the argument string$ into a bwBASIC number (precision is irrelevant in bwBASIC since bwBASIC numbers have only one precision). Implenentation-Specific Notes: CVD(), CVI(), CVS(), MKI$(), MKD$(), MKS$(): These functions are implemented, but are dependent on a) the sizes for integer, float, and double values on particular systems, and b) how particular versions of C store these numerical values. The implication is that data files created using these functions on a DOS-based microcomputer may not be translated correctly by bwBASIC running on a Unix-based computer. Similarly, data files created by bwBASIC compiled by one version of C may not be readable by bwBASIC compiled by another version of C (even under the same operating system). So be careful with these. Dependencies: MS_FUNCS ------------------------------------------ Function: CVI( string$ ) Description: CVI converts the argument string$ into a bwBASIC number (precision is irrelevant in bwBASIC since bwBASIC numbers have only one precision; see also the note on CVD). Dependencies: MS_FUNCS ------------------------------------------ Function: CVS( string$ ) Description: CVI converts the argument string$ into a bwBASIC number (precision is irrelevant in bwBASIC since bwBASIC numbers have only one precision; see also the note on CVD). Dependencies: MS_FUNCS ------------------------------------------ Command: DATA constant[,constant]... Description: DATA stores numerical and string constants to be accessed by READ (q.v.). Dependencies: (core) ------------------------------------------ Function: DATE$ Description: DATE$ returns the current date based on the computer's internal clock as a string in the form "YYYY-MM-DD". As implemented under bwBASIC, DATE$ cannot be used for assignment (i.e., to set the system date). Note: bwBASIC presently (v2.10) does not allow assignment to a function. Dependencies: COMMON_FUNCS ------------------------------------------ Command: DEF FNname(arg...)] = expression Description: DEF defines a user-written function. This function corresponds to Microsoft-type implementation, although in bwBASIC DEF is a working equivalent of FUNCTION. Dependencies: (core) ------------------------------------------ Command: DEFDBL letter[-letter](, letter[-letter])... Description: DEFDBL declares variables with single-letter names as numerical variables (precision is irrelevant in bwBASIC). Dependencies: MS_CMDS ------------------------------------------ Command: DEFINT letter[-letter](, letter[-letter])... Description: DEFINT declares variables with single-letter names as numerical variables (precision is irrelevant in bwBASIC). Dependencies: MS_CMDS ------------------------------------------ Command: DEFSNG letter[-letter](, letter[-letter])... Description: DEFSNG declares variables with single-letter names as numerical variables (precision is irrelevant in bwBASIC). Dependencies: MS_CMDS ------------------------------------------ Command: DEFSTR letter[-letter](, letter[-letter])... Description: DEFSTR declares variables with single-letter names as string variables. Dependencies: MS_CMDS ------------------------------------------ Command: DELETE line[-line] Description: DELETE deletes program lines indicated by the argument(s). If you want to use DELETE for non- numbered programs, first use DO NUM, then DELETE, then DO UNNUM. Dependencies: INTERACTIVE ------------------------------------------ Command: DIM variable(elements...)[variable(elements...)]... Description: DIM specifies variables that have more than one element in a single dimension, i.e., arrayed variables. Note: As implemented under bwBASIC, DIM accepts only parentheses as delimiters for variable fields. (Some BASICs allow the use of square brackets.) Dependencies: (core) ------------------------------------------ Command: DO NUM|UNNUM Description: DO NUM numbers all lines in a program. The first line is given the number 10, and subsequent lines are numbered consecutively in multiples of 10. DO UNNUM removes all line numbers from a program. NOTE that these functions do nothing to line numbers, e.g., following a GOSUB or GOTO statement; these commands cannot be used as a replacement for RENUM (available in some systems, but not bwBASIC). With these commands, however, one can develop unnumbered programs by entering new lines with numbers, then running DO UNNUM to remove the line numbers. Together with LOAD and SAVE (q.v.) one can use bwBASIC as a primitive text editor. Dependencies: INTERACTIVE ------------------------------------------ Command: DO [WHILE expression] Description: DO implements a number of forms of program loops. DO...LOOP simply loops; the only way out is by EXIT; DO WHILE...LOOP loops while "expression" is true (this is equivalent to the older WHILE-WEND loop, also implemented in bwBASIC); DO...LOOP UNTIL loops until the expression following UNTIL is true. Dependencies: STRUCT_CMDS ------------------------------------------ Command: EDIT Description: EDIT is a pseudo-command which calls the text editor specified in the variable BWB.EDITOR$ to edit the program in memory. After the call to the text editor, the (edited) prgram is reloaded into memory. The user normally must specific a valid path and filename in BWB.EDITOR$ before this command will be useful. Dependencies: COMMON_CMDS ------------------------------------------ Command: ELSE Description: ELSE introduces a default condition in a multi-line IF statement. Dependencies: STRUCT_CMDS ------------------------------------------ Command: ELSEIF Description: ELSEIF introduces a secondary condition in a multi- line IF statement. Dependencies: STRUCT_CMDS ------------------------------------------ Command: END IF | FUNCTION | SELECT | SUB Description: END IF ends a multi-line IF statement. END FUNCTION ends a multi-line function definition. END SELECT ends a SELECT CASE statement. END SUB ends a multi- line subroutine definition. Dependencies: STRUCT_CMDS ------------------------------------------ Command: ENVIRON variable-string$ = string$ Description: ENVIRON sets the environment variable identified by variable-string$ to string$. It might be noted that this differs from the implementation of ENVIRON in some versions of BASIC, but bwBASIC's ENVIRON allows BASIC variables to be used on either side of the equals sign. Note that the function ENVIRON$() is different from the command, and be aware of the fact that in some operating systems an environment variable set within a program will not be passed to its parent shell. Dependencies: UNIX_CMDS ------------------------------------------ Function: ENVIRON$( variable-string$ ) Description: ENVIRON$ returns the environment variable associated with the name variable-string$. Dependencies: MS_FUNCS ------------------------------------------ Function: EOF( device-number ) Description: EOF returns TRUE (-1) if the device associated with device-number is at the end-of-file, otherwise it returns FALSE (0). Dependencies: MS_FUNCS ------------------------------------------ Command: ERASE variable[, variable]... Description: ERASE eliminates arrayed variables from a program. Dependencies: COMMON_CMDS ------------------------------------------ Function: ERL Description: ERL returns the line number of the most recent error. Dependencies: MS_FUNCS ------------------------------------------ Function: ERR Description: ERR returns the error number of the most recent error. Note that if PROG_ERRORS has been defined when bwBASIC is compiled, the ERR variable will not be set correctly upon errors. It only works when standard error messages are used. Dependencies: MS_FUNCS ------------------------------------------ Command: ERROR number Description: ERROR simulates an error, i.e., displays the message appropriate for that error. This command is helpful in writing ON ERROR GOSUB routines that can identify a few errors for special treatment and then ERROR ERR (i.e., default handling) for all others. Dependencies: COMMON_CMDS ------------------------------------------ Command: EXIT [FOR] Description: EXIT by itself exits from a DO...LOOP loop; EXIT FOR exits from a FOR...NEXT loop. Dependencies: STRUCT_CMDS ------------------------------------------ Function: EXP( number ) Description: EXP returns the exponential value of 'number'. Dependencies: (core) ------------------------------------------ Command: FIELD [#] device-number, number AS string-variable$ [, number AS string-variable$...] Description: FIELD allocates space in a random file buffer for device indicated by device-number, allocating 'number' bytes and assigning the bytes at this position to the variable string-variable$. Dependencies: COMMON_CMDS ------------------------------------------ Command: FILES filespec$ Description: FILES is a pseudocommand that invokes the directory program specified in the variable BWB.FILES$ with the argument filespec$. Normally, the user must set this variable before FILES can be used. E.g., for PC-type computers, BWB.FILES$ = "DIR" will work, for Unix machines, BWB.FILES$ = "ls -l" etc. Dependencies: COMMON_CMDS ------------------------------------------ Command: FNCS Description: CMDS is a debugging command that prints a list of all pre-defined bwBASIC functions. Dependencies: DEBUG ------------------------------------------ Command: FUNCTION Description: FUNCTION introduces a function definition, normally ending with END FUNCTION. In bwBASIC, FUNCTION and DEF are qorking equivalents, so either can be used with single-line function definitions or with multi- line definitions terminated by END FUNCTION. Dependencies: STRUCT_CMDS ------------------------------------------ Command: FOR counter = start TO finish [STEP increment] Description: FOR initiates a FOR-NEXT loop with the variable 'counter' initially set to 'start' and incrementing in 'increment' steps (default is 1) until 'counter' equals 'finish'. Dependencies: (core) ------------------------------------------ Command: GET [#] device-number [, record-number] Description: GET reads the next reacord from a random-access file or device into the buffer associated with that file. If record-number is specified, the GET command reads the specified record. Dependencies: COMMON_CMDS ------------------------------------------ Command: GOSUB line | label Description: GOSUB initiates a subroutine call to the line (or label) specified. The subroutine must end with RETURN. Dependencies: (core), but STRUCT_CMDS for labels ------------------------------------------ Command: GOTO line | label Description: GOTO branches program execution to the specified line (or label). Dependencies: (core), but STRUCT_CMDS for labels ------------------------------------------ Function: HEX$( number ) Description: HEX$ returns a string giving the hexadecimal (base 16) value for the 'number'. Dependencies: MS_FUNCS ------------------------------------------ Command: IF expression THEN [statement [ELSE statement]] Description: IF evaluates 'expression' and performs the THEN statement if it is true or (optionally) the ELSE statement if it is FALSE. If STRUCT_CMDS is set to TRUE, bwBASIC allows multi-line IF statements with ELSE and ELSEIF cases, ending with END IF. Dependencies: (core), STRUCT_CMDS for multi-line IF statements ------------------------------------------ Function: INKEY$ Description: INKEY$ reads the status of the keyboard, and a single keypress, if available. If a keypress is not available, then INKEY$ immediately returns a null string (""). Currently (v2.10) implemented in bwx_iqc.c only. Dependencies: IMP_IQC and IMP_CMDLOC ------------------------------------------ Command: INPUT [# device-number]|[;]["prompt string";]list of variables Description: INPUT allows input from the terminal or a device specified by device-number. If terminal, the "prompt string" is output, and input is assigned to the appropriate variables specified. bwBASIC does not support the optional feature of INPUT that suppresses the carriage-return and line-feed at the end of the input. This is because C alone does not provide for any means of input other than CR-LF-terminated strings. Dependencies: (core) ------------------------------------------ Function: INSTR( [start-position,] string-searched$, string-pattern$ ) Description: INSTR returns the position at which string-pattern$
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -