home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / flow / exam06.dba < prev    next >
Encoding:
Text File  |  2000-04-09  |  1.9 KB  |  86 lines

  1. Rem * Title  : DATA Commands
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem ===========================================================
  5. rem DARK BASIC EXAMPLE PROGRAM 6
  6. rem ===========================================================
  7. rem This program will show you how to use data command
  8. rem -----------------------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),1
  12.     
  13. rem Read some data in
  14. rem you must know what order the data is
  15. rem if the first data is a number
  16. rem then don`t read it has a string
  17.  
  18. print "read data in"
  19. read name$
  20. read address$        
  21. read area$
  22. read town$
  23. read age
  24. read height    
  25.  
  26. print "NAME    = ",name$
  27. print "ADDRESS = ",address$
  28. print "AREA    = ",area$
  29. print "TOWN    = ",town$
  30. print "AGE     = ",age
  31. print "HEIGHT  = ",height," ft"
  32.  
  33. rem Once the data has been read then to reread the same data
  34. rem you must use the RESTORE command
  35.  
  36. rem this set the data pointer to myname
  37. restore myname
  38.  
  39. print "reading data in again"
  40. read name$
  41. read address$        
  42. read area$
  43. read town$
  44. read age
  45. read height    
  46.  
  47. print "NAME    = ",name$
  48. print "ADDRESS = ",address$
  49. print "AREA    = ",area$
  50. print "TOWN    = ",town$
  51. print "AGE     = ",age
  52. print "HEIGHT  = ",height," ft"
  53.  
  54. rem if you do not reset the data pointer then the next read would read
  55. rem the next set of data or there would be a error
  56. rem out of data
  57.  
  58. print "reading the next lot of data"
  59. read name$
  60. read address$        
  61. read area$
  62. read town$
  63. read age
  64. read height    
  65. print "NAME    = ",name$
  66. print "ADDRESS = ",address$
  67. print "AREA    = ",area$
  68. print "TOWN    = ",town$
  69. print "AGE     = ",age
  70. print "HEIGHT  = ",height," ft"
  71.  
  72. print
  73. print "press spacekey"
  74. suspend for key
  75. end
  76.  
  77. myname:
  78. data "malcolm bamber"
  79. data "124 long lane","leigh","wigan"
  80. data 34,5
  81. yourname:
  82. data "lee bamber"
  83. data "11 small lane","leigh","wigan on sea"
  84. data 22,3
  85.  
  86.