home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / ref / labels.ba < prev    next >
Text File  |  2006-10-19  |  3KB  |  90 lines

  1.  
  2. Title: LABELS.BA v1.0
  3.  
  4.  
  5. The LABELS.BA program is designed to illustrate four structures used in most 
  6. programs: 1) sequence, 2) branch, 3) decision, 4) loop. 
  7.  
  8. Besides being a lesson in programming structures, the LABELS.BA program is a 
  9. very useful tool.  The principles, once learned and practiced, provide the 
  10. user with insights into one of the oldest, and finest, uses of computing 
  11. resources; the "batch mode."  The computer, being a simple machine by design, 
  12. is quite adept at doing the same thing over, and over again.  Never tiring or 
  13. complaining.  The batch mode principle is useful in developing keyboard 
  14. macros, spreadsheet development and use, file querying, mail merging, 
  15. broadcast e-mail, and many other repetitious activities common to computing.
  16.  
  17. A common label used in computing is the self-stick, 7/8 inch x 3 inch, single-
  18. column, continuous, form-fed labels.  You can usually get a box of 5,000 for 
  19. under $20 at most swap meets and discount houses.  I personally like the Avery 
  20. brand labels because they don't tend to separate from their carrier when 
  21. making the sharp bend around the platen before entering the print-head area.  
  22. Other brands separate from the carrier and end up either stopping the print 
  23. head or getting stuck within the path, making it necessary to disassemble and 
  24. clean the printer.  I'm usually not a happy camper when this happens.  That's 
  25. why I stick with Avery brand labels. 
  26.  
  27. 10 'Remarks are sequences...
  28. 20 ' LABELS.BA Richard Hanson v1.0
  29. 30 ' A public domain program, designed
  30. 40 ' for the CLUB 100 online class
  31. 50 ' entitled: Programming in BASIC
  32. 60 '
  33. 70 ' CLUB 100: 415-939-1246 bbs 
  34. 80 '
  35. 90 'The menu display routine is
  36. 100 'another example of a sequence...
  37. 110 CLS
  38. 120 PRINT:PRINT
  39. 130 PRINT"(P)rint labels"
  40. 140 PRINT"(Q)uit"
  41. 150 ' 
  42. 160 'The selection filter routine is 
  43. 170 'composed of three decisions and
  44. 180 'a branch.
  45. 190 '
  46. 200 '...three decisions
  47. 210 Z$=INKEY$:IFZ$=""THEN210
  48. 220 IFZ$="p"ORZ$="P"THEN330
  49. 230 IFZ$="q"ORZ$="Q"THENMENU
  50. 240 '
  51. 250 '...branch
  52. 260 GOTO210
  53. 270 '
  54. 280 'The label printing routine starts
  55. 290 'with a short sequence, then goes
  56. 300 'into a loop.
  57. 310 '
  58. 320 '...sequence
  59. 330 CLS
  60. 340 PRINT:PRINT
  61. 350 INPUT"Print how many labels";A
  62. 360 CLS
  63. 370 PRINT@125,"Total labels to print: "A
  64. 380 PRINT@165,"Now printing label No: "
  65. 390 '
  66. 400 '...loop
  67. 410 FORX=1TOA
  68. 420   PRINT@188,X
  69. 430   LPRINT"name"
  70. 440   LPRINT"company"
  71. 450   LPRINT"address"
  72. 460   LPRINT"city, state zip"
  73. 470   LPRINT
  74. 480   LPRINT
  75. 490 NEXTX
  76. 500 '
  77. 510 'The program ends in a branch.
  78. 520 '
  79. 530 '...branch
  80. 540 GOTO10
  81.  
  82. ASSIGNMENT
  83.  
  84. 1) Annotate the keywords list with the command-use ideas presented here.
  85. 2) Modify LABELS.BA v1.0 to accodate custom label creation.
  86. 3) Make a second version of LABELS.BA, remove the rem lines as appropriate, 
  87.    and renumber the program starting at 10, step by 10. 
  88.  
  89. <EOF>
  90.