home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 6 / Amoszine 6 (Disk 2 of 2).adf / Iterface.lha / andy_smith / Interface_Example7.AMOS / Interface_Example7.amosSourceCode
Encoding:
AMOS Source Code  |  1992-03-06  |  1.3 KB  |  50 lines

  1. '=========================================================================== 
  2. ' Interface example 7. 
  3.  
  4. ' Written by Andy Smith for Amoszine 
  5. '=========================================================================== 
  6.  
  7.  
  8. Resource Screen Open 0,640,256,0
  9. A$=A$+"BAse 200,100;"
  10. A$=A$+"SIze 250,50; SAve 1;"
  11. A$=A$+"BOx 0,0,1,250,50;"
  12. A$=A$+"PRint 10,2,'Enter some numbers below',7;"
  13. A$=A$+"LIne 8,15,17,240;"
  14.  
  15. ' The DIgit command follows below.  It sets up a digit zone where to can type  
  16. ' just numbers.  The parameters are (in order):
  17.  
  18. ' Identification number which ranges from 1 upwards. 
  19. ' The X coordinate 
  20. ' The Y coordinate 
  21. ' The maximum amount of characters that can be entered 
  22. ' A value.  In this case '999' is displayed.  This will be displayed 
  23. '    when then the zone is first set up. 
  24. ' A flag.  A zero means nothing is displayed, any other value displays the 999 
  25. ' The paper colour 
  26. ' The pen colour 
  27.  
  28. A$=A$+"DIgit 1,16,19,8,999,1,0,7;"
  29.  
  30. A$=A$+"EXit;"
  31.  
  32. Dialog Open 1,A$
  33.  
  34. R=Dialog Run(1)
  35. Repeat 
  36.    BUTTON=Dialog(1)
  37. Until BUTTON<>0
  38.  
  39. ' The Rdialog function returns a number from a zone.  Its parameters are as  
  40. ' follows: 
  41.  
  42. ' The channel number 
  43. ' The zone.  Which corresponds to the interface program.  Zone 1 is the DIgit  
  44. '    zone. 
  45.  
  46. NUMBER=Rdialog(1,1)
  47.  
  48. Dialog Close 1
  49.  
  50. Print "You typed : ";NUMBER