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 >
Text File  |  1999-11-12  |  2KB  |  73 lines

  1.  
  2.   There are new commands and variables in Luna's scripting language.
  3.   See also ASCTABLE.LUS etc. about this
  4.  
  5.   -----------------------------------------------------------------
  6.  
  7.  ∙ Variables can be created, which are integers, i.e. they have no 
  8.    fractional/decimal parts, and range in value from around -2 billion to 
  9.    +2 billion.
  10.    A variable of this kind must always start with a letter and end with a 
  11.    '%' (percent) character.
  12.    This variable is case sensitive, i.e. a% is not the same as A%!
  13.  
  14.    Example: a%
  15.    Value of the variable: 0
  16.  
  17.  ∙ On its own this is, of course, not very useful, which is why one can
  18.    assign values to them.
  19.  
  20.    Example: a%=3 
  21.    Content(value) of the variable: 3
  22.  
  23.  ∙ One can also calculate with these variables.
  24.    Example: add a%,5
  25.    Content(value) of the variables: a%+5; if a% is 3 beforehand, then a% 
  26.    after the operation is 8.
  27.    
  28.    One can also perform indirect calculations:
  29.    b%=add(a%,5)
  30.    Here the result is not passed to the variable a%, but to the 
  31.    variable b%. There are also other return posibilities.
  32.    
  33.    Example: keypress(add(a%,4),0)
  34.  
  35.    All four basic arithmetic functions are available for this:
  36.    
  37.    add, add()
  38.    sub, sub()
  39.    mul, mul()
  40.    div, div()   
  41.  
  42.  
  43.  ∙ One can also have loops in a script, which may be nested within each 
  44.    other (with different counter variables).
  45.  
  46.    Nesting can be up to 32 levels deep.
  47.  
  48.    Example:
  49.  
  50.    for a%=1 to 2
  51.      for i%=4 to 5
  52.      next i%
  53.    next a%
  54.  
  55.  
  56.  ∙ Furthermore there are now the possibilities of fast output for text 
  57.    and numerical values. The cursor will be placed at the end of the 
  58.    output string.
  59.    
  60.    Example: tput a% 
  61.        or  tput "Text"
  62.  
  63.  
  64.  ∙ One can also ascertain the ASCII-value of a character.
  65.  
  66.    Example: a%=asc("W")
  67.    
  68.    a% will then contain the numerical value of the ASCII character 'W'.
  69.   
  70.   
  71.   
  72.   Have fun! rgf
  73.