home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / anwend / luna146 / _english / scripts / asctable.lus < prev    next >
Text File  |  1999-11-12  |  948b  |  38 lines

  1.  
  2. ; LunaScript by rgf
  3. ; Example number 2:
  4. ; Small calculations to create an Ascii-table:
  5.  
  6.  f%=62
  7.  f%=add(f%,3)
  8.  keypress(f%,0)         ; Might have a value 65, i.e. Ascii-"A"
  9.  return(0)
  10.  tput "Value of f% : "  ; Output both for a check
  11.  tput div(f%,2)         ; Output value
  12.  return(0)              ; Line-wrap
  13.  tput "Value of 'A': "
  14.  tput asc("A")          ; Output value
  15.  return(0)
  16.  return(0)
  17.  
  18. ; Next exercise: Create the Ascii-table with two For/Next loops.
  19. ; It's best to switch off Tab expansion, otherwise one cannot see
  20. ; the Tab character).
  21.  
  22.  tput "          "      ; First indent by 10 spaces
  23.  
  24.  f%=1                   ; Start at Ascii 1, zero is not permitted 
  25.                         ; and will be ignored anyway
  26.  for a%=1 to 10         ; Lines
  27.    for i%=f% to add(f%,25)
  28.      keypress(i%,0)
  29.    next i%
  30.    add f%,26
  31.    return(0)
  32.  next a%
  33.  return(0) 
  34.  tput "Finished...=:)"
  35.  return(0)
  36.  return(0)
  37.  end()
  38.