home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / QBPANEL.ZIP / PANELDMO.BAS next >
Encoding:
BASIC Source File  |  1987-02-17  |  3.6 KB  |  134 lines

  1. '
  2. defint a-z                     'VERY IMPORTANT!!!! (speeds things up)
  3. clear         'initialization
  4. key off
  5. screen 0
  6. dim panel1$(7,4),panel2$(5,4)      ' define the input info panel1s
  7. '
  8. '   note: in panel1$, the first subscript will number the fields of the
  9. ' input panel1. the second subscript will number the characteristics of those
  10. ' fields. panel1$(x,0) will contain the prompt string of field x.
  11. ' panel1$(x,1) and panel1$(x,2) will contain the row and column of the first
  12. ' character of field x ( in string form). panel1$( x,3) = max size of input
  13. ' string allowed. panel1$( x,4) = the reply string typed by the user.
  14. '
  15.  
  16. ' data for first screen panel1
  17. data  "MODEL NUMBER :"  ,"4","4","10","RT-123"
  18. data  "SERIAL NUMBER:"  ,"4","43","10","234200"
  19. data  "CUSTOMER :    "  ,"8","4","10",""
  20. data  "P.O. NUMBER : "  ,"8","43","10",""
  21. data  "ASSEMBLED BY :"  ,"12","4","10",""
  22. data  "PACKAGED BY : "  ,"12","43","10",""
  23. data  "INSPECTOR :   "  ,"16","4","10",""
  24. data  "STOCK NUMBER :"  ,"16","43","10",""
  25. ' data for second screen panel1
  26. data  "USER NAME :   "  ,"4","4","10",""
  27. data  "SS NUMBER :   "  ,"4","43","10",""
  28. data  "HANDLE :      "  ,"8","4","10",""
  29. data  "SYSTEM :      "  ,"8","43","10",""
  30. data  "LANGUAGE :    "  ,"12","4","10",""
  31. data  "TYPE OF DRUG :"  ,"12","43","10",""
  32.  
  33. for i = 0 to 7
  34.         for j = 0 to 4
  35.                 read panel1$(i,j)
  36.         next j
  37. next i
  38.  
  39. for i = 0 to 5
  40.         for j = 0 to 4
  41.                 read panel2$(i,j)
  42.         next j
  43. next i
  44.  
  45. '     end of initialization
  46.  
  47. '    intro screen
  48.  
  49. color 15,1 : cls      'make a blue screen
  50.  
  51. locate 9,15,0
  52. print "S U P E R - D U P E R   E X A M P L E   P R O G R A M";
  53.  
  54. locate 10,15
  55. print "-----------------------------------------------------";
  56.  
  57. locate 16, 34
  58. print "by  Bob Hodge";
  59.  
  60. call anykey
  61. '    end of intro screen
  62.  
  63. call panelcolor( 15,1,10,15,0)   ' set up the panel colors
  64. color 15,1
  65. cls
  66.  
  67. call EditInst
  68.  
  69. call promptdisplay(panel1$(),7)    ' display all the prompts
  70. call fielddisplay(panel1$(),7)       ' display all the fields (black background)
  71. call fieldentry(panel1$(),7)
  72.  
  73. panel2$(0,4) = panel1$(0,4)
  74.  
  75. ' second screen of input
  76. call panelcolor( 15,2,12,15,0)
  77.  
  78. color 15,2
  79. cls
  80.  
  81. call EditInst
  82.  
  83. call promptdisplay(panel2$(),5)    ' display all the prompts
  84. call fielddisplay(panel2$(),5)       ' display all the fields (black background)
  85. call fieldentry(panel2$(),5)
  86.  
  87.  
  88.  
  89. call anykey
  90.  
  91. ' explanation screen
  92.  
  93. cls
  94. print:print:print
  95. print "     Now, the strings in panel1$(0,4), panel1$(1,4), (2,4), etc., contain the"
  96. print " info entered in the previous fields.  Witness:"
  97. print
  98. print "panel1$(0,4) =" panel1$(0,4)
  99. print "panel1$(1,4) =" panel1$(1,4)
  100. print "panel1$(2,4) =" panel1$(2,4)
  101. print "panel1$(3,4) =" panel1$(3,4)
  102. print "panel1$(4,4) =" panel1$(4,4)
  103. print "panel1$(5,4) =" panel1$(5,4)
  104. print "panel1$(6,4) =" panel1$(6,4)
  105. print "panel1$(7,4) =" panel1$(7,4)
  106. print:print
  107.  
  108.  
  109. print "        END OF DEMO "
  110. call anykey
  111.  
  112. end
  113.  
  114.  
  115. sub AnyKey  static
  116. ' press any key, etc. and will wait on a key
  117.    locate 25,1         ' First, clear the bottom line
  118.    print spc(79);
  119.    locate 25, 25
  120.    print " Press any key to continue...";
  121.    reply$ = ""
  122.    while len( reply$) = 0
  123.          reply$ = inkey$
  124.    wend
  125.    locate 25,1         ' clear the bottom line on exit, also
  126.    print spc(79);
  127. end sub
  128.  
  129.  
  130. sub EditInst static
  131. '  just tell the user what keys are legal to use in the panel '
  132. locate 24,2 : print "Editor keys: " chr$(24) ", " chr$(25) ", " chr$(26);
  133. print ", " chr$(27) ", BkSp, Del, Home, End and Enter (Esc to stop editor)";
  134. end sub