  #compact
  %filename "t.exe"
 'uses RTL64
 '% Title "Intersection Demo"
  % Title "ConsoleG Demo:  Move text with mouse and arrow keys etc"

 '% WindowStyle WS_OVERLAPPEDWINDOW
 '% Animated
 '% ScaleUp
  % PlaceCentral
  % AnchorCentral

  % shaders

  uses consoleG
 'uses glo2/geoplanar
 
  'Keys: Esc, arrow-keys, n,m, F4

  BeginScript

  sub main
  ========

  'WaitForEvent '0 off 1 on (default on)
  static quad t1,t2

  if opening then 'FIRST CALL ONLY
    timemark t1
    'picked=100
    'mbox "helo"
  end if
  '
  if closing then 'FINAL CALL BEFORE SHUTDOWN
    'mbox "Bye!"
    exit sub
  end if
  cls
  shading
  UserMovement mu,1000,10 'symbol identity, count
  scale 1
  int i
  for i=1 to 10
    pushstate
    mu[i].act
    if mu[i].x + mu[i].y = 0
      color 1,.9,.9,1
    else
      color 1,.9,0,1
    endif
    go sphere
    popstate
  next
  picklabel 0

  move 5

  'if not pick then
    if key[49] then picked=100 'keypress '1'
    if key[50] then picked=200 'kypress  '2'
    pushstate
    move -20,12
    static sys tally
    timemark t2
    scale 1.0
    '
    macro pr(a,b) 'PRINTING LIST
    ----------------------------
      pushstate : color .5,1,1 : print a : popstate
      pushstate : color 1,1,.5 : move 8 : print b : popstate
      printl ""
    end macro
    picklabel 10
   'pr "Action Code:   ", str(act)
   'pr "indexbase      ", str(indexbase)
    pr "Picked ID:     ", str(picked)
    pr "Keyboard Code: ", str(keyd)
    picklabel 0
    popstate
  'end if

  end sub 'main

  EndScript