Updated with IF THEN ELSE implemented status.

This commit is contained in:
Brian J. Bernstein 2021-06-18 17:21:36 -04:00
parent 97acd2e1ce
commit de67c3aacb
1 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
## Words
| Word | Syntax | Status | Short | Description | Comment |
|-|-|-|-|-|-|
| Word | Syntax | Status | Short | Description | Comment |
| ADDINT | ADDINT (*string1* [,*string2*...]) | Not Yet Implemented | Add keys to the interrupt table. | The <tt>ADDINT</tt> command will add more keys to the existing interrupt keys table. previous keys will not be cleared. The functions of the keys is the same as with the <tt>SETINT</tt> command. | |
| APPEND | APPEND #*device* | Not Yet Implemented | Set write operations for specified device to append to the end. | The <tt>APPEND</tt> statement is generally used to add data to an existing file. If you issue an <tt>APPEND</tt> statement, the file pointer will be moved to the end of the file. You can also find out the length of a file by doing an <tt>APPEND</tt> and then using the <tt>MARK</tt> function. Mark will then return the length of the file in bytes. | |
| BYTE | byte=*number*<br>byte=(*number*)<br>byte=(*number*)=*number*256 | Not Yet Implemented | Byte-level data manipulation function. | The <tt>BYTE</tt> function is similar to the <tt>FLAG</tt> function. It is a low overhead data storage unit. Just point to where in memory you want the data to be stored using the first syntax, and you can then access the data using the second or third syntax's. | |
@ -20,6 +21,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
| DATE$ | *string*=DATE$ | Not Yet Implemented | Return string with current date. | The <tt>DATE$</tt> function returns the current date in MM/DD/YY format. The input will be taken from whatever device was configured as a clock. If 00/00/00 is returned, then there is no clock in the system and the date hasn't been set. | |
| ECHO | ECHO=*string*<br>ECHO="" | Not Yet Implemented | Specify or clear characters to be echoed during user input. | The <tt>ECHO</tt> statement is used to set the echo character to be used with the <tt>INPUT</tt> statement (e.g <code>ECHO="\*"</code> will mask password entry with asterisks). Once the echo has been set, that character will be sent each time a user types a character when entering text. The <tt>ECHO</tt> statement in the second syntax (setting to an empty string) will reset the echo function to normal where user input will send the character that is being typed. | |
| EDIT | EDIT(*number*) | Not Yet Implemented | Text editor operations. | The <tt>EDIT</tt> statement is the command used to interface ACOS with its editor. With the different <tt>EDIT</tt> statements, you can clear the editor, see how much space is free, etc. The following list gives all legal calls:<p><ul><li><tt>EDIT(0)</tt>- clears the editor. there will be a total of 4096 bytes free after a clear takes place.<br><li><tt>EDIT(1)</tt>- enter the editor. If no data is present, the editor will start to accept input right away. If other data is present, the editor will start in the prompt mode.<br><li><tt>EDIT(2)</tt>- this is a function that returns the number of bytes used within the editor. If this number equals 0 the editor is empty.<br><li><tt>EDIT(3)</tt>- this is used to set the video width to be used within the editor. Any value from 1 to 255 is legal. the most often used widths are 32, 40, 64, 80, 128. All operations within the editor will be based around this width. You can also read the current width using <tt>EDIT(3)</tt> as a function.<br><li><tt>EDIT(4)</tt>- this is used to set the 'back-space mode' that the editor will use. Certain modes allow more control than others. Mode 0 indicates that the actual mode is not known. The editor will work fine, but some functions will be disabled. Under mode 1, the editor will assume that the user has a 'non-destructible' backspace. This allows all the editor functions to be used and is how the local console is setup. Mode 2 tells the editor that the user has a 'destructible' backspace. Under this mode, some functions are disabled, but the editor speeds up certain other functions. | |
| ELSE | ELSE | Impl. | Failure result operator for IF THEN ELSE statements. | See <tt>IF</tt> statement. | |
| END | END | Not Yet Implemented | Terminate program. | Same as AppleSoft, this command terminates program. Returns to ACOS restart state. REMY TODO: Does this just return to A2osX shell? | |
| FILL | FILL *start*, *length*, *data* | Not Yet Implemented | Fill an area of memory with specified data. | The <tt>FILL</tt> statement is used to fill an area of memory with some bytes of data. Generally it is used to zero out memory. *start* is a 16 bit memory address, *length* is an 8 bit [0-255] number, and *data* is the byte that will be used to fill memory. | |
| FLAG | *variable*=FLAG<br>FLAG=*memloc*<br>FLAG=(*flagnum*)<br>FLAG(*flagnum*)=*value* | Not Yet Implemented | Bit-level data manipulation function. | The <tt>FLAG</tt> function is a low overhead way to store 1 bit information. You just need to point the <tt>FLAG</tt> function to a point in memory (typically 'ram' or 'ram2') that you wish to store your data in, and you can manipulate as many flags as you need. Each byte of memory can contain 8 flags.<p>To setup the <tt>FLAG</tt> function, you need to first point it to a location in memory (*memloc*), which is typically 'ram' or 'ram2', but you can specify an offset, e.g. <code>FLAG=ram+20</code> will specify that you're using the 20th byte inside of the 'ram' location.<p>Once the pointer is set up, you can use the <tt>FLAG</tt> function just like any variable using the remaining syntax forms outlined for reading/writing flags. | |
@ -29,13 +31,13 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
| GOSUB | GOSUB *label* | Impl. | Call subroutine at specified label. | Calls subroutine *label* in the program and sets the point in code so that when a <tt>RETURN</tt> function is encountered, execution will resume after the <code>GOSUB</code> statement. While behaves the same way as AppleSoft basic, it is worth pointing out that ACOS uses labels as targets instead of line numbers. | |
| GOTO | GOTO *label* | Impl. | Redirect program execution to specified label. | Redirects program execution to continue from *label*. Unlike <tt>GOSUB</tt>, no record of where the <tt>GOTO</tt> call occurred. As with <tt>GOSUB</tt>, it is worth pointing out that ACOS uses labels as targets intead of line number. | |
| HOME | HOME | Not Yet Implemented | Clear screen. | Clears the screen and positions the cursor at the top left. REMY TODO: Does this clear the remote session as well? | |
| IF | IF *condition* [THEN] *statement1* [ELSE] *statement2* | In Development | Logical condition test and execution. | Evaluate *condition* and if true (or greater than zero), execute *statement1*. If optional <tt>ELSE</tt> keyword is specified, then a false condition will execute *statement2*. If <tt>ELSE</tt> is used, it must appear on the same line as the <tt>IF</tt> statement, i.e. there is no multi-line if/then/else construct like some other languages. Logical constructs for *condition* supports parenthesis, <tt>AND</tt>, and <tt>OR</tt>.<p><tt>THEN</tt> is optional (as it is in AppleSoft BASIC) but if you use THEN, it cannot be followed by a label directly.(use IF arg THEN GOTO label). | |
| IF | IF *condition* [THEN] *statement1* [ELSE] *statement2* | Impl. | Logical condition test and execution. | Evaluate *condition* and if true (or greater than zero), execute *statement1*. If optional <tt>ELSE</tt> keyword is specified, then a false condition will execute *statement2*. If <tt>ELSE</tt> is used, it must appear on the same line as the <tt>IF</tt> statement, i.e. there is no multi-line if/then/else construct like some other languages. Logical constructs for *condition* supports parenthesis, <tt>AND</tt>, and <tt>OR</tt>.<p><tt>THEN</tt> is optional (as it is in AppleSoft BASIC) but if you use THEN, it cannot be followed by a label directly.(use IF arg THEN GOTO label). | |
| INFO | *expression*=INFO(*optional*)<br>INFO(*optional*)=*expression* | Not Yet Implemented | Byte-level data manipulation function, specific to ACOS internals. | INFO can be used as either a statement or as a function. It is really a 'catch-all' of ACOS state value functions in nature in that many values that are more or less unrelated are accessible through it. The following table gives the meanings of all the INFO data.<p><pre>argument r/w function<br>-------- ---- -----------------<br>INFO(0) r is there a caller online? (0=no)<br>INFO(1) r capacity of current message file.<br>INFO(2) r callers baud rate /300 (1=300)<br>INFO(3) r/w current number of nulls.<br>INFO(4) w top screen stats. (1=chat, 2=exec)<br>INFO(5) r/w executive user online? (1=yes)<br>INFO(6) r checks bit map for mail/msg bases for room.</pre> | |
| INPUT | INPUT [#*device*,] [@*mode*,] [\\] ["*text*"] *variable* [,[\\] *variable*..] | Not Yet Implemented | Get input from user, device, or file. | Gets input from a device or interactively with the user and stores the result in one-to-many variables. There are quite a few variations how the <tt>INPUT</tt> statement can be used, but at a minimum it requires one *variable* to be specified. <p> Specifying the *device* is required if inputting data from a device handle (e.g. an open file). Omitting the *device* will default to getting input from the user. <p> A text prompt can be optionally specified by supplying *text* before the variables. The text can serve as a prompt (e.g. "What is your name? *input here*"). If backslash (\\) is put before or after the *text*, this will result in a newline being part of the prompt (note distinction between this and using backslash for multiple variables). <p> Multiple variables can be specified in either a comma-separated or backslash (\\) way (or a mixture thereof), though this is typically for file input rather than interactive user input. As with the <tt>PRINT</tt> statement, the comma is taken literally (e.g. if you were to read multiple fields from a comma-separated file), and the backslash as part of the variable list implies that there will be a newline to parse (e.g. <code>INPUT #1, A\$\\B\$</code> reads two lines from the file, <tt>A\$</tt> on the first line and <tt>B\$</tt> on the second line). <p> The *mode* (with '@' symbol prefix) is an optional way of specifying how the <tt>INPUT</tt> command will behave. Using *mode* is ONLY for interactive input and cannot be combined with a *device*. The various modes are as follows: <p> <ul><li><tt>INPUT</tt> - (no mode specified) set the input mode to uppercase, don't accept a blank line. <li><tt>INPUT @0</tt> - set the input mode to uppercase, don't accept a blank line, just return the first character. <li><tt>INPUT @1</tt> - set the input mode to uppercase, don't accept a blank line, don't accept any commas. <li><tt>INPUT @2</tt> - set the input mode to uppercase, blank lines will be accepted. <li><tt>INPUT @3</tt> - accept everything. (upper & lower). </ul> | |
| INSTR | *expression*=INSTR(*match*, *source*) | Not Yet Implemented | Find a string within another and return offset if found. | The <tt>INSTR</tt> function is used to search within a *source* string for the existence of the specified *match* string. The search is case insensitive. The function will return the numerical position of the first character in the *source* string where the *match* was found. Note that the first character in *source* string starts at <tt>1</tt>, not <tt>0</tt> like many other languages. So in other words, if the function returns zero, no match was found. | |
| KEY | *expression*=KEY(0)<br>*expression*=KEY(1)<br>*expression*=KEY(2) | Not Yet Implemented | Return what key from the interrupt table was caught. | The <tt>KEY</tt> function is used to check and see what if any keys have been pressed. It is generally used to check to see if a routine needs to be interrupted and is used in conjunction with the <tt>SETINT</tt> and <tt>ADDINT</tt> statements. This routine is not blocking and does not wait for a key; it returns either a zero for no key or the ASCII value of the key. In the <tt>KEY(1)</tt> form, a non-zero byte will be returned if the key pressed was the 'file stop' character. In the <tt>KEY(2)</tt> form, a non-zero byte will be returned if the pressed key is the 'file next' key defined in config. | |
| KILL | KILL *filename*<br>KILL #MSG(*expression*) | Not Yet Implemented | Delete a file or message. | The <tt>KILL</tt> statement can be used in two different ways. In both ways it is used to delete data. In the first form, with the *filename,* it will delete the file from disk. In its second form, it will delete a message within the currently active message base. After using <tt>KILL</tt> on a message, it is always a good idea to follow it with an <tt>UPDATE</tt> to make sure the modified message database is persisted to disk. | |
| LEFT$ | *string*=LEFT$(*source*, *length*) |Impl. | Return a number of characters from the start of a string. | Returns the first *length* characters of *source* string. | |
| LEFT$ | *string*=LEFT$(*source*, *length*) | Impl. | Return a number of characters from the start of a string. | Returns the first *length* characters of *source* string. | |
| LEN | *expression*=LEN(*string*) | Impl. | Return the length of a string. | Returns the length of the supplied *string*. A result of zero means the string is empty. | |
| LINK | LINK *filename* [,*label*] | Not Yet Implemented | Load and execute another ACOS script. | The <tt>LINK</tt> statement allows you to load a different program segment and execute that one, optionally starting at a specified *label*. The purpose of this is to allow for your code to be split up into multiple segments, but also to support additional code to be used without modifying the other. The *filename* argument is mandatory and is in the standard filename syntax. If you wish the execution to begin at a point other than the beginning of the module, then the *label* argument can be specified in string form (e.g. <code>LINK "A:MSG.SEG","BULLETINS"</code>). The label must be enclosed in quotes or must be in a string variable. Note that for the label to be usable by the <tt>LINK</tt> command, the label must be declared as <tt>PUBLIC</tt> in the target file. | |
| LOG | LOG *drivespec* | Not Yet Implemented | Change current filesystem drive. | The <tt>LOG</tt> statement simply changes the default disk drive to the *drivespec* drive. If the drive is not legal, a BAD DRIVE SPECIFIER error will occur. | |
@ -81,7 +83,6 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
| WRITE | WRITE #*device*, *memloc*, *number* | Not Yet Implemented | Writes binary data. | The <tt>WRITE</tt> statement is the opposite of the <tt>READ</tt> statement. It is used to write unprocessed binary data from memory to a file or other device. Almost all the device channels can be written and none will generate errors. Just specify the memory location and length to be written. BJB TODO: Need to expand on this for the arguments. | |
## License
A2osX is licensed under the GNU General Pulic License |