mirror of
https://github.com/badvision/lawless-legends.git
synced 2024-08-25 12:28:55 +00:00
Update User Manual.md
This commit is contained in:
parent
ef58031f43
commit
ee4597734c
@ -157,11 +157,11 @@ Excaped characters, like the `\n` above are replaces with the Carriage Return ch
|
|||||||
|
|
||||||
| Escaped Char | ASCII Value
|
| Escaped Char | ASCII Value
|
||||||
|:------------:|------------
|
|:------------:|------------
|
||||||
| \n | NL
|
| \n | LF
|
||||||
| \t | TAB
|
| \t | TAB
|
||||||
| \r | CR
|
| \r | CR
|
||||||
| \\\\ | \
|
| \\\\ | \
|
||||||
| \\0 | 0
|
| \\0 | NUL
|
||||||
|
|
||||||
### Words
|
### Words
|
||||||
Words, 16 bit signed values, are the native sized quanta of PLASMA. All calculations, parameters, and return values are words.
|
Words, 16 bit signed values, are the native sized quanta of PLASMA. All calculations, parameters, and return values are words.
|
||||||
@ -389,13 +389,13 @@ PLASMA implements most of the control flow that most higher level languages prov
|
|||||||
Function calls are the easiest ways to pass control to another function. Function calls can be part of an expression, or be all by itself - the same as an empty assignment statement.
|
Function calls are the easiest ways to pass control to another function. Function calls can be part of an expression, or be all by itself - the same as an empty assignment statement.
|
||||||
|
|
||||||
##### RETURN
|
##### RETURN
|
||||||
`RETURN` will exit the current definition. An optional value can be returned, however, if a value isn't specified a default of zero will be returned. All definitions return a value, regardless of whether it used or not.
|
`return` will exit the current definition. An optional value can be returned, however, if a value isn't specified a default of zero will be returned. All definitions return a value, regardless of whether it used or not.
|
||||||
|
|
||||||
##### IF/[ELSIF]/[ELSE]/FIN
|
##### IF/[ELSIF]/[ELSE]/FIN
|
||||||
The common `IF` test can have optional `ELSIF` and/or `ELSE` clauses. Any expression that is evaluated to non-zero is treated as TRUE, zero is treated as FALSE.
|
The common `if` test can have optional `elsif` and/or `else` clauses. Any expression that is evaluated to non-zero is treated as TRUE, zero is treated as FALSE.
|
||||||
|
|
||||||
##### WHEN/IS/[OTHERWISE]/WEND
|
##### WHEN/IS/[OTHERWISE]/WEND
|
||||||
The complex test case is handled with `WHEN`. Basically a `IF`, `ELSIF`, `ELSE` list of comparisons, it is gernerally more efficient. The `IS` value can be any expression. It is evaluated and tested for equality to the `WHEN` value.
|
The complex test case is handled with `when`. Basically a `if`, `elsifF`, `else` list of comparisons, it is gernerally more efficient. The `is` value can be any expression. It is evaluated and tested for equality to the `when` value.
|
||||||
```
|
```
|
||||||
when key
|
when key
|
||||||
is 'A'
|
is 'A'
|
||||||
@ -428,8 +428,8 @@ when TRUE
|
|||||||
wend
|
wend
|
||||||
```
|
```
|
||||||
|
|
||||||
##### FOR <TO,DOWNTO> [STEP]/NEXT
|
##### FOR TO,DOWNTO [STEP]/NEXT
|
||||||
Iteration over a range is handled with the `FOR`/`NEXT` loop. When iterating from a smaller to larger value, the `TO` construct is used; when iterating from larger to smaller, the `DOWNTO` construct is used.
|
Iteration over a range is handled with the `for`/`next` loop. When iterating from a smaller to larger value, the `to` construct is used; when iterating from larger to smaller, the `downto` construct is used.
|
||||||
```
|
```
|
||||||
for a = 1 to 10
|
for a = 1 to 10
|
||||||
; do something with a
|
; do something with a
|
||||||
@ -439,10 +439,10 @@ for a = 10 downto 1
|
|||||||
; do something else with a
|
; do something else with a
|
||||||
next
|
next
|
||||||
```
|
```
|
||||||
An optional stepping value can be used to change the default iteration step from 1 to something else. Always use a positive value; when iterating using `DOWNTO`, the step value will be subtracted from the current value.
|
An optional stepping value can be used to change the default iteration step from 1 to something else. Always use a positive value; when iterating using `downto`, the step value will be subtracted from the current value.
|
||||||
|
|
||||||
##### WHILE/LOOP
|
##### WHILE/LOOP
|
||||||
For loops that test at the top of the loop, use `WHILE`. The loop will run zero or more times.
|
For loops that test at the top of the loop, use `while`. The loop will run zero or more times.
|
||||||
```
|
```
|
||||||
a = c ; Who knows what c could be
|
a = c ; Who knows what c could be
|
||||||
while a < 10
|
while a < 10
|
||||||
@ -451,14 +451,14 @@ while a < 10
|
|||||||
loop
|
loop
|
||||||
```
|
```
|
||||||
##### REPEAT/UNTIL
|
##### REPEAT/UNTIL
|
||||||
For loops that always run at least once, use the `REPEAT` loop.
|
For loops that always run at least once, use the `repeat` loop.
|
||||||
```
|
```
|
||||||
repeat
|
repeat
|
||||||
update_cursor
|
update_cursor
|
||||||
until keypressed
|
until keypressed
|
||||||
```
|
```
|
||||||
##### BREAK
|
##### BREAK
|
||||||
To exit early from one of the looping constructs, the `BREAK` statement will break out of it immediately and resume control immediately following the bottom of the loop.
|
To exit early from one of the looping constructs, the `break` statement will break out of it immediately and resume control immediately following the bottom of the loop.
|
||||||
|
|
||||||
## Advanced Topics
|
## Advanced Topics
|
||||||
There are some things about PLASMA that aren't necessary to know, but can add to it's effectiveness in a tight situation. Usually you can just code along, and the system will do a pretty reasonable job of carrying out your task. However, a little knowledge in the way to implement small assembly language routines or some coding practices just might be the ticket.
|
There are some things about PLASMA that aren't necessary to know, but can add to it's effectiveness in a tight situation. Usually you can just code along, and the system will do a pretty reasonable job of carrying out your task. However, a little knowledge in the way to implement small assembly language routines or some coding practices just might be the ticket.
|
||||||
|
Loading…
Reference in New Issue
Block a user