home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / demos / 157 / gfa / example.lst < prev    next >
Encoding:
File List  |  1987-07-15  |  1.2 KB  |  52 lines

  1. '**********  First load the picture clip of the dialog
  2. Open "I",#1,"EXAMPLE.cl1"
  3. Input #1,Clip_len,Colr_len,Clip_width,Clip_hite,Rez_pic
  4. Pic$=String$(Clip_len,0)
  5. Colr$=String$(Colr_len,0)
  6. Bget #1,Varptr(Colr$),Colr_len
  7. Bget #1,Varptr(Pic$),Clip_len
  8. Close #1
  9. Void Xbios(6,L:Varptr(Colr$))
  10. '********** Now initialize variables and dimension the Sq array
  11. Bx%=57
  12. By%=21
  13. Dim Sq(259)
  14. Arrayfill Sq(),0
  15. '********** Read the data describing out target squares
  16. for J=1 to 29
  17.    read D
  18.    read C
  19. Sq(C)=D
  20. Next J
  21. '**********  Show the Box and Handle all replies
  22. Put Bx%,By%,Pic$
  23. Mainloop: 
  24. repeat
  25. Until mousek<>0
  26. @Sample_mouse
  27. If Sq(P)=0 Then
  28.   Goto Mainloop
  29. Endif
  30. Print at(1,1);P;Chr$(32);Sq(P);Space$(5)
  31. Goto Mainloop
  32. '************ Now the data which describes the dialog
  33. DATA 1,124
  34. DATA 2,21
  35. DATA 3,164
  36. DATA 4,133
  37. DATA 5,173
  38. DATA 6,125,6,126,6,127,6,128,6,129,6,130,6,131,6,132
  39. DATA 7,165,7,166,7,167,7,168,7,169,7,170,7,171,7,172
  40. DATA 8,210,8,211,8,212
  41. DATA 9,205,9,206,9,207
  42. DATA 10,127
  43. DATA 11,171
  44.  
  45. '************* Here we check mouse are convert it to (P)
  46. Procedure Sample_mouse
  47.   Mouse Mox,Moy,dumb_key
  48.   Xpos=Int(Mox/16)
  49.   Ypos=Int(Moy/16)
  50.   P=((Ypos*17)+(Ypos*3))+Xpos
  51. return
  52.