home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ST-Computer Leser-CD 2000 January
/
LCD_01_2000.iso
/
anwend
/
luna146
/
_english
/
scripts
/
loop.txt
< prev
next >
Wrap
Text File
|
1999-11-12
|
2KB
|
73 lines
There are new commands and variables in Luna's scripting language.
See also ASCTABLE.LUS etc. about this
-----------------------------------------------------------------
∙ Variables can be created, which are integers, i.e. they have no
fractional/decimal parts, and range in value from around -2 billion to
+2 billion.
A variable of this kind must always start with a letter and end with a
'%' (percent) character.
This variable is case sensitive, i.e. a% is not the same as A%!
Example: a%
Value of the variable: 0
∙ On its own this is, of course, not very useful, which is why one can
assign values to them.
Example: a%=3
Content(value) of the variable: 3
∙ One can also calculate with these variables.
Example: add a%,5
Content(value) of the variables: a%+5; if a% is 3 beforehand, then a%
after the operation is 8.
One can also perform indirect calculations:
b%=add(a%,5)
Here the result is not passed to the variable a%, but to the
variable b%. There are also other return posibilities.
Example: keypress(add(a%,4),0)
All four basic arithmetic functions are available for this:
add, add()
sub, sub()
mul, mul()
div, div()
∙ One can also have loops in a script, which may be nested within each
other (with different counter variables).
Nesting can be up to 32 levels deep.
Example:
for a%=1 to 2
for i%=4 to 5
next i%
next a%
∙ Furthermore there are now the possibilities of fast output for text
and numerical values. The cursor will be placed at the end of the
output string.
Example: tput a%
or tput "Text"
∙ One can also ascertain the ASCII-value of a character.
Example: a%=asc("W")
a% will then contain the numerical value of the ASCII character 'W'.
Have fun! rgf