home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / flow / exam04.dba < prev    next >
Encoding:
Text File  |  1999-09-07  |  1.3 KB  |  64 lines

  1. Rem * Title  : GOTO Commands
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ===========================================================
  5. rem DARK BASIC EXAMPLE PROGRAM 4
  6. rem ===========================================================
  7. rem This program will show you how to use goto commands
  8. rem -----------------------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),1
  12.  
  13. startofprogram:
  14.  
  15. rem Clear the screen
  16. cls
  17.  
  18. rem Print a user prompt
  19. print "PLEASE PRESS LEFT OR RIGHT MOUSE BUTTON"    
  20.  
  21. rem Start of the main loop
  22. do
  23.  
  24.     rem check for left mouse button 
  25.     if mouseclick()=1
  26.         rem jump to label leftbutton
  27.         goto leftbutton
  28.     endif
  29.                             
  30.     rem check for right mouse button
  31.     if mouseclick()=2 
  32.         rem jump to label rightbutton
  33.         goto rightbutton
  34.     endif
  35.                             
  36. rem End of the main loop    
  37. loop
  38.  
  39. rem This a label leftbutton
  40. leftbutton:
  41.  
  42. print "YOU HAVE PRESSED THE LEFT MOUSE BUTTON"
  43.  
  44. rem Wait till no mouse button are pressed
  45. repeat:until mouseclick()=0
  46.  
  47. rem Jump to the label startofprogram
  48. goto startofprogram
  49.  
  50.  
  51. rem This is label rightbutton
  52. rightbutton:
  53.  
  54. print "YOU HAVE PRESSED THE RIGHT MOUSE BUTTON"
  55.  
  56. rem Wait till no mouse button are pressed
  57. repeat:until mouseclick()=0
  58.  
  59. rem Jump to the label startofprogram
  60. goto startofprogram
  61.  
  62.  
  63.  
  64.