home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / 2d / exam01.dba next >
Encoding:
Text File  |  2000-04-09  |  2.4 KB  |  99 lines

  1. Rem * Title  : Clearing the Screen
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ==========================================
  5. rem DARK BASIC EXAMPLE PROGRAM 1
  6. rem ==========================================
  7. rem This program will use the cls command
  8. rem ------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),0
  12.  
  13. rem The main part of the program start here
  14.  
  15. gosub clsexample
  16. gosub clsexampletwo
  17.  
  18. rem End the program
  19. end
  20.  
  21. clsexample:
  22. rem **********************************************
  23. rem * This will show you how to clear the screen *
  24. rem * using the current background color        *
  25. rem **********************************************
  26.  
  27. rem draw some circles 
  28. gosub rand
  29.  
  30. rem Set the ink to white and paper color to black 
  31. ink rgb(244,214,210),1
  32.  
  33. rem Print a message on screen
  34. text 200,240,"press the spacebar to clear this screen"
  35.  
  36. rem Wait for any key to be pressed
  37. suspend for key
  38.  
  39. rem This command will clear the screen using the current paper color
  40. cls 
  41.  
  42. rem Print a message on screen
  43. text 200,240,"That was simple"
  44. text 200,260,"press the spacebar to continue"  
  45.  
  46. rem Wait for any key to be pressed
  47. suspend for key
  48.  
  49. rem clear the screen to black
  50. cls 0 
  51. return
  52.  
  53. clsexampletwo:
  54. rem **********************************************
  55. rem * This will show you how to clear the screen *
  56. rem * using a color provide                     *
  57. rem **********************************************
  58.  
  59. rem draw some circles 
  60. gosub rand
  61.  
  62. rem Set the ink to white and paper color to black 
  63. ink rgb(244,214,210),1
  64.  
  65. rem Print a message on screen
  66. text 200,240,"press the spacebar to clear this screen"
  67.  
  68. rem Wait for any key to be pressed
  69. suspend for key
  70.  
  71. rem This command will clear the screen using a color provide
  72. cls rgb(255,0,0)
  73.  
  74. rem Print a message on screen
  75. text 200,240,"That was simple"
  76. text 200,260,"press the spacebar to continue"  
  77.  
  78. rem Wait for any key to be pressed
  79. suspend for key
  80.  
  81. rem clear the screen to black
  82. cls 0 
  83. return
  84.  
  85. rand:
  86. rem **********************************************
  87. rem *This will fill the screen with some circles *
  88. rem **********************************************
  89.  
  90. rem Set the ink to blue and paper color to black 
  91. ink rgb(255,255,0),0
  92.  
  93. rem Fill Screen with 100 circles
  94. for t=0 to 100
  95.     circle rnd(640),rnd(480),Rnd(100)
  96. next t
  97.  
  98. return
  99.