home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pgxos / datfil.do < prev    next >
Text File  |  2006-10-19  |  6KB  |  154 lines

  1. DATFIL.CMD by Paul Globman
  2.         Copyright (c) 1989
  3.  
  4. DATFIL.CMD is a data organizer/filer program with user defined prompts and
  5. display parameters.  It is designed to run ONLY as an XOS command module.
  6.  
  7. Data files are initialized with the built-in TEXT program, and the data you
  8. wish to organize is entered and displayed by using the DATFIL program.
  9.  
  10. Data file organization
  11. ----------------------
  12. Before initializing the data file you should organize the file structure and
  13. display layout.  Data files are organized into groups of records, and
  14. records are organized into groups of fields.  You should determine:
  15.  
  16. a) the number of fields for the data file record.
  17. b) the name (prompt) for each field.
  18. c) the "location" on the LCD where each field prompt will appear.
  19.  
  20. The "location" is the print position that would be used by BASIC's PRINT@
  21. function, and is calculated as follows:
  22.  
  23.  R = row (or line)
  24.  C = column
  25.  LOCATION = 40*(R-1)+(C-1)
  26.  
  27. So if you want a prompt to appear on the third line (row), column 5, you would
  28. calculate the location as follows:
  29.  
  30.     LOCATION = 40*(R-1)+(C-1)
  31.              = 40*(3-1)+(5-1)
  32.              = 40*(2)+(4)
  33.              = 84
  34.  
  35. Data is entered and displayed immediately following the prompt, so
  36. for a comfortable appearance you should add a space after the prompt.
  37.  
  38. Since lines are 40 characters, you can make one prompt appear directly under
  39. the previous prompt by just adding 40 to the location.  Add 80 if you wish to
  40. skip a line, etc.
  41.  
  42. Data file initialization
  43. ------------------------
  44. Create a new TEXT file using the TEXT program.  On the first line enter the
  45. number of fields (prompts) you need for this data file.  For EACH field, enter
  46. a prompt <cr> and a location <cr>.  For example:
  47.  
  48. 3
  49. Name   :
  50. 44
  51. Phone  :
  52. 84
  53. Comment:
  54. 124
  55.  
  56. This example is for a file with 3 prompts (first line).  The first prompt
  57. is the word "Name   :", and it will display at location 45.  Lines 4/5 and
  58. lines 6/7 represent fields 2 and 3.  Be sure there are no extra CR's (blank
  59. lines), but be sure there is a carraige return at the end of each line.
  60.  
  61. That's all you do manually, to set up a data file.  Some programs do this minor
  62. chore for you, but to keep the program small enough to run in the ALTLCD
  63. buffer, this task is done manually.
  64.  
  65.  
  66. The Program (an XOS-C command utility)
  67. --------------------------------------
  68. You do NOT run DATFIL.CMD!  You store the program in bank #3 and select the
  69. data file on the T200 Menu with the widebar cursor.  With the data file
  70. under the widebar cursor, you press F3(Cmd) and then enter DF (DATFIL), or
  71. whatever you choose to call this utility.
  72.  
  73. If you do not select a .DO file, or if the .DO file does not begin with a
  74. number (ie, number of fields = 0) then the program will not execute and you
  75. will be returned to the menu.
  76.  
  77. Once you enter the program, all operations will be confined to the data
  78. file that was cursor selected.  The following menu will be displayed...
  79.  
  80.  
  81. DataFiler
  82.  
  83.         <A>dd
  84.         <D>isplay
  85.         <E>xit
  86.  
  87.         =>
  88.  
  89. Only an A, D, or E will have any affect.  All other responses are considered
  90. invalid.
  91.  
  92. Press A to add data records to your new data file.  Press D to display records.
  93. Press E to returm to the Tandy 200 main menu.  The program accepts upper or
  94. lower case characters.
  95.  
  96. ADD data
  97. --------
  98. You will NOT be prompted to enter the name of the data file you wish to use.
  99. The file was selected before you entered the program.
  100.  
  101. DATFIL will read the "header" info (the number of prompts, field names, and
  102. locations).  You will then be prompted to enter data by displaying the prompts
  103.  you selected, and the program will accept your input.
  104.  
  105. After each record is entered, you will be prompted with "More?".  Press N for
  106. no more!  You are in the ADD mode so the program assumes you wish to continue
  107. to add data, and only a "N" will break out of the ADD mode and return to the
  108. A/D/E menu.
  109.  
  110. If you feel that a mistake was made when entering data, you will be able to
  111. correct that error with the TEXT program.
  112.  
  113. DISPLAY data
  114. ------------
  115. You will NOT be prompted to enter the name of the data file you wish to use.
  116. The file was selected before you entered the program.
  117.  
  118. DATFIL will read the "header" info (the number of prompts, field names, and
  119. locations).  You will then be prompted to enter "String" data for selective
  120. record display.
  121.  
  122. Press ENTER if you wish to display all records, or enter characters to be
  123. matched.  Only records containing the match string will be displayed, if a
  124. match string is specified.
  125.  
  126. Each record is displayed by printing the field prompt at its location, followed
  127. by the data entry.
  128.  
  129. After each record is displayed, the cursor jumps to the upper left corner
  130. of the LCD and waits for a keyboard input.  Any key will bring up the next
  131. record except "N".  Press N for no more!  You are in the DISPLAY mode so the
  132. program assumes you wish to continue to display data records, and only a "N"
  133. will break out of the DISPLAY mode and return to the A/D/E menu.
  134.  
  135. A beep will sound when the last record of the file is displayed, and the next
  136. keypress will return to the A/D/E menu.  If the last record doesn't match the
  137. specified string, then a beep will sound with a blank screen when the file has
  138. been completely searched.
  139.  
  140.  
  141. ERRORS
  142. ------
  143. The beep is the only indication of an error.  If it occurs during the ADDing
  144. of data then it may indicate an out of memory condition and you should examine
  145. the data file to see if the last entry is properly organized.  If only a
  146. partial record is found, you should delete that last partial record, and
  147. then see about making more room in RAM before continuing to ADD data records.
  148.  
  149. If the last record is not properly organized, DATFIL may display data
  150.  which is past the "end of file" marker.  This is harmless to your programs or
  151. data files and is easily corrected using TEXT to correct the last data record
  152. in the file.  Use the N command to abort the display.
  153.  
  154.