home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / FILER.ZIP / FILER.DOC < prev    next >
Encoding:
Text File  |  1985-11-18  |  81.6 KB  |  2,372 lines

  1.  
  2.  
  3.  
  4.                                                       JULY 3,1985
  5.  
  6.                      FILER GROUP OF PROGRAMS
  7.                      =======================
  8.  
  9.  
  10.    The FILER GROUP of programs permit the creation,  maintenance, 
  11. and use of very large data files.  These programs are written  in 
  12. Turbo Pascal for PCDOS Microcomputer systems. ( CP/M versions are 
  13. also  available ) The programs which compose the FILER GROUP  are 
  14. FILER,   SORTER,   PICTOFRM,  FRMTODAT,  DATTOPIC,  STARTER,  and 
  15. TRANSFER.
  16.  
  17.  
  18.    PICTOFMR  permits  the translation of a picture of  a  desired 
  19. data  base screen to be translated into an intermediate form that 
  20. records locations,  data types, and label names. The intermediate 
  21. file  form permits the order of data entry to be modified to  any 
  22. desired sequence.
  23.  
  24.  
  25.    FRMTODAT permits the rapid conversion of the file generated by 
  26. PICTOFRM into an empty (null) FILER FILE.
  27.  
  28.  
  29.    DATTOPIC  permits the generation of a file which contains  the 
  30. screen  picture of the file from a FILER FILE.  This file can  be 
  31. printed or edited for record or modification purposes.
  32.  
  33.  
  34.    FILER permits the user to display,  add,  correct,  or  delete 
  35. data records from the disk file.
  36.  
  37.  
  38.    SORTER permits the user to sort records within a file on up to 
  39. ten  of  the fields which make up the data record.  This  program 
  40. renames the source data by changing its file extension to  "BAK". 
  41. A new sorted file, with the extension "DAT", is created. REQUIRES 
  42. THE FILE SORT.BOX FROM BORLAND'S TURBO TOOLBOX.
  43.  
  44.  
  45.    STARTER  is  a source program written in Turbo  Pascal  source 
  46. which contains all the logic to access a disk file, read records, 
  47. print out data field labels and the data contained in each  field 
  48. of  a  data  record.  Provision is also made  for  page  control, 
  49. titles, sub totals and grand totals.
  50.  
  51.  
  52.    TRANSFER is a program which permits data to be moved from  any 
  53. existing  FILER  FILE  to  a  newly defined  FILER  FILE  with  a 
  54. different file organization.  The creation of a TRANSLATION TABLE 
  55. makes  it possible to transfer data from any SOURCE FIELD to  any 
  56. desired DESTINATION FIELD.  This program makes possible the rapid 
  57. revision of any FILER FILE to a new format.
  58.  
  59.  
  60.  
  61.                                 1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                  CREATING A FILER DATABASE FILE.
  71.                  =============================== 
  72.  
  73.  
  74.   CREATING A FILER DATABASE FILE IS A EASY PROCESS.  FIRST,  WITH 
  75. A TEXT EDITOR,  ENTER A PICTURE OF THE FILE TO BE  CREATED.  GIVE 
  76. THE  FILE A MEANINGFUL NAME AND USE THE FILE EXTENSION ".PIC"  SO 
  77. THAT IT CAN BE EASILY IDENTIFIED AS THE "PICTURE" OF THE FILE  TO 
  78. BE  CREATED.  FOR EXAMPLE,  AN ACCOUNTS RECEIVABLE FILE MIGHT  BE 
  79. NAMED  "ACCTREC.PIC." FOR NOW,  THE GENERAL NAME "FILENAME.PIC", 
  80. WILL BE USED.
  81.  
  82.  
  83.   EXIT  THE EDITOR,  RETURN TO THE DISK OPERATING SYSTEM AND  RUN 
  84. THE  PROGRAM  "PICTOFRM".  "PICTOFRM"  IS SHORT FOR  "PICTURE  TO 
  85. FORM",  WHICH DESCRIBES WHAT THE PROGRAM DOES. THE PICTURE OF THE 
  86. FILE WILL BE EXAMINED AND A FORM WILL BE CREATED WHICH  TABULATES 
  87. THE LOCATION, TYPE (ALPHA OR NUMERIC), DATA LENGTH, AND THE LABEL 
  88. FOR  EACH FIELD.  DATA FIELDS ARE LISTED IN THE ORDER ENCOUNTERED 
  89. IN THE PICTURE:  FROM LEFT TO RIGHT AND FROM TOP LINE TO  BOTTOM. 
  90. THE  FILE  GENERATED BY THIS STEP WILL HAVE THE SAME NAME AS  THE 
  91. PICTURE OF THE FILE WITH THE FILE EXTENSION CHANGED TO ".FRM".
  92.  
  93.  
  94.   FILER WILL EVENTUALLY STEP THRU THE FIELDS OF THE RECORD IN THE 
  95. ORDER THAT THEY ARE LISTED IN THE "FILENAME.FRM" FILE. THIS ORDER 
  96. MAY  BE CHANGED BY EDITING THE FILE WITH YOUR EDITOR.  USE  BLOCK 
  97. MOVES  AND  MOVE WHOLE LINES OF THE FORM UNTIL THE DESIRED  FIELD 
  98. SEQUENCE IS OBTAINED. DO NOT CHANGE THE RELATIVE POSITION OF DATA 
  99. WITHIN THE LINES.
  100.  
  101.  
  102.   RETURN  TO  THE  DISK  OPERATING SYSTEM  AND  RUN  THE  PROGRAM 
  103. "FRMTODAT".  "FRMTODAT",  WHICH IS SHORT FOR "FORM TO DATA", WILL 
  104. USE FILENAME.FRM AS SOURCE DATA AND WILL CREATE A FILER FILE WITH 
  105. THE NAME FILENAME.DAT. THIS FILE IS A NULL (EMPTY) VERSION OF THE 
  106. FILE AND MAY BE USED BY ALL THE FILER GROUP OF PROGRAMS.
  107.  
  108.  
  109.   A LAST PROGRAM, "DATTOPIC", IS AVAILABLE TO CREATE A PICTURE OF 
  110. THE FILE FROM A FILER GROUP FILE.  "DATTOPIC", WHICH IS SHORT FOR 
  111. DATA  TO  PICTURE WILL USE FILENAME.DAT AS SOURCE DATA  AND  WILL 
  112. CREATE  A  PICTURE OF THE FILE WITH THE NAME  FILENAME.PIC.  THIS 
  113. PROGRAM  IS USEFUL WHEN YOU HAVE AS EXISTING FILER FILE  AND  THE 
  114. SOURCE MATERIAL IS NOT READILY AVAILABLE.
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                 2
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.               EXAMPLE OF CREATING A DATABASE FILE. 
  137.  
  138. USE ANY EDITOR THAT WILL PRODUCE CLEAN TEXT WITHOUT EMBEDDED, NON 
  139. PRINTABLE CHARACTERS.  WORDSTAR WITH OPTION 'N' WORKS FINE. ENTER 
  140. THE  DATA LABELS AND DATA FIELDS JUST AS THEY WILL APPEAR ON  THE 
  141. FIRST  22  LINES OF THE SCREEN.  LINES 23 & 24 ARE  RESERVED  FOR 
  142. USE BY FILER.  A SAMPLE MAIL ADDRESS FILE MIGHT LOOK LIKE THIS:
  143.  
  144. NAME  : AAAAAAAAAAAAAAAAAAAA
  145. ADDR1 : AAAAAAAAAAAAAAAAAAAA
  146. ADDR2 : AAAAAAAAAAAAAAAAAAAA
  147. CITY  : AAAAAAAAAAAAAAAAA
  148. STATE : AA   ZIPCODE : AAAAA
  149.  
  150. A FEW RULES TO MAKE THINGS GO SMOOTHLY: 
  151.  
  152.   FIRST,  ALWAYS  ENTER THE LABEL OF THE DATA FIELD FIRST AND END 
  153.   IT  WITH A ':' SO THAT THE PROGRAM KNOWS WHERE THE  LABEL  ENDS 
  154.   AND THE DATA FIELD BEGINS.
  155.  
  156.   SECOND, A SPACE BEFORE AND AFTER THE ':' KEEPS THE DATA EASY TO 
  157.   READ. 
  158.  
  159.   THIRD,  DEFINE THE FIELD WHERE DATA WILL BE ENTERED BY ENTERING 
  160.   A  SERIES  OF  ANY ALPHA CHARACTER.  THE  EXAMPLE  USES  AAAA'S 
  161.   BECAUSE  THE DATA IS ALPHA,  BUT IT COULD HAVE BEEN ALMOST  ANY 
  162.   OTHER  CHARACTER EXCEPT THOSE DIGITS AND CHARACTERS WE  USUALLY 
  163.   USE TO DISPLAY NUMBERS. SO 0,1,2,3,4,5,6,7,8,9,$,.,+,-, AND THE 
  164.   COMMA AND UNDERLINE (_) ARE ONLY USED FOR NUMBERS. MORE ON THAT 
  165.   SHORTLY. 
  166.  
  167.   FOURTH,  THE FIRST SPACE FOLLOWING THE DATA FIELD INDICATES THE 
  168.   END OF THE DATA ENTRY FIELD.
  169.  
  170.   FIFTH,  A  MAXIMUM  OF 31 LABELS MAY BE USED IN A  FILER  FILE. 
  171.   MORE, AND THE FIELD DEFINITION WILL GET LOST.
  172.  
  173. NOW,  EXAMINE A FILE DEFINITION WHICH CONTAINS NUMERIC VALUES. IN 
  174. A NUMERIC FIELD,  A NUMBER ENTERED WILL BE EDITED WITH COMMAS AND 
  175. RIGHT JUSTIFIED IN THE FIELD. LEADING ZEROS WILL BE REPLACED WITH 
  176. LEADING  SPACES  AND  A DEFINED NUMBER OF  DIGITS  FOLLOWING  THE 
  177. DECIMAL  PLACE WILL BE SHOWN.  ASCII FIELDS CAN  HOLD NUMBERS - A 
  178. TELEPHONE  NUMBER IS A GOOD EXAMPLE - BUT THE VALUE ENTERED  WILL 
  179. BE  TREATED  AS THOUGH IT WAS ALPHA TEXT  AND  DISPLAYED  WITHOUT 
  180. EDITING OR JUSTIFICATION. 
  181.  
  182. ENTER THE DATA LABELS AND NUMERIC DATA FIELDS JUST AS THEY SHOULD 
  183. APPEAR  ON THE FIRST 22 LINES OF THE SCREEN.  A  SAMPLE  ACCOUNTS 
  184. RECEIVABLE FILE MIGHT LOOK LIKE THIS:
  185.  
  186. NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  187. ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  188. ADDR2 : AAAAAAAAAAAAAAAAAAAA
  189. CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  190. STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  191.  
  192.  
  193.                                 3
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203. NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  204. ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  205. ADDR2 : AAAAAAAAAAAAAAAAAAAA
  206. CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  207. STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  208.  
  209. NOW, MORE RULES FOR NUMBERS: 
  210.  
  211.   FIRST,  USE  ONLY DIGITS OR THE UNDERLINE CHARACTER TO  DISPLAY 
  212.   THE DATA FIELD.  IF ANY ALPHA CHARACTER IS ENTERED, THE PROGRAM 
  213.   WILL TREAT THE DATA FIELD AS ALPHA.
  214.  
  215.   SECOND,  USE  COMMAS IN YOUR NUMERIC FIELDS WHERE  APPROPRIATE. 
  216.   THE  NUMBER  OF CHARACTERS IN THE FIELD,  LESS  THE  NUMBER  OF 
  217.   COMMAS  IS  USED  TO  DETERMINE THE AMOUNT  OF  MEMORY  STORAGE 
  218.   REQUIRED FOR THAT NUMERIC FIELD. 
  219.  
  220.   THIRD,  IF A NUMBER IS NEGATIVE,  IT WILL DISPLAY AS A  LEADING 
  221.   MINUS SIGN AND CAN REDUCE THE NUMERIC DISPLAY BY ONE CHARACTER.
  222.  
  223.   FOURTH, THE UNDERLINE CHARACTER CAN BE USED TO DEFINE A NUMERIC 
  224.   FIELD  SO  THAT THE AMOUNT PAST DUE FIELD COULD BE  ENTERED  AS 
  225.   ___,___.__ INSTEAD OF AS 123,456.78.
  226.  
  227. WHEN  THE  PICTURE OF THE DATABASE FILE HAS BEEN COMPLETED, WRITE
  228. THE FILE TO DISK USING THE FILE NAME "ACCTREC.PIC".   THE ".PIC" 
  229. FILE EXTENSION IDENTIFIES THE FILE AS A PICTURE OF THE FILE TO BE 
  230. CREATED.  FROM  THIS POINT,  THE PROCESS OF CREATING A DATA  BASE 
  231. FILE FOR FILER IS A TWO STEP PROCESS:
  232.  
  233.   FIRST,  RUN THE PROGRAM "PICTOFRM" AND USING "ACCTREC.PIC",THE 
  234. PICTURE  FILE  JUST CREATED.  THE OUTPUT OF THIS PROGRAM WILL  BE 
  235. ANOTHER FILE WITH THE NAME "ACCTREC.FRM".  "ACCTREC.FRM" IS  AN 
  236. ASCII  FILE THAT CAN BE READ WITH YOUR TEXT EDITOR.  IF  DESIRED, 
  237. THE  CONTENTS OF THE FILE CAN BE EDITED TO REARRANGE THE ORDER IN 
  238. WHICH  THE  FIELDS  IN  THE RECORD ARE  DISPLAYED  BY  THE  FILER 
  239. PROGRAM.
  240.  
  241.   NUMERIC  FIELDS  CAN HOLD VERY LARGE AND VERY  SMALL  NUMBERS-- 
  242. PROBABLY LARGER AND SMALLER THAN ARE USUALLY NEEDED.  THE LARGEST 
  243. NUMBER IS 99,999,999,999 AND HAS 11 NUMERIC DIGITS. LARGER FIELDS 
  244. CAN BE SPECIFIED, BUT TURBO PASCAL CAN NOT HOLD DATA TO A GREATER 
  245. PRECISION AND DATA WILL BE ROUNDED OFF TO 11 NUMERIC DIGITS.  THE 
  246. SMALLEST  NUMBER  THAT CAN BE DISPLAYED IS 0.00000001 AND  HAS  8 
  247. DIGITS  TO THE RIGHT OF THE DECIMAL POINT.  ATTEMPTS TO SPECIFY A 
  248. FIELDS  WITH  9 DECIMAL DIGITS WILL CAUSE SPURIOUS DIGITS  TO  BE 
  249. DISPLAYED...  ALTHOUGH THE DATA IS PROBABLY STILL CORRECT. FIELDS 
  250. WHICH CONTAIN NUMBERS TO THE RIGHT AND LEFT OF THE DECIMAL  POINT 
  251. SHOULD BE LIMITED TO A MAXIMUM OF 12 NUMERIC DIGITS. FOR EXAMPLE, 
  252. THE FIELD 12,345.1234567 WORKS OK.  IF YOU HAVE ANY DOUBT ABOUT A 
  253. PARTICULAR  COMBINATION,  TRY IT AND SEE IF IT WORKS IN THE FINAL 
  254. FILER FILE!
  255.  
  256.  
  257.  
  258.  
  259.                                 4
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. THE  USE OF THE PROGRAM "PICTOFRM" ON ACCTREC.PIC GENERATES  THE 
  269. FOLLOWING RESULTS:
  270.  
  271.  
  272.     "PICTOFRM" CONVERTS FILES FROM XXX.PIC TO XXX.FRM.
  273.     ENTER FILENAME OF PICTURE FILE :  ACCTREC
  274.  
  275.     NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  276.     ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  277.     ADDR2 : AAAAAAAAAAAAAAAAAAAA
  278.     CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  279.     STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  280.  
  281.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  282.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  283.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  284.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  285.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  286.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  287.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  288.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  289.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  290.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  291.  
  292.     ENTER ANY KEY TO CONTINUE
  293.  
  294.     BEGINNING  WITH  A  PICTURE  OF  THE  FILE,   "PICTOFRM"  HAS 
  295.     TRANSLATED  THIS  INFORMATION INTO AN INTERMEDIATE  FORM  AND 
  296.     STORED IT IN A FILE WITH THE SAME NAME AND THE FILE EXTENSION 
  297.     ".FRM". 
  298.  
  299.     THIS FILE MAY NOW BE EDITED WITH ANY EDITOR SUCH AS WORDSTAR
  300.     TO REVISE THE ORDER OF THE FIELDS IN THE FILE.
  301.  
  302.     FINALLY, TO CONVERT THE ".FRM" INTERMEDIATE FILE INTO A ".DAT"
  303.     FILE THAT CAN BE USED BY THE FILER GROUP OF PROGRAMS, USE THE
  304.     PROGRAM "FRMTODAT".
  305.  
  306.     RECORD LENGTH : 112 BYTES 
  307.     BLOCKING FACTOR : 2
  308.     BYTES LEFT IN BLOCK : 32
  309.     CHANGE RECORD LENGTH BY -27 BYTES TO INCREASE BLOCKING FACTOR
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.                                 5
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. THE FILER PROGRAM WILL ULTIMATELY STEP THROUGH THE FIELDS OF  THE 
  335. RECORD  IN  THE  ORDER THAT THE FIELDS WERE  ENCOUNTERED  IN  THE 
  336. PICTURE  STARTING FROM TOP AND PROCESSING EACH LINE FROM LEFT  TO 
  337. RIGHT. THIS WILL GIVE THE FOLLOWING ORDER:
  338.  
  339.      LABEL >NAME  <
  340.      LABEL >ACCOUNT REC  <
  341.      LABEL >ADDR1 <
  342.      LABEL >AMT PAST DUE <
  343.      LABEL >ADDR2 <
  344.      LABEL >CITY <
  345.      LABEL >AREA CODE <
  346.      LABEL >STATE <
  347.      LABEL >ZIPCODE <
  348.      LABEL >PHONE NBR <
  349.  
  350. THIS  ORDER MAY BE MODIFIED BY USING A TEXT EDITOR AND MOVING THE 
  351. LINES TO THE ORDER DESIRED.  FOR EXAMPLE,  TO PLACE THE  "ACCOUNT 
  352. REC"  AND  "AMT PAST DUE" AT THE END AFTER THE NAME  AND  ADDRESS 
  353. INFORMATION, EDIT THE ACCTREC.FRM FILE AS FOLLOWS:
  354.  
  355.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  356.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  357.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  358.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  359.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  360.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  361.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  362.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  363.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  364.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  365.  
  366. NOTICE  IN PARTICULAR HOW THE LINES FOR ACCOUNT REC AND AMT  PAST 
  367. DUE HAVE BEEN RELOCATED FROM THE ORIGINAL  ACCTREC.FRM.
  368.  
  369. THE CONTENTS OF THE ACCTREC.FRM FILE HAVE THE FOLLOWING MEANINGS:
  370.  
  371.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  372.       \        \       \        \        \               \
  373.        \        \       \        \        \               \__ FIELD LABEL
  374.         \        \       \        \        \__ MISC FIELD (NOT USED)
  375.          \        \       \        \__ LENGTH OF DATA FIELD (MAX 60 CHAR)
  376.           \        \       \__ FORM OF THE DATA FIELD:
  377.            \        \            15 = ASCII (ALPHA) DATA
  378.             \        \           0  = NUMERIC DATA WITH NO DECIMAL DIGITS
  379.              \        \          1  = NUMERIC DATA WITH 1 DECIMAL DIGITS
  380.               \        \         2  = NUMERIC DATA WITH 2 DECIMAL DIGITS
  381.                \        \        N  = NUMERIC DATA WITH N DECIMAL DIGITS
  382.                 \        \       14 = NUMERIC DATA WITH 14 DECIMAL DIGITS
  383.                  \        \__ COLUMN OF FIRST CHARACTER OF FIELD LABEL
  384.                   \__ ROW OF FIRST CHARACTER OF FIELD LABEL
  385.  
  386. Information  in the "FRM" file may be edited to change  position, 
  387. data form,  field length, and label name. It is only necessary to 
  388. ensure that the original column spacing is maintained.
  389.  
  390.  
  391.                                 6
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.   FINALLY,  TO  CREATE THE FINAL ".DAT" FORM OF THE FILE THAT CAN 
  401. BE  ACCESSED  BY THE FILER GROUP OF  PROGRAMS,  RUN  THE  PROGRAM 
  402. "FRMTODAT".  THE OUTPUT OF THIS PROGRAM IS A FILER DATA FILE WITH 
  403. THE NAME "ACCTREC.DAT". 
  404.  
  405.     "FRMTODAT" CONVERTS FILE FROM XXX.FRM TO XXX.DAT
  406.  
  407.     ENTER FILENAME OF SOURCE FILE :  ACCTREC.FRM
  408.  
  409.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  410.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  411.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  412.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  413.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  414.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  415.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  416.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  417.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  418.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  419.  
  420.     ENTER CURRENT DATE (MM/DD/YY)  :  05/20/85
  421.  
  422.     ACCTREC.DAT HAS BEEN CREATED FOR USE WITH FILER PROGRAMS.
  423.  
  424.  
  425.   NOW, THE CREATION OF A FILER DATABASE FILE HAS BEEN COMPLETED.
  426. LOAD  IN  THE FILER DATABASE PROGRAM AND ENTER ACCTREC WHEN  THE 
  427. PROGRAM ASKS FOR THE SOURCE FILE.
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.                                 7
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                           FILER PROGRAM
  467.                           =============
  468.  
  469.    THE FILER PROGRAM permits the user to display,  add,  correct, 
  470. or  delete  data records from the disk file.  Upon entry  to  the 
  471. program,  the  user will be asked to input the name of the  FILER 
  472. FILE  to be opened and the current date.  FILER FILE  names  must 
  473. conform  to  the  rules  for file  names  required  by  the  Disk 
  474. Operating  System  and have a file extension of either ".DAT"  or 
  475. ".BAK".   FILER FILES with the ".BAK" file extension are the back 
  476. up of the most current version.
  477.  
  478.    DATA  DISPLAY  MODES  :  The FILER PROGRAM uses two  modes  or 
  479. levels when data records are being displayed (1) DATA RECORD MODE 
  480. and (2) FIELD DATA MODE.  In the DATA RECORD MODE,  only complete 
  481. data  records  are displayed with special keys referring  to  the 
  482. data record as a whole.  For example, if RETURN key is depressed, 
  483. the next whole data record to be displayed on the screen.  On the 
  484. other  hand,  while  in  the FIELD DATA MODE,  special  keys  are 
  485. defined  to act on the individual data fields which make  up  the 
  486. whole  data record.  For example,  while in the FIELD DATA  MODE, 
  487. depressing  the CTRL X key will cause the next field in the  data 
  488. record  to be available for editing or data entry.  Note that the 
  489. item  referenced  is the field as opposed to  the  whole  record. 
  490. Using  two  display modes makes it possible to step thru  a  data 
  491. file,  examining whole records at a time with a minimum number of 
  492. keystrokes  to  advance from one record to the next.  When it  is 
  493. desired to change from DATA RECORD MODE to FIELD DATA MODE,  this 
  494. may be accomplished by depressing the F2 FUNCTION key.  To change 
  495. back  from FIELD DATA MODE to DATA RECORD MODE,  depress  the  F1 
  496. FUNCTION key. 
  497.  
  498.    FILER MENU :  The FILER MENU is utilized to select the various 
  499. functions  that  will  be performed by the program  on  the  data 
  500. contained within a FILER FILE :
  501.  
  502.                (1) ADD / ENTER RECORDS
  503.  
  504.                (2) DISPLAY RECORDS
  505.  
  506.                (3) CORRECT RECORD
  507.  
  508.                (4) DELETE RECORD
  509.  
  510.                (5) END FILER PROGRAM
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.                                 8
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. ADD / ENTER RECORDS 
  533. ===================
  534.  
  535.    Selection  of the ADD / ENTER RECORD option on the  menu  will 
  536. begin  a loop to continuously enter new records.  The screen will 
  537. clear  and a null or empty data record will be displayed  on  the 
  538. screen.  Data  field  names will be displayed with blank  (filled 
  539. with spaces) fields after each field label.  The program will  be 
  540. in FIELD DATA MODE in which data can be successively entered into 
  541. each data field.  After entries have been made,  the program will 
  542. prompt, DATA OK (Y/N) ?  A response of "N" will cause the program 
  543. to  return to the first field and permit correction of data.  Any 
  544. response  other  than "N" will cause the program to build  a  new 
  545. data  record  ,  append this new data record to the  end  of  the 
  546. existing  data records in the FILER FILE and update the number of 
  547. records.  If the F1 FUNCTION key is depressed,  the program  will 
  548. return  to the FILER MENU.  A "Y" key will cause the record to be 
  549. saved and the screen cleared for the entry of another record. The 
  550. only  means of ending the continuous input of new records  is  to 
  551. use the F1 FUNCTION key. 
  552.  
  553.  
  554. DISPLAY RECORDS
  555. ===============
  556.  
  557.    Selection of the DISPLAY RECORDS option will cause the program 
  558. to request the number of the first record to be  displayed.  Then 
  559. in DATA RECORD MODE,  the program will successively display whole 
  560. records. When a given data record is displayed on the screen, the 
  561. 24th  line  will contain the prompt "RETURN TO CONTINUE" and  the 
  562. record number. 
  563.  
  564.    There are several special keys that will facilitate use of the 
  565. FILER PROGRAM : 
  566.  
  567. RETURN  KEY,        Causes  the next DATA RECORD to be  displayed 
  568. CTRL F, CTRL G,     or  if the current record is the last one  in 
  569. F10 FUNCTION KEY the file causes the MENU to be displayed.
  570.  
  571. F9 FUNCTION,        If  the  current record is  not  already  the 
  572. CTRL D, CTRL A      first record in the file,  the DOWN ARROW KEY 
  573.                     will  Cause  the previous DATA RECORD  to  be 
  574.                     displayed. 
  575.  
  576. F2 FUNCTION KEY,    Causes the program to change from DATA RECORD 
  577. CTRL E, CTRL X      MODE  to  FIELD DATA MODE thereby  making  it 
  578.                     possible  to edit or modify the data in  each 
  579.                     DATA FIELD.
  580.  
  581. F1 FUNCTION KEY     Causes  the program to leave the DATA  RECORD 
  582.                     MODE  and return to the program MENU.
  583.  
  584. BACK ARROW KEY      Causes a OK TO DELETE (Y/N) ?   prompt and on 
  585.                     a  "Y" answer causes the current record to be 
  586.                     replaced with a NULL or EMPTY data record
  587.  
  588.  
  589.                                 9
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.    When in the DISPLAY RECORDS mode, the entry of the F2 FUNCTION 
  599. KEY  or the CTRL X or CTRL E will cause the program to enter  the 
  600. FIELD DATA MODE. In this mode, the cursor will move from field to 
  601. field in the record to identify which field is available for data 
  602. entry or modification.
  603.  
  604.    In  the  FIELD  DATA EDIT MODE,  WORDSTAR  like  commands  are 
  605. available  to  edit data in the active  field.  The  special  key 
  606. functions are :  CTRL A,  CTRL S, CTRL D, CTRL F, CTRL T, CTRL Q, 
  607. CTRL  W,  FUNCTION  KEY 6,  FUNCTION KEY 8,  FUNCTION KEY  9  and 
  608. FUNCTION  KEY 10.  These keys control the data in the edit  field 
  609. and  the position of the cursor.  In general,  new characters and 
  610. entered  under  the cursor position with the  cursor  moving  one 
  611. position to the right. When characters are deleted, the character 
  612. PRIOR to the cursor position is deleted.
  613.  
  614.  
  615. RETURN KEY          Causes the cursor to move to the next  field. 
  616.                     If  the field just edited is the last  field, 
  617.                     the  record will be saved for writing to disk 
  618.                     and  the  program  will return  to  the  DATA 
  619.                     RECORD MODE. 
  620.  
  621. CTRL S              Causes  the cursor to move one  character  to 
  622.                     the left in the edit field.
  623.  
  624. CTRL D              Causes  the  cursor to move one character  to 
  625.                     the right in the edit field.
  626.  
  627. CTRL A              Causes  the  cursor to move one word  to  the 
  628.                     left in the edit field.
  629.  
  630. CTRL F              Causes  the  cursor to move one word  to  the 
  631.                     right in the edit field.
  632.  
  633. CTRL G              Causes  the character under the cursor to  be 
  634.                     deleted.  (The  BACK  ARROW  key  causes  the 
  635.                     character before the cursor to be deleted.)
  636.  
  637. CTRL T              Causes the word to the right of the cursor to 
  638.                     be deleted and all characters to the right to 
  639.                     be  moved  to  the  left  to  close  the  gap 
  640.                     created.
  641.  
  642. CTRL Y              Causes  the entire field to be replaced  with 
  643.                     spaces.
  644.  
  645. CTRL Q              Causes  the cursor to move to the left margin 
  646.                     of the current field.
  647.  
  648. CTRL W              Causes the cursor to move to the right margin 
  649.                     of the current field.
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                                10
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. BACK ARROW KEY      Causes  the character preceding the cursor to 
  665.                     be  deleted and subsequent characters to  the 
  666.                     right  to  all be moved one position  to  the 
  667.                     left.
  668.  
  669.  
  670. TAB KEY             Causes  the  cursor to move 6 spaces  to  the 
  671.                     right in the data field. Existing data in the 
  672.                     field is not changed by use of the TAB KEY.
  673.  
  674.    In  addition  to the special keys used to edit or enter  data, 
  675. there are several keys to permit manipulation of data or movement 
  676. between fields.  These keys are FUNCTION 1,  FUNCTION 6, FUNCTION 
  677. 8,  FUNCTION 9,  FUNCTION 10,  BACKSLASH, CTRL E, CTRL X, CTRL C, 
  678. and CTRL R.
  679.  
  680. FUNCTION 6,         Causes  the   cursor  to move  to  the  field 
  681. CTRL E              preceding the current data field. 
  682.  
  683. FUNCTION 8,         Causes  the cursor to move to the next  field 
  684. CTRL X              in the file.
  685.  
  686. CTRL R              Causes  the cursor to move to the first field 
  687.                     in the record.
  688.  
  689. BACK SLASH KEY      This key when depressed causes the program to 
  690.                     display the message : "FIND LABEL ..... ENTER 
  691.                     TARGET :  ". Date entered in response to this 
  692.                     message  is  compared  with the  data  labels 
  693.                     which identify each data field. If a match is 
  694.                     found with any of the data field labels,  the 
  695.                     cursor will move to that field.  If no  match 
  696.                     can  be  found,  the first field of the  data 
  697.                     record  will  be displayed.  For  example  if 
  698.                     after the entry of the "\", the data "NAM" is 
  699.                     entered,  the program will examine all  field 
  700.                     names  starting  with the first field for  an 
  701.                     field name that begins with the three letters 
  702.                     "NAM".  If for example,  one field was  named 
  703.                     "NAME" a match would be found and the  cursor 
  704.                     will move to that field.
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                                11
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. F10 FUNCTION KEY    This  key  when  depressed  causes  FILER  to 
  731.                     display  the message :  "SEARCH UP...   ENTER 
  732.                     TARGET  :".  Data  entered in  response  will 
  733.                     cause  the program to search all higher  data 
  734.                     records  for a match on the characters  which 
  735.                     are identified as the TARGET.  For example if 
  736.                     the  user  is  in  DATA FIELD  #  N  and  the 
  737.                     characters  "HARLAN" are entered in  response 
  738.                     to  the TARGET :   prompt,  the program  will 
  739.                     examine  each data record with higher  record 
  740.                     numbers  for  data  in  DATA FIELD  #  N  for 
  741.                     characters  which  match  with  the   letters 
  742.                     "HARLAN".  THIS  COMPARISON  FUNCTION IS  NOT 
  743.                     POSITION SENSITIVE.  If the target is matched 
  744.                     anywhere  in the field,  that record will  be 
  745.                     displayed  so the user may edit or enter  new 
  746.                     or  revised  data.   This  feature  makes  it 
  747.                     possible for a user to search a file for  any 
  748.                     given  name or value without having to  read, 
  749.                     display,  and  examine  the contents of  each 
  750.                     DATA RECORD.
  751.  
  752.                     If  the  search is being made for data  in  a 
  753.                     numeric field,  the number value entered will 
  754.                     be  converted to REAL NUMERIC FORMAT and  the 
  755.                     search  will  be for an exact  match  of  the 
  756.                     numeric value. If the search is being made in 
  757.                     an ASCII field,  then the search will be made 
  758.                     by  comparing  the data input as  the  search 
  759.                     target  with  all the data in the  comparison 
  760.                     fields. Note that in this ASCII comparison, a 
  761.                     match  is not dependent upon the position  of 
  762.                     the data.
  763.  
  764.                     When   searching  a  numeric  field,   it  is 
  765.                     possible  to look for values greater than  or 
  766.                     less  than the TARGET VALUE by including  the 
  767.                     greater  than sign ">" or the less than  sign 
  768.                     "<" as the first character of the field.  For 
  769.                     example,  if  it was desired to  find  values 
  770.                     greater than, say,  12.45, enter >12.45 after 
  771.                     the  ENTER TARGET request.  To find a  number 
  772.                     smaller than,  say,  99.9,  enter <99.9 after 
  773.                     the ENTER TARGET request.
  774.  
  775.                     FILER  saves the target value that is entered 
  776.                     in  a search and makes it possible to  repeat 
  777.                     the search for the same target.  To start the 
  778.                     search again, first depress the F10 KEY. Then 
  779.                     to  search for the same target,  depress  the 
  780.                     F10  KEY a second time without entering other 
  781.                     data.  FILER  will display the  target  value 
  782.                     saved and commence the search.
  783.  
  784.  
  785.  
  786.  
  787.                                12
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. F9 FUNCTION KEY     This  key causes the FILER program to  search 
  797.                     all  LOWER  data records for a match  on  the 
  798.                     data  which  was entered in response  to  the 
  799.                     message  "SEARCH DOWN....  ENTER  TARGET  :". 
  800.                     Operation   is  otherwise  the  same  as  the 
  801.                     GREATER THAN KEY above.
  802.  
  803.  
  804. F1 FUNCTION KEY     This  key will cause the program to skip  the 
  805. CTRL C              remaining fields in the data record and go to 
  806.                     the DATA OK prompt which occurs at the end of 
  807.                     data input to the fields of a DATA RECORD. In 
  808.                     essence it permits the user to exit the FIELD 
  809.                     DATA MODE and return to the DATA RECORD MODE.
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.                                13
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. CORRECT RECORD
  863. ==============
  864.  
  865.    Selection  of  the CORRECT RECORD option permits the  user  to 
  866. make  changes to the data held in any given  DATA  RECORD.  After 
  867. this option has been selected, the FILER program will request the 
  868. record  number of the DATA RECORD which is to be modified.  After 
  869. receiving  a  valid number,  the program will  display  the  DATA 
  870. RECORD in FIELD DATA MODE with the first field available for edit 
  871. or data entry. 
  872.  
  873.    All  special key functions detailed under the DISPLAY RECORDS, 
  874. FIELD  DATA  MODE are operative at this  time.  Data  fields  are 
  875. processed  sequentially and at the end the prompt DATA RECORD OK? 
  876. (Y/N)  is shown.  A "N" response will cause the first field to be 
  877. displayed again for edit or data entry.  Any other response  will 
  878. cause the program to store the DATA RECORD as modified and return 
  879. to the MENU.
  880.  
  881.  
  882. DELETE RECORD
  883. =============
  884.  
  885.    This option permits the user to replace the data stored in any 
  886. given  DATA  RECORD with a NULL or EMPTY data record.  After  the 
  887. option is selected,  the program will ask for a record number  to 
  888. be  entered.  After a valid number is entered,  the program  will 
  889. display  the contents of that DATA RECORD and display the  prompt 
  890. OK TO DELETE?  A "Y" response will cause the record to be deleted 
  891. by  being replaced with a NULL or EMPTY data record.  The  record 
  892. still exists, but there is nothing stored in it. NULL records can 
  893. be  eliminated  from  a FILER FILE by sorting the file  with  the 
  894. SORTER program.
  895.  
  896.  
  897.  
  898. END FILER PROGRAM
  899. =================
  900.  
  901.    At the conclusion of using the FILER PROGRAM, it is IMPERATIVE 
  902. that  the return to the DISK OPERATING SYSTEM be made via  OPTION 
  903. NUMBER 5.   In this option, the program performs the housekeeping 
  904. function of closing open files to ensure that data stored in  the 
  905. file  will be available in the future.  If the program "blows up" 
  906. and exits to the DISK OPERATING SYSTEM without closing the  FILER 
  907. FILE,  it is possible that recently added data in the file may be 
  908. lost.  It is highly recommended that regular backup procedures be 
  909. followed so that recovery is as painless as possible!
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.                                14
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.                              SORTER
  929.                              ======
  930.  
  931.   The SORTER program permits the user to sort any FILER FILE. The 
  932. program utilizes the following steps:
  933.  
  934.   First,  the  order of sort is determined by designating one  or 
  935. more fields within the record as the KEY fields. A maximum of ten 
  936. fields may be used to define the KEY. 
  937.   Second,  each  record  of the file is read and  data  from  the 
  938. fields  designated  as  KEY  fields is  assembled  in  the  order 
  939. selected into a file held in computer memory.
  940.   Third, the KEY field file is sorted to determine  the  desired 
  941. order of each record in the file. 
  942.   Fourth,  Using  this order,  records are read from the old file 
  943. and written to the replacement file in the desired sorted order.
  944.  
  945.  
  946.                     EXAMPLE OF SORTING A FILE
  947.                     =========================
  948.  
  949.   To  sort  a file,  such as the ACCTREC.DAT,  get to  the  Disk 
  950. Operating  System prompt for your computer and enter the  program 
  951. name "SORTER".  The program will load,  the screen will clear and 
  952. display  the  message "SORT A LA PASCAL" followed by  the  prompt 
  953. "ENTER SOURCE FILE NAME :  ".   Enter "ACCTREC", the name of the 
  954. FILER FILE that is to be sorted.  If the file name entered exists 
  955. as a disk file, the program will perform the following steps:
  956.  
  957.   1. If  a  file of the same name with the file extension  ".BAK" 
  958.      exists, it will be deleted and the message "ACCTREC.BAK HAS 
  959.      BEEN DELETED." will be displayed.
  960.  
  961.   2. The  file  that  is  to  be  sorted  will  be  renamed  from 
  962.      "ACCTREC.DAT"   TO   "ACCTREC.BAK".   Next   the   message 
  963.      "ACCTREC.DAT RENAMED ACCTREC.BAK" will be displayed on the 
  964.      screen.
  965.  
  966. The source FILER FILE will not be modified in any way by the sort 
  967. procedure.  If for any reason, the sort process does not complete 
  968. successfully and create a replacement FILER FILE,  it is possible 
  969. to  recover the original file by using the rename  capability  of 
  970. the Disk Operating System:
  971.  
  972.   REN ACCTREC.DAT = ACCTREC.BAK    (FOR CP/M COMPUTER DOS)
  973.   RENAME ACCTREC.BAK ACCTREC.DAT     (FOR PC DOS COMPUTERS )
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.                                15
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. The  screen will clear and the labels for each field followed  by 
  995. an equals and a field number will be displayed.  For the ACCTREC 
  996. FILER FILE, the screen looks like this:
  997.  
  998.  
  999. NAME  = 1                          ACCOUNT REC = 9
  1000. ADDR1 = 2                          AMT PAST DUE = 10
  1001. ADDR2 = 3
  1002. CITY  = 4                          AREA CODE = 7
  1003. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1004.  
  1005. IN ORDER OF IMPORTANCE :
  1006.  
  1007. ENTER KEY FIELD NUMBER :
  1008.  
  1009.  
  1010.  
  1011. If,  for  example,  it was desired to sort the FILER FILE by AREA 
  1012. CODE  as the first criteria and then to sort the records by  NAME 
  1013. as the second criteria,  first enter the digit "7" which is found 
  1014. as the field number corresponding to the label AREA CODE.
  1015.  
  1016.  
  1017.  
  1018. NAME  = 1                          ACCOUNT REC = 9
  1019. ADDR1 = 2                          AMT PAST DUE = 10
  1020. ADDR2 = 3
  1021. CITY  = 4                          AREA CODE = 7
  1022. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1023.  
  1024. IN ORDER OF IMPORTANCE :
  1025.  
  1026. ENTER KEY FIELD NUMBER : 7
  1027.  
  1028.  
  1029. The  screen will change on the 23rd and 24th lines of the  screen 
  1030. to prompt for the entry of the NEXT KEY FIELD:
  1031.  
  1032.  
  1033. NAME  = 1                          ACCOUNT REC = 9
  1034. ADDR1 = 2                          AMT PAST DUE = 10
  1035. ADDR2 = 3
  1036. CITY  = 4                          AREA CODE = 7
  1037. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1038.  
  1039. IN ORDER OF IMPORTANCE :
  1040.  
  1041. ENTER NEXT KEY FIELD :
  1042. ENTER RETURN ONLY TO END KEY DEFINITION
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.                                16
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. Next enter the digit "1" as the field number which corresponds to 
  1061. the label NAME :
  1062.  
  1063.  
  1064. NAME  = 1                          ACCOUNT REC = 9
  1065. ADDR1 = 2                          AMT PAST DUE = 10
  1066. ADDR2 = 3
  1067. CITY  = 4                          AREA CODE = 7
  1068. STATE = 5    ZIPCODE = 6           PHONE NBR = 8
  1069.  
  1070. IN ORDER OF IMPORTANCE :
  1071.  
  1072. ENTER NEXT KEY FIELD : 1
  1073. ENTER RETURN ONLY TO END KEY DEFINITION
  1074.  
  1075.  
  1076. To  end  the  KEY DEFINITION,  depress  the  return  key  without 
  1077. entering a digit (null entry).  The program will clear the screen 
  1078. and display :
  1079.  
  1080.  
  1081. KEY FIELDS SELECTED ARE :
  1082. =========================
  1083.  
  1084. 1 : AREA CODE
  1085. 2 : NAME
  1086.  
  1087. =========================
  1088.  
  1089. KEYLENGTH = 25
  1090. IS THIS OK (Y/N) :
  1091.  
  1092. If  the KEY FIELDS selected are correct and in the desired order, 
  1093. enter "Y" or else enter "N".   If "N" is entered,  the process of 
  1094. selecting KEY FIELDS will begin again.  If "Y" is selected,  then 
  1095. the  actual sort process will begin.  As records are read and the 
  1096. key  fields assembled,  the KEY FIELD data and the RECORD  NUMBER 
  1097. will  be displayed on the screen.  For the "ACCTREC"  FILE,  the 
  1098. display might look like this:
  1099.  
  1100. 313John Doe             1
  1101. 317Sam Spade            2
  1102. 419K. Philip            3
  1103. 215Ben Dogood           4
  1104.  
  1105. ===___________________===
  1106.  \       \              \
  1107.   \       \              \__ Record Number
  1108.    \       \__ NAME
  1109.     \
  1110.      \__ AREA CODE
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.                                17
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. Following the reading of the records of the file and the creation 
  1127. of  the  KEY  FIELDS,  the screen will clear  and  the  following 
  1128. messages will be displayed:
  1129.  
  1130.  
  1131. DATA INPUT COMPLETED
  1132.  
  1133.  ..oO[  SORTING  ]Oo..
  1134.  
  1135.  ..oO[  KEY SORT DONE  ]Oo..
  1136.  
  1137.  ..oO[  MOVING RECORDS  ]Oo.
  1138.  
  1139.  ..oO[  RECORDS MOVED  ]Oo..
  1140.  
  1141.  0   [  0 INDICATES SUCCESSFUL SORT  ]
  1142.  
  1143.  ..oO[   HAVE A GREAT DAY!   ]Oo..
  1144.  
  1145.  
  1146. The source FILER FILE will not be modified in any way by the sort 
  1147. procedure.  If for any reason, the sort process does not complete 
  1148. successfully and create a replacement FILER FILE,  it is possible 
  1149. to  recover the original file by using the rename  capability  of 
  1150. the Disk Operating System:
  1151.  
  1152.   REN ACCTREC.DAT = ACCTREC.BAK    (FOR CP/M COMPUTER DOS)
  1153.   RENAME ACCTREC.BAK ACCTREC.DAT     (FOR PC DOS COMPUTERS )
  1154.  
  1155. Disk sorts fail most often due to lack of available storage space 
  1156. on the disk.  If this is the case, correct the situation before a 
  1157. second attempt is made to sort the disk. FOR SAFETY, IF YOUR SORT 
  1158. FAILS,  EXIT THE SORT PROGRAM AND IMMEDIATELY COPY ALL FILES WITH 
  1159. THE  NAME  OF YOUR FILER FILE AND ANY FILE EXTENSION  TO  ANOTHER 
  1160. DISK.  In this way,  you will protect yourself from  accidentally 
  1161. "BACKING UP YOUR FILES OUT OF EXISTENCE". 
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.                                18
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.                          STARTER PROGRAM
  1193.                          ===============
  1194.  
  1195.   The  STARTER  program  is a beginning framework  for  a  report 
  1196. program that assists the user in preparing custom output reports. 
  1197. The  program  has been divided into two parts  "STARTER.PAS"  and 
  1198. "STARTER1.PAS".  In general, STARTER.PAS, contains the procedures 
  1199. necessary  to access a FILER FILE,  read data within each record, 
  1200. and edit the data into a from suitable for display.  STARTER1.PAS 
  1201. contains  the code to open a specific FILER FILE and  write  data 
  1202. into a custom report. 
  1203.  
  1204.   To  utilize the STARTER program,  it is necessary to be able to 
  1205. modify  the  program  which  is  written  in  TURBO  PASCAL.  The 
  1206. procedure  to  modify a source program and  create  a  executable 
  1207. program is as follows:
  1208.   (1)  Select the disk which contains the TURBO PASCAL  programs, 
  1209.   STARTER.PAS  AND STARTER1.PAS.  Bring your computer up  and  if 
  1210.   necessary go to the drive which will activate this disk.
  1211.   (2)  Make copies of the files "STARTER.PAS" and  "STARTER1.PAS" 
  1212.   giving the copies a name appropriate to the application  report 
  1213.   that you are creating.  For this discussion, it is assumed that 
  1214.   the  application is an ACCOUNTS RECEIVABLE report and the  file 
  1215.   will be renamed "ACCTREC.PAS" AND "ACCTREC1.PAS".
  1216.   (3) Enter "TURBO"  and depress the return key.
  1217.   (4)  Respond "Y" when turbo asks if you wish to  include  error 
  1218.   messages.
  1219.   (5)  Depress  "M"  for main file and enter  "ACCTREC"  and  the 
  1220.   return   key.   This  instructs  TURBO  PASCAL  to  begin   any 
  1221.   compilation using the file "ACCTREC.PAS".
  1222.   (6)  Depress  "E"  for edit and the source  code  contained  in 
  1223.   "ACCTREC.PAS" will be displayed on the screen.  In general, the 
  1224.   code in this source file does not have to be modified to create 
  1225.   a  custom report file with one important exception.  The source 
  1226.   code  is  divided into two parts and the first part  chains  or 
  1227.   links  to  the second part with a  compiler  directive.  It  is 
  1228.   necessary  to  modify this compiler directive which is  in  the 
  1229.   last   line   of   code  in  this   file.   Change   the   code 
  1230.   "{$ISTARTER1.PAS}" TO "{$IACCTREC1.PAS}". This instruction causes 
  1231.   the  compiler  to load the file "ACCTREC1" and to continue  the 
  1232.   compilation with this code.  See "COMPILER DIRECTIVES"  in  the 
  1233.   TURBO PASCAL manual for further information.
  1234.   (7) Key in "CTRL K" AND "D" to exit the TURBO PASCAL editor.
  1235.   (8) Depress "S" to cause TURBO PASCAL to save the changed file.
  1236.   (9)  Depress  "W" for work file and enter  "ACCTREC1"  and  the 
  1237.   depress the return key.  This establishes "ACCTREC1.PAS" as the 
  1238.   file  that  you which to work with to modify  the  program.
  1239.   (10)  Depress "E" and the TURBO PASCAL editor will display  the 
  1240.   contents  of  "ACCTREC1.PAS".  Make  the modifications  to  the 
  1241.   source  code  to customize the report program  to  the  desired 
  1242.   form.
  1243.   (11)  Key in "CTRL K" AND "D" to exit the editor and return  to 
  1244.   TURBO PASCAL.
  1245.   (12) Key in "S" to save the file by writing it to disk.
  1246.   (13) Key in "O" for "Options"
  1247.  
  1248.  
  1249.                                19
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.   (14) Key in "C" to build a "COM" FILE.
  1259.   (15) KEY IN "Q" to quit the options loop.
  1260.   (16)  Key in "C" to compile the program and build an executable 
  1261.   com file on disk under the file name "ACCTREC.COM".
  1262.   (17) Key in "Q" to quit TURBO PASCAL and return to DOS.
  1263.   (18) Key in "ACCTREC" and depress return to run the  customized 
  1264.   report program. (Make sure the printer is on and selected).
  1265.  
  1266.  
  1267.  
  1268. CONTENTS OF STARTER.PAS 
  1269. =====================
  1270.  
  1271.   "STARTER" contains the following functions / procedures:
  1272.  
  1273. BCDTOIN:                CONVERT   BINARY  CODED  DECIMAL  TO   AN 
  1274.                         INTEGER VALUE.
  1275.  
  1276. CHTOIN:                 CONVERT A PORTION OF AN ASCII STRING INTO 
  1277.                         AN INTEGER VALUE.
  1278.  
  1279. GETDATAFROMARRAY:       EXTRACT DATA FROM AN ARRAY OF  CHARACTERS 
  1280.                       AND CONVERT INTO A STRING EXPRESSION.
  1281.  
  1282. TIDE:                   DELETE  COMMAS,  DOLLAR  SIGNS  AND  PLUS 
  1283.                         SIGNS  FROM THE ASCII STRING DISPLAY OF A 
  1284.                        NUMBER.
  1285.  
  1286. EDITNBR:                EDIT  A NUMBER TO DISPLAY  DOLLAR  SIGNS, 
  1287.                         COMMAS, AND MINUS SIGN TO IMPROVE CLARITY 
  1288.                         IN READING THE VALUE.
  1289.  
  1290. STRINGTOREAL:           CONVERT  A ASCII STRING REPRESENTATION OF 
  1291.                         A NUMBER INTO A REAL DATA FORM TO  PERMIT 
  1292.                         USE  TO  THE  VALUE WITHIN  THE  COMPUTER 
  1293.                         PROGRAM.
  1294.  
  1295. CALCULATE:              CALCULATE    DATA   RECORD   NUMBER   AND 
  1296.                         PRECEDING  BYTE FOR USE  WITH  GETDATAREC 
  1297.                         PROCEDURE.
  1298.  
  1299. GETDATAREC:             PROCEDURE  TO READ AND WRITE DATA  RECORD 
  1300.                         FROM  DISK  AND PLACE IT IN  A  CHARACTER 
  1301.                         ARRAY NAMED "GETDATA".
  1302.  
  1303. EXIST:                  FUNCTION  TO  DETERMINE  IF  A   FILENAME 
  1304.                         EXISTS IN THE DISK DIRECTORY.
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.                                20
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. MOVERECORDDATATOARRAY:  PROCEDURE  TO  READ  A FILER  RECORD  AND 
  1325.                         PLACE  THE FIELD DATA INTO AN  ARRAY.  IF 
  1326.                         THE DATA IS ASCII AND IN THE NTH FIELD OF 
  1327.                         THE RECORD, THIS PROCEDURE WILL PLACE THE 
  1328.                         ASCII DATA IN ASCIIFIELD[N].  IF THE DATA 
  1329.                         IS  NUMERIC AND IN THE  NTH  FIELD,  THIS 
  1330.                         PROCEDURE WILL PLACE THE NUMERIC VALUE IN 
  1331.                         NUMFIELD[N].  THE VARIABLES ASCIIFIELD[N] 
  1332.                         AND  NUMFIELD[N]  MAY BE USED  IN  PASCAL 
  1333.                         STATEMENTS  TO DISPLAY OR MANIPULATE DATA 
  1334.                         IN ANY DESIRED FASHION.
  1335.  
  1336. STARTER.PAS   ENDS  WITH  THE  STATEMENT  {$ISTARTER1.PAS}  WHICH 
  1337. INSTRUCTS  THE COMPILER TO INCLUDE THE SOURCE CODE  CONTAINED  IN 
  1338. THE  PROGRAM "STARTER1.PAS".  WHEN THE STARTER PROGRAM IS USED AS 
  1339. THE BASIS FOR A CUSTOM REPORT,  IT MUST BE COPIED AND RENAMED  TO 
  1340. REFLECT THE NATURE OF THE REPORT.  FOR EXAMPLE,  IF THE REPORT IS 
  1341. AN  ACCOUNTS RECEIVABLE REPORT,  THEN STARTER.PAS MIGHT BE COPIED 
  1342. AND  RENAMED  ACCTREC.PAS  AND  STARTER1.PAS  MIGHT  BE   RENAMED 
  1343. ACCTREC1.PAS.  AT  THIS  TIME IT IS NECESSARY TO RENAME THE  LAST 
  1344. STATEMENT    IN    ACCTREC.PAS     FROM    {$ISTARTER1.PAS}    TO 
  1345. {$IACCTREC1.PAS}  SO THAT THE COMPILER INCLUDES THE  PROPER  CODE 
  1346. WHEN ACCTREC.PAS IS COMPILED.
  1347.  
  1348.  
  1349. CONTENTS OF STARTER1.PAS
  1350. =======================
  1351.  
  1352. "STARTER1" CONTAINS THE FOLLOWING PROCEDURES:
  1353.  
  1354. INITIALIZE:         PROVIDES CODE TO IDENTIFY THE REPORT NAME AND 
  1355.                     INPUT  THE FILER FILE NAME AND CURRENT  DATE. 
  1356.                     READS HEADER INFORMATION FROM FILER FILE  AND 
  1357.                     INITIALIZES  VARIABLES  FOR  ENTRY  INTO  THE 
  1358.                     REPORT PROGRAM.
  1359.  
  1360. NEWPAGE:            CAUSES PRINTER TO EXECUTE A FORMFEED.
  1361.  
  1362. PAGETITLE:          PRINTS  THE TITLE OF THE REPORT AND THE  PAGE 
  1363.                     NUMBER.
  1364.  
  1365. DATAHEADINGS:       PRINTS  A DATA HEADING TO IDENTIFY THE USE OF 
  1366.                     EACH COLUMN OF DATA.
  1367.  
  1368. PRINTSUBTOTALS:     PRINTS SUB TOTALS FOR THE COLUMNS OF DATA AND 
  1369.                     THEN SETS THE SUB TOTAL TO ZERO.
  1370.  
  1371. PRINTGRANDTOTALS    PRINTS THE GRAND TOTALS FOR THE DATA THAT HAS 
  1372.                     BEEN PRINTED.
  1373.  
  1374. These  procedures  are then followed by the code for  the  actual 
  1375. program that uses all the functions and procedures listed above.
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.                                21
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. CREATING A CUSTOMIZED REPORT PROGRAM
  1391. ====================================
  1392.  
  1393.   The  FILER  FILE  "ACCTREC" will be used as an example  of  the 
  1394. process  of creating a customized report program.  "ACCTREC"  was 
  1395. selected  as the name for the report program.  The first step  is 
  1396. then  to copy the STARTER.PAS AND STARTER1.PAS programs to  files 
  1397. called  "ACCTREC.PAS  "   and  "ACCTREC1.PAS".  This  leaves  the 
  1398. STARTER  PROGRAMS available for use with another report  program. 
  1399. Since  all  modifications  will  be  made  to  ACCTREC.PAS    and 
  1400. ACCTREC1.PAS,  the program generated will automatically be  named 
  1401. "ACCTREC.COM".
  1402.  
  1403.   The  "STARTER" programs refer to data in the filer file by  the 
  1404. array  names  ASCIIFIELD[N] and NUMFIELD[N].  The easiest way  of 
  1405. getting a list of the fields in the FILER FILE is to print a copy 
  1406. of the file generated by the "PICTOFRM" PROGRAM. In this example, 
  1407. the contents of "ACCTREC.FRM" look like this:
  1408.  
  1409.  
  1410.     NAME  : AAAAAAAAAAAAAAAAAAAA       ACCOUNT REC :  123,456.78
  1411.     ADDR1 : AAAAAAAAAAAAAAAAAAAA       AMT PAST DUE : 123,456.78
  1412.     ADDR2 : AAAAAAAAAAAAAAAAAAAA
  1413.     CITY  : AAAAAAAAAAAAAAAAA          AREA CODE : AAA
  1414.     STATE : AA   ZIPCODE : AAAAA       PHONE NBR : AAAAAAA
  1415.  
  1416.     ROW  1,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >NAME  <
  1417.     ROW  1,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >ACCOUNT REC  <
  1418.     ROW  2,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR1 <
  1419.     ROW  2,  COL 36, FORM  2, LEN   9, MISC ___, LABEL >AMT PAST DUE <
  1420.     ROW  3,  COL  1, FORM 15, LEN  20, MISC ___, LABEL >ADDR2 <
  1421.     ROW  4,  COL  1, FORM 15, LEN  17, MISC ___, LABEL >CITY <
  1422.     ROW  4,  COL 36, FORM  3, LEN  20, MISC ___, LABEL >AREA CODE <
  1423.     ROW  5,  COL  1, FORM 15, LEN   2, MISC ___, LABEL >STATE <
  1424.     ROW  5,  COL 14, FORM 15, LEN   5, MISC ___, LABEL >ZIPCODE <
  1425.     ROW  5,  COL 36, FORM 15, LEN   7, MISC ___, LABEL >PHONE NBR <
  1426.  
  1427. Extract the information on FORM and LABEL as follows:
  1428.  
  1429.  
  1430.     FORM 15, LABEL >NAME  <             FIELD 1   ASCIIFIELD[1]
  1431.     FORM  2, LABEL >ACCOUNT REC  <      FIELD 2   NUMFIELD[2]
  1432.     FORM 15, LABEL >ADDR1 <             FIELD 3   ASCIIFIELD[3]
  1433.     FORM  2, LABEL >AMT PAST DUE <      FIELD 4   NUMFIELD[4]
  1434.     FORM 15, LABEL >ADDR2 <             FIELD 5   ASCIIFIELD[5]
  1435.     FORM 15, LABEL >CITY <              FIELD 6   ASCIIFIELD[6]
  1436.     FORM 15, LABEL >AREA CODE <         FIELD 7   ASCIIFIELD[7]
  1437.     FORM 15, LABEL >STATE <             FIELD 8   ASCIIFIELD[8]
  1438.     FORM 15, LABEL >ZIPCODE <           FIELD 9   ASCIIFIELD[9]
  1439.     FORM 15, LABEL >PHONE NBR <         FIELD 10  ASCIIFIELD[10]
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.                                22
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. Field  numbers  start with 1 and are numbered in the  same  order 
  1457. that the cursor moves from field to field.  Any field with a FORM 
  1458. 15  is an ascii field.  Any field with a digit other than 15 is a 
  1459. numeric field with the decimal value determining how many  digits 
  1460. are displayed to the right of the decimal point.
  1461.  
  1462. IN  WRITING  A  CUSTOMIZED  REPORT,  DATA IN EACH  FIELD  CAN  BE 
  1463. REFERENCED  USING  THE VARIABLE ARRAY  NAMES  "ASCIIFIELD[N]  FOR 
  1464. ALPHA  DATA  AND NUMFIELD[N] FOR NUMERIC DATA WHERE N STANDS  FOR 
  1465. THE  FIELD NUMBER. For example,  to print the alpha data in field 
  1466. 1,  use the code : "WRITELN(LST,ASCIIFIELD[1];". Or, to print the 
  1467. number in field 4, use the code : "WRITELN(LST,NUMFIELD[4];".
  1468.  
  1469.   To  customize the title of the report,  search source code  for 
  1470. the following PASCAL CODE:
  1471. {================================================================}
  1472. {                 PROCEDURE PAGE TITLE                           }
  1473. {================================================================}
  1474. PROCEDURE PAGETITLE;
  1475. BEGIN
  1476.   WRITE(LST,'                   SAMPLE REPORT TITLE               ');
  1477.   WRITELN(LST,'PAGE ',PAGE);
  1478.   WRITELN(LST);
  1479.   WRITELN(LST);
  1480.   PAGE := PAGE +1;
  1481.   LINE := LINE +3;
  1482. END;
  1483. Revise  the  line that include the text "SAMPLE REPORT TITLE"  to 
  1484. the desired report title.  Add spaces after the title so that the 
  1485. location of the page number is correct in the final document.
  1486.  
  1487.  
  1488.   To customize the DATA HEADINGS,  search the source code for the 
  1489. following PASCAL CODE :
  1490. {================================================================}
  1491. {                 PROCEDURE DATA HEADING                         }
  1492. {================================================================}
  1493. PROCEDURE DATAHEADING;
  1494. BEGIN
  1495.   WRITELN(LST,'      NAME          ADDRESS       ACCOUNT 1       ACCOUNT 2');
  1496.   WRITELN(LST,'===========================================================');
  1497.   WRITELN(LST);
  1498.   LINE := LINE +3;
  1499. END;
  1500. Modify the lines which list the column names and the underline to 
  1501. conform to the desired report format and data content.
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.                                23
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.   To  customize  the  SUB TOTALS,  find the source code  for  the 
  1523. following PASCAL CODE :
  1524. {================================================================}
  1525. {                 PROCEDURE PRINT SUB TOTALS                     }
  1526. {================================================================}
  1527. PROCEDURE PRINTSUBTOTALS;
  1528. BEGIN
  1529.   WRITELN(LST,'                                  ============   ==========');
  1530.   WRITE(LST,'SUB TOTAL :                         ');
  1531.   ANS := EDITNBR(SUBTOTAL[5],10,2,'$');   { SUB TOTAL FOR ACCOUNT 1 }
  1532.   WRITE (LST,ANS);
  1533.   ANS := EDITNBR(SUBTOTAL[6],13,1,' ');   { SUB TOTAL FOR ACCOUNT 2 }
  1534.   WRITELN(LST,ANS);
  1535.   WRITELN(LST);
  1536.  
  1537.   SUBTOTAL[5] := 0;
  1538.   SUBTOTAL[6] := 0;
  1539.  
  1540.   LINE := LINE + 3;
  1541.  
  1542.   IF LINE > PAGEFULLLINECOUNT - 3 THEN
  1543.     BEGIN
  1544.       NEWPAGE;
  1545.       PAGETITLE;
  1546.     END;
  1547. END;
  1548. Modify  the source code to position the title "SUB TOTAL :".  Now 
  1549. examine  the  code  which  is used to  edit  a  value  stored  in 
  1550. SUBTOTAL[N]  and print the answer :
  1551.   ANS := EDITNBR(SUBTOTAL[5],10,2,'$');   { SUB TOTAL FOR ACCOUNT 1 }
  1552.    \        \         \    \   \ \  \
  1553.     \        \         \    \   \ \  \__ EDIT CHARACTER, EITHER "$" 
  1554.      \        \         \    \   \ \     OR SPACE, PLACED BEFORE
  1555.       \        \         \    \   \ \    PRINTED NUMERIC VALUE.
  1556.        \        \         \    \   \ \__ NUMBER OF DIGITS AFTER THE
  1557.         \        \         \    \   \    DECIMAL POINT.
  1558.          \        \         \    \   \__ WIDTH OF THE NUMERIC FIELD
  1559.           \        \         \    \
  1560.            \        \         \    \____ FIELD NUMBER OF DATA.
  1561.             \        \         \ 
  1562.              \        \         \___ NAME OF VARIABLE TO BE EDITED.
  1563.               \        \
  1564.                \        \__ PASCAL FUNCTION TO EDIT NUMBER, ADD $
  1565.                 \           AND COMMAS AND PLACE RESULT IN AN ASCII
  1566.                  \          FIELD OF A SPECIFIED LENGTH.
  1567.                   \
  1568.                    \__ ASCII STRING TO HOLD RESULT OF EDIT.
  1569.  
  1570.   WRITE (LST,ANS);
  1571. Using  a  similar pattern of instructions,  modify  the  code  to 
  1572. output all the desired subtotals.
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.                                24
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.   To  customize the GRAND TOTALS,  find the source code  for  the 
  1589. following PASCAL CODE :
  1590. {================================================================}
  1591. {                 PROCEDURE PRINT GRAND TOTALS                   }
  1592. {================================================================}
  1593. PROCEDURE PRINTGRANDTOTALS;
  1594. BEGIN
  1595.   WRITELN(LST,'                                  ============   ==========');
  1596.   WRITE(LST,'GRAND TOTAL :                    ');
  1597.   ANS := EDITNBR(GRANDTOTAL[5],13,2,'$');   { SUB TOTAL FOR ACCOUNT 1 }
  1598.   WRITE (LST,ANS);
  1599.   ANS := EDITNBR(GRANDTOTAL[6],13,1,' ');   { SUB TOTAL FOR ACCOUNT 2 }
  1600.   WRITELN(LST,ANS);
  1601. END;
  1602. Customizing  GRAND TOTALS is identical in form to customizing the 
  1603. SUB TOTALS, as explained above.
  1604.  
  1605.  
  1606. Subtotals  are  printed when the contents of a  designated  field 
  1607. change  in contents.  For example,  if it was desired to  have  a 
  1608. subtotal  printed  every time the NAME in FIELD 1 changed  it  is 
  1609. necessary  to set two lines of code.  First,  it is necessary  to 
  1610. initialize  the contents of a comparison field so that we do  not 
  1611. do  a SUB TOTAL at the beginning of the report.  Find the  source 
  1612. code which contains the following :
  1613.  
  1614. {================================================================}
  1615. {                  OUTPUT CODE GOES HERE                         }
  1616. {================================================================}
  1617. BEGIN
  1618.  
  1619.   INITIALIZE;                   { ID AND READ IN FILE PARAMETERS }
  1620.  
  1621.   PAGE := 1;                             { INITIALIZE FOR REPORT }
  1622.   LINE := 1;
  1623.   PAGEFULLLINECOUNT := 60;
  1624.   DATARECORD := 1;                      { SET UP SUB TOTAL TEST }
  1625.   MOVERECORDDATATOARRAY;
  1626.   PREVCONTENTS := ASCIIFIELD[1];
  1627. Modify  the contents of the last line of code to insert the field 
  1628. number that will be used for comparison  purposes.  ASCIIFIELD[1] 
  1629. is  the  correct comparison field if we wish to have  SUB  TOTALS 
  1630. every time the NAME changes.
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.                                25
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. Second,  it is necessary to modify the line of code that actually 
  1655. tests  to  see  if the field has changed and then  call  the  SUB 
  1656. TOTALS  PROCEDURE if it has.  Find the SOURCE CODE which contains 
  1657. the following:
  1658.   {==============================================================}
  1659.   {                 PROCESS BODY OF REPORT                       }
  1660.   {==============================================================}
  1661.  
  1662.   FOR DATARECORD := 1 TO NBRRECUSED DO
  1663.     BEGIN
  1664.       MOVERECORDDATATOARRAY;
  1665.       {========================================}
  1666.       {   CHECK TO SEE IF SUB TOTAL IS REQD    }
  1667.       {========================================}
  1668.       IF ASCIIFIELD[1] <> PREVCONTENTS THEN
  1669.         BEGIN
  1670.           PREVCONTENTS := ASCIIFIELD[1];
  1671.           PRINTSUBTOTALS;
  1672.         END;
  1673. Modify the IF statement above so that the field designated refers 
  1674. to the field  which controls the SUB TOTAL. In this case the code 
  1675. "IF ASCIIFIELD[1] <> PREVCONTENTS THEN..." is correct.
  1676.  
  1677.   To  customize  the body of the report where the data  from  the 
  1678. FILER  FILE  is  actually printed,  find  the  source  code  that 
  1679. contains the following :
  1680.  
  1681.       {========================================}
  1682.       {       WRITE LINE OF DATA HERE          }
  1683.       {========================================}
  1684.       WRITE(LST,ASCIIFIELD[1],' ',ASCIIFIELD[2],'                ');
  1685.       ANS := EDITNBR(NUMFIELD[5],10,2,'$');   { ACCOUNT 1 }
  1686.       WRITE(LST,ANS);
  1687.       ANS := EDITNBR(NUMFIELD[6],13,1,' ');   { ACCOUNT 2 }
  1688.       WRITELN(LST,ANS);
  1689.  
  1690. This  code  outputs  the contents of ASCII FIELDS NUMBER  1  &  2 
  1691. followed by edited numeric data from NUMERIC FIELDS NUMBER 5 & 6. 
  1692. NUMERIC FIELD 5 is displayed in a field 10 characters wide with 2 
  1693. digits  after the decimal point and a leading $.  NUMERIC FIELD 6 
  1694. is  displayed in a field 13 characters wide,  with 1 digit  after 
  1695. the  decimal point and with no dollar sign.  (See the  discussion 
  1696. under SUB TOTALS for additional information on the functioning of 
  1697. the EDITNBR function). Use a similar pattern of code to customize 
  1698. the report to display the desired information.
  1699.  
  1700.   This  concludes the steps required to generate a custom report. 
  1701. EXIT  the TURBO PASCAL EDITOR,  compile the program  as  detailed 
  1702. previously and you have powerful customized output program. 
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.                                26
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.                         TRANSFER PROGRAM
  1721.                         ================
  1722.  
  1723.   The  TRANSFER  PROGRAM permits the transfer of data within  one 
  1724. FILER  FILE  to  a  second  FILER  FILE  with  a  different  file 
  1725. organization. Data in a record is transferred on a field by field 
  1726. basis  from the source FILER FILE to the DESTINATION FILER  FILE. 
  1727. Where  data  is  transferred between fields with  differing  data 
  1728. formats, data is converted to the new data format and inserted in 
  1729. the  field.  At the conclusion of the program,  the SOURCE  FILER 
  1730. FILE is left unchanged and the DESTINATION FILER FILE is expanded 
  1731. to contain the translated data. 
  1732.  
  1733.   Before the TRANSFER PROGRAM can be used,  both the SOURCE FILER 
  1734. FILE and the DESTINATION FILER FILE must be created and  resident 
  1735. on the disk with the TRANSFER PROGRAM. The DESTINATION FILER FILE 
  1736. should  preferably be empty although this is not  mandatory.  The 
  1737. empty  DESTINATION  FILER  FILE can be easily  created  from  the 
  1738. SOURCE  FILER  FILE  with  the  use  of  the  programs  DATTOPIC, 
  1739. PICTOFRM,  FRMTODAT,  and  any  convenient WORD EDITOR  that  can 
  1740. produce  clean text.  Refer to the documentation on each of these 
  1741. programs.
  1742.  
  1743.   At the start the program will display
  1744.  
  1745.  
  1746. TRANSFER A LA PASCAL
  1747. ENTER SOURCE FILE NAME : ________
  1748. ENTER DESTINATION FILE NAME : _________
  1749.  
  1750. Enter the name of the older FILER FILE that contains the data you 
  1751. wish  to  transfer  after the request for the SOURCE  FILE  NAME. 
  1752. Entry of the file extension '.dat' is optional. Enter the name of 
  1753. the  new FILER FILE that you wish to transfer data to  after  the 
  1754. request  for  the DESTINATION FILE NAME.  Again the extension  is 
  1755. optional.  Transfer  will open both files and display  the  field 
  1756. labels  and a field label number of the DESTINATION FILER FILE on 
  1757. the screen:
  1758.  
  1759.  
  1760. NAME  = 1                          ACCOUNT REC = 7
  1761. ADDR1 = 2                          AMT PAST DUE = 8
  1762. ADDR2 = 3
  1763. CITY  = 4
  1764. STATE = 5    ZIPCODE = 6
  1765.  
  1766.  
  1767. NAME OF SOURCE FIELD TO BE TRANSLATED  : NAME
  1768. ENTER DESTINATION FIELD NUMBER (ABOVE) : 1
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.                                27
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. THE TRANSFER SCREEN :
  1787.  
  1788.  
  1789. NAME  = 1                          ACCOUNT REC = 7
  1790. ADDR1 = 2                          AMT PAST DUE = 8
  1791. ADDR2 = 3
  1792. CITY  = 4
  1793. STATE = 5    ZIPCODE = 6
  1794.  
  1795.  
  1796. NAME OF SOURCE FIELD TO BE TRANSLATED  : NAME
  1797. ENTER DESTINATION FIELD NUMBER (ABOVE) : 1
  1798.  
  1799. In  this  example,  the DESTINATION FILER FILE differs  from  the 
  1800. SOURCE FILER FILE only in that the fields for AREA CODE and PHONE 
  1801. have been eliminated. The name of the SOURCE FIELDS are displayed 
  1802. in  succession  on line 23 of the screen.  Line 24  provides  the 
  1803. means  of  entering the field number where data from  the  SOURCE 
  1804. FIELD will ultimately be stored.  In the screen displayed  above, 
  1805. the  number  '1'  would be entered so that data from  the  SOURCE 
  1806. FIELD 'NAME' will be transferred to the DESTINATION FIELD 'NAME'. 
  1807. If  a  RETURN is depressed without entering data or if a  '0'  is 
  1808. entered, no data will be transferred to the DESTINATION FIELD. If 
  1809. a '-' is entered,  the screen will display the previous field for 
  1810. entry.  When  all of the SOURCE FILE fields have been  displayed, 
  1811. the screen will clear and a TRANSLATION TABLE will be displayed :
  1812.  
  1813. OLD      NEW       OLD LABEL  ==>  NEW LABEL
  1814. FLD #    FLD #
  1815.  
  1816.   1  ===>  1   |   NAME    ===>   NAME
  1817.   2  ===>  2   |   ADDR1   ===>   ADDR
  1818.   3  ===>  3   |   ADDR2    ===>   ADDR2
  1819.   4  ===>  4   |   CITY     ===>   CITY
  1820.   5  ===>  5   |   STATE    ===>   STATE
  1821.   6  ===>  6   |   ZIPCODE   ===>   ZIPCODE
  1822.   7  ===>  0   |   AREA CODE  ===>                 { NO DATA
  1823.   8  ===>  0   |   PHONE NBR  ===>                 { TRANSFERRED
  1824.   9  ===>  9   |   ACCOUNT REC  ===>   ACCOUNT REC
  1825.  10  ===> 10   |   AMT PAST DUE  ===>   AMT PAST DUE
  1826.  
  1827. IS TRANSFER TABLE OK (Y/N) : 
  1828.  
  1829. A  response other than 'Y' will cause the process of defining the 
  1830. transfer  fields to begin again.  A 'Y' response will  cause  the 
  1831. program  to  continue and ask if a printed copy of the  table  is 
  1832. desired. A 'Y' response will cause the table to be printed.
  1833.  
  1834. After the TRANSFER TABLE has been defined, Transfer will read all 
  1835. records  from the SOURCE FILER FILE and transfer data on a  field 
  1836. by field basis in accordance with the transfer table.  During the 
  1837. actual  transfer,  the screen will display the number of  records 
  1838. transferred.
  1839.  
  1840.  
  1841.  
  1842.  
  1843.                                28
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.                   FILER PROGRAMMING INFORMATION
  1853.                   =============================
  1854.  
  1855.   INFORMATION  ON THE STRUCTURE OF ANY FILER FILE IS CONTAINED IN 
  1856. THE  FIRST  896  BYTES  OF  THE  RECORD.  A  DEBUG  DUMP  OF  THE 
  1857. ACCTREC.DAT FILE GIVES THE FOLLOWING DATA:
  1858.  
  1859. 0100  00 01 06 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1860. 0110  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1861. 0120  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1862. 0130  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1863. 0140  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1864. 0150  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1865. 0160  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1866. 0170  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1867.  
  1868. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  1869. 0190  32 30 32 31 30 30 35 2F-32 33 2F 38 35 20 20 20   2021005/23/85 
  1870. 01A0  06 06 06 06 06 08 10 10-12 13 30 30 30 30 30 30   ..........000000
  1871. 01B0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  1872. 01C0  20 20 20 17 02 05 03 07-09 09 30 30 30 30 30 30      .......000000
  1873. 01D0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  1874. 01E0  3F 3F 3F 3F 3F 3F 3F 3F-32 32 30 30 30 30 30 30   ????????22000000
  1875. 01F0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  1876.  
  1877. 0200  4E 41 4D 45 20 20 41 44-44 52 31 20 41 44 44 52   NAME  ADDR1 ADDR
  1878. 0210  32 20 43 49 54 59 20 20-53 54 41 54 45 20 5A 49   2 CITY  STATE ZI
  1879. 0220  50 43 4F 44 45 20 41 52-45 41 20 43 4F 44 45 20   PCODE AREA CODE 
  1880. 0230  50 48 4F 4E 45 20 4E 42-52 20 41 43 43 4F 55 4E   PHONE NBR ACCOUN
  1881. 0240  54 20 52 45 43 20 41 4D-54 20 50 41 53 54 20 44   T REC AMT PAST D
  1882. 0250  55 45 20 00 00 00 00 00-00 00 00 00 00 00 00 00   UE .............
  1883. 0260  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1884. 0270  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1885. 0280  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1886. 0290  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1887. 02A0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1888. 02B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1889. 02C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1890. 02D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1891. 02E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1892. 02F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1893.  
  1894. 0300  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1895. 0310  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1896. 0320  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1897. 0330  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1898. 0340  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1899. 0350  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1900. 0360  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1901. 0370  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1902.  
  1903.                        CONTINUED NEXT PAGE
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.                                29
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  1919. 0390  04 00 10 FF 05 00 10 FF-05 01 40 FF 04 03 60 FF   ..........@...`.
  1920. 03A0  05 03 60 FF 01 03 60 FF-02 03 60 FF 00 00 00 00   ..`...`...`.....
  1921. 03B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1922. 03C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1923. 03D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1924. 03E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1925. 03F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1926.  
  1927. 0400  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1928. 0410  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1929. 0420  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1930. 0430  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1931. 0440  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1932. 0450  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1933. 0460  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1934. 0470  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1935.  
  1936.  
  1937. DATA  STORED  BY THE FILER PROGRAM IN  ACCTREC.DAT  FOLLOWS  THE 
  1938. FIRST  896 BYTES SHOWN ABOVE.  ACTUAL DATA STORED IN THE FILES IS 
  1939. SHOWN BELOW :
  1940.  
  1941. 0480  52 4F 42 45 52 54 20 42-4C 41 4B 45 20 20 20 20   ROBERT BLAKE
  1942. 0490  20 20 20 20 4D 49 4C 4C-20 57 41 4C 4C 20 43 4F       MILL WALL CO
  1943. 04A0  56 45 52 49 4E 47 53 20-31 30 32 32 32 20 45 20   VERINGS 10222 E 
  1944. 04B0  54 45 4E 20 4D 49 4C 45-20 52 44 2E 54 52 4F 59   TEN MILE RD.TROY
  1945. 04C0  20 20 20 20 20 20 20 20-20 20 20 20 20 4E 54 31                NT1
  1946. 04D0  32 33 34 35 32 31 32 31-32 33 34 35 36 37 20 20   23452121234567
  1947. 04E0  20 31 30 31 2E 31 32 20-20 20 20 20 30 2E 30 30    101.12     0.00
  1948. 04F0  54 48 4F 4D 41 53 20 46-2E 20 53 4D 49 54 48 20   THOMAS F. SMITH 
  1949.  
  1950. 0500  20 20 20 20 54 52 49 4E-49 54 59 20 43 4F 52 50       TRINITY CORP
  1951. 0510  4F 52 41 54 49 4F 4E 20-33 30 38 30 30 20 45 41   ORATION 30800 EA
  1952. 0520  53 54 20 53 49 44 45 20-44 52 2E 20 53 55 4E 20   ST SIDE DR. SUN 
  1953. 0530  43 49 54 59 20 20 20 20-20 20 20 20 20 41 52 38   CITY         AR8
  1954. 0540  33 38 33 32 37 32 38 31-32 33 34 34 35 35 20 20   38327281234455
  1955. 0550  20 32 31 30 2E 30 30 20-20 20 20 31 35 2E 30 30    210.00    15.00
  1956. 0560  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1957. 0570  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  1958.  
  1959. 0580  53 54 55 41 52 54 20 53-2E 20 57 49 4E 44 53 4C   STUART S. WINDSL
  1960. 0590  4F 57 20 20 47 52 4F 57-20 52 49 54 45 20 47 52   OW  GROW RITE GR
  1961. 05A0  45 45 4E 48 4F 55 53 45-31 32 33 20 41 4D 45 52   EENHOUSE123 AMER
  1962. 05B0  49 43 41 4E 20 52 4F 41-44 20 20 20 42 4C 4F 4F   ICAN ROAD   BLOO
  1963. 05C0  4D 49 4E 47 54 4F 4E 20-20 20 20 20 20 4E 4A 30   MINGTON      NJ0
  1964. 05D0  31 32 33 34 33 38 31 31-32 33 34 35 36 37 20 20   12343811234567
  1965. 05E0  20 20 20 30 2E 30 30 20-20 20 20 20 30 2E 30 30      0.00     0.00
  1966.  
  1967. OTHER  DATA  ENTRIES WOULD BE APPENDED TO THIS DATA IN  A  MANNER 
  1968. SIMILAR TO THE ENTRIES ABOVE.
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.                                30
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. THE FIRST 128 BYTES OF THE ACCTREC.DAT :
  1985.  
  1986. 0100  00 01 06 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1987. 0110  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1988. 0120  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1989. 0130  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1990. 0140  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1991. 0150  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1992. 0160  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1993. 0170  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  1994.  
  1995. THIS  BLOCK OF DATA IS REQUIRED TO MAINTAIN COMPATIBILITY OF  THE 
  1996. FILER  PROGRAMS WITH DATAFILES CREATED UNDER AN  EARLIER  VERSION 
  1997. WRITTEN  IN BASIC-Z.  THE SECOND AND THIRD BYTES ARE UTILIZED  BY 
  1998. BASIC-Z  TO STORE THE LENGTH OF THE FILE.  FOR VERSIONS OF  FILER 
  1999. WRITTEN IN TURBO PASCAL, THESE FIRST 128 BYTES ARE NOT UTILIZED.
  2000.  
  2001.  
  2002. THE NEXT 128 BYTES OF ACCTREC.DAT CONTAIN A FILE NAME, NUMBER OF 
  2003. RECORDS USED,  RECORD LENGTH,  BLOCKING FACTOR,  NUMBER OF FIELDS 
  2004. PER  RECORD,  DATE OF LAST DATA ENTRY,  THE LENGTH OF EACH OF THE 
  2005. FIELD LABELS, THE LENGTH OF EACH OF THE DATA FIELDS, AND THE DATA 
  2006. TYPE FOR EACH FIELD :
  2007.  
  2008. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  2009. 0190  32 30 32 31 30 30 35 2F-32 33 2F 38 35 20 20 20   2021005/23/85 
  2010. 01A0  06 06 06 06 06 08 10 10-12 13 30 30 30 30 30 30   ..........000000
  2011. 01B0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  2012. 01C0  20 20 20 17 02 05 03 07-09 09 30 30 30 30 30 30      .......000000
  2013. 01D0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  2014. 01E0  3F 3F 3F 3F 3F 3F 3F 3F-32 32 30 30 30 30 30 30   ????????22000000
  2015. 01F0  30 30 30 30 30 30 30 30-30 30 30 30 30 30 30 30   0000000000000000
  2016.  
  2017. FILE NAME, NUMBER OF RECORD USED :
  2018. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  2019.       ================= =========== =========== =====
  2020.              \               \           \                                                                                                                       
  2021.               \               \           \___"   5" =  NBR RECORDS USED
  2022.                \               \
  2023.                 \               \___ "0000"  =  THIS FIELD NOT USED 
  2024.                  \
  2025.                   \__ "ACCTR" = FIRST 6 LETTERS OF FILE NAME USED WHEN
  2026.                                  FILE WAS CREATED.
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.                                31
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050. RECORD SIZE, BLOCKING FACTOR, NBR FIELDS/RECORD, DATE LAST ENTRY : 
  2051. 0180  41 43 43 54 53 52 30 30-30 30 20 20 20 35 31 31   ACCTR0000   511
  2052.                                                 =====
  2053.  
  2054. 0190  32 30 32 31 30 30 35 2F-32 33 2F 38 35 20 20 20   2021005/23/85 
  2055.       == ===== ===== ======================= ========
  2056.       \    \     \              \                \ 
  2057.        \    \     \              \                \__ "   " = NOT USED
  2058.         \    \     \              \
  2059.          \    \     \              \__ "05/23/85" = DATE OF LAST DATA
  2060.           \    \     \                              ENTRY TO FILE.
  2061.            \    \     \ 
  2062.             \    \     \__ "10" = NUMBER OF FIELDS IN EACH RECORD.
  2063.              \    \
  2064.               \    \__ "02" = BLOCKING FACTOR ( NUMBER OF RECORDS THAT
  2065.                \              CAN BE HELD IN A 256 BYTE BLOCK OF DATA )
  2066.                 \
  2067.                  \__ "112" = NUMBER OF BYTES IN EACH RECORD.
  2068.  
  2069.  
  2070. LENGTH OF LABEL FOR EACH FIELDS : 
  2071. 01A0  06 06 06 06 06 08 10 10-12 13 30 30 30 30 30 30   ..........000000
  2072.       == == == == == == == == == ==
  2073.        \  \                    \  \
  2074.         \  \    <== ETC ==>     \  \__ "13" = 13 BYTES LENGTH FOR LABEL
  2075.          \  \                    \            "AMT PAST DUE "
  2076.           \  \                    \__ "12" = 12 BYTES LENGTH FOR LABEL
  2077.            \  \                              "ACCOUNT REC "
  2078.             \  \__ "06" = 6 BYTE LENGTH FOR LABEL "ADDR1 "
  2079.              \__ "06" = 6 BYTE LENGTH FOR LABEL "NAME "
  2080.  
  2081.  
  2082. LENGTH OF EACH DATA FIELD "
  2083. 01C0  20 20 20 17 02 05 03 07-09 09 30 30 30 30 30 30      .......000000
  2084.       == == == == == == == == == ==
  2085.        \  \                    \  \
  2086.         \  \                    \  \__ "09" = 9 BYTES REQUIRED TO STORE
  2087.          \  \     <== ETC ==>    \            DATA FOR FIELD 10 WHOSE
  2088.           \  \                    \           PICTURE IS "123,456.78".
  2089.            \  \                    \          ( COMMAS ARE NOT STORED )
  2090.             \  \                    \__ "09" = 9 BYTES REQUIRED TO STORE
  2091.              \  \                              DATA FOR FIELD 9.
  2092.               \  \__ "20" = 20 BYTES REQUIRED TO STORE DATA FOR FIELD 1.
  2093.                \__ "20" = 20 BYTES REQUIRED TO STORE DATA FOR FIELD 2.
  2094.  
  2095.  
  2096. DATA TYPE (ASCII OR NUMERIC & NUMBER OF DIGITS AFTER DECIMAL POINT :
  2097. 01E0  3F 3F 3F 3F 3F 3F 3F 3F-32 32 30 30 30 30 30 30   ????????22000000
  2098.       == == == == == == == == == ==
  2099.                             \     \__ "32" = NUMERIC VALUE WITH TWO 
  2100.      <== "3F" IS ALPHA ==>   \               DIGITS AFTER THE DECIMAL 
  2101.                               \              POINT.
  2102.                                \__ "3F" = ALPHA DATA.
  2103. VALUES OF "30" TO "3E" ARE NUMERIC VALUES WITH THE HEX VALUE OF THE SECOND
  2104. DIGIT DETERMINING THE NUMBER OF DECIMAL DIGITS AFTER THE DECIMAL POINT. 
  2105.  
  2106.  
  2107.                                32
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116. THE NEXT 384 BYTES ARE USED TO STORE THE LABELS FOR THE FIELDS IN 
  2117. THE RECORD :
  2118.  
  2119. 0200  4E 41 4D 45 20 20 41 44-44 52 31 20 41 44 44 52   NAME  ADDR1 ADDR
  2120. 0210  32 20 43 49 54 59 20 20-53 54 41 54 45 20 5A 49   2 CITY  STATE ZI
  2121. 0220  50 43 4F 44 45 20 41 52-45 41 20 43 4F 44 45 20   PCODE AREA CODE 
  2122. 0230  50 48 4F 4E 45 20 4E 42-52 20 41 43 43 4F 55 4E   PHONE NBR ACCOUN
  2123. 0240  54 20 52 45 43 20 41 4D-54 20 50 41 53 54 20 44   T REC AMT PAST D
  2124. 0250  55 45 20 00 00 00 00 00-00 00 00 00 00 00 00 00   UE .............
  2125. 0260  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2126. 0270  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2127. 0280  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2128. 0290  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2129. 02A0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2130. 02B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2131. 02C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2132. 02D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2133. 02E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2134. 02F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2135.  
  2136. 0300  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2137. 0310  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2138. 0320  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2139. 0330  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2140. 0340  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2141. 0350  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2142. 0360  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2143. 0370  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2144.  
  2145.  
  2146. 0200  4E 41 4D 45 20 20 41 44-44 52 31 20 41 44 44 52   NAME  ADDR1 ADDR
  2147.       ================= ================= ===========
  2148.               |                 |               |
  2149.             NAME              ADDR1           ADDR
  2150.  
  2151. 0210  32 20 43 49 54 59 20 20-53 54 41 54 45 20 5A 49   2 CITY  STATE ZI
  2152.       ===== ================= ================= =====
  2153.         |           |                  |          |
  2154.         2         CITY               STATE       ZI
  2155.  
  2156. 0220  50 43 4F 44 45 20 41 52-45 41 20 43 4F 44 45 20   PCODE AREA CODE 
  2157.       ================= ============== ==============
  2158.               |                |              |
  2159.             PCODE             AREA          CODE
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.                                33
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182. THE  NEXT 128 BYTES ARE USED TO STORE SCREEN  FORMAT  INFORMATION 
  2183. FOR EACH FIELD.  DATA FOR EACH FIELD'S ROW AND COLUMN LOCATION IS 
  2184. HELD IN A 4 BYTE GROUP.
  2185.  
  2186. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  2187. 0390  04 00 10 FF 05 00 10 FF-05 01 40 FF 04 03 60 FF   ..........@...`.
  2188. 03A0  05 03 60 FF 01 03 60 FF-02 03 60 FF 00 00 00 00   ..`...`...`.....
  2189. 03B0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2190. 03C0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2191. 03D0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2192. 03E0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2193. 03F0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  2194.  
  2195.  
  2196. SCREEN INFORMATION :
  2197. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  2198.       =========== =========== =========== ===========
  2199.                        |
  2200.                        |
  2201.                   RR CC C  FF
  2202.                   == == == ==
  2203.                    \  \  \  \__ FIELD NUMBER ( NOT USED )
  2204.                     \  \  \
  2205.                      \  \__\___ COLUMN NUMBER
  2206.                       \
  2207.                        \_______ ROW NUMBER
  2208.  
  2209.  
  2210. 0380  56 32 2E 30 01 00 10 FF-02 00 10 FF 03 00 10 FF   V2.0............
  2211.                   == ====  ==
  2212.                    \   \     \__ "FF" = FIELD NUMBER (NOT USED)
  2213.                     \   \ 
  2214.                      \   \__ "001" = COLUMN NBR 1
  2215.                       \
  2216.                        \____ "01" = ROW NBR 1
  2217.  
  2218.  
  2219. 0390  04 00 10 FF 05 00 10 FF-05 01 40 FF 04 03 60 FF   ..........@...`.
  2220.                   == ====  ==
  2221.                    \   \     \__ "FF" = FIELD NUMBER (NOT USED)
  2222.                     \   \ 
  2223.                      \   \__ "001" = COLUMN NBR 1
  2224.                       \
  2225.                        \____ "05" = ROW NBR 5
  2226.  
  2227.  
  2228. 03A0  05 03 60 FF 01 03 60 FF-02 03 60 FF 00 00 00 00   ..`...`...`.....
  2229.                   == ====  ==
  2230.                    \   \     \__ "FF" = FIELD NUMBER (NOT USED)
  2231.                     \   \ 
  2232.                      \   \__ "036" = COLUMN NBR 36
  2233.                       \
  2234.                        \____ "01" = ROW NBR 1
  2235.  
  2236.  
  2237.  
  2238.  
  2239.                                34
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248. DATA  STORED  BY THE FILER PROGRAM IN  ACCTREC.DAT  FOLLOWS  THE 
  2249. FIRST  896 BYTES SHOWN ABOVE.  ACTUAL DATA STORED IN THE FILES IS 
  2250. SHOWN BELOW :
  2251.  
  2252. 0480  52 4F 42 45 52 54 20 42-4C 41 4B 45 20 20 20 20   ROBERT BLAKE
  2253. 0490  20 20 20 20 4D 49 4C 4C-20 57 41 4C 4C 20 43 4F       MILL WALL CO
  2254. 04A0  56 45 52 49 4E 47 53 20-31 30 32 32 32 20 45 20   VERINGS 10222 E 
  2255. 04B0  54 45 4E 20 4D 49 4C 45-20 52 44 2E 54 52 4F 59   TEN MILE RD.TROY
  2256. 04C0  20 20 20 20 20 20 20 20-20 20 20 20 20 4E 54 31                NT1
  2257. 04D0  32 33 34 35 32 31 32 31-32 33 34 35 36 37 20 20   23452121234567
  2258. 04E0  20 31 30 31 2E 31 32 20-20 20 20 20 30 2E 30 30    101.12     0.00
  2259. 04F0  54 48 4F 4D 41 53 20 46-2E 20 53 4D 49 54 48 20   THOMAS F. SMITH 
  2260.  
  2261. 0500  20 20 20 20 54 52 49 4E-49 54 59 20 43 4F 52 50       TRINITY CORP
  2262. 0510  4F 52 41 54 49 4F 4E 20-33 30 38 30 30 20 45 41   ORATION 30800 EA
  2263. 0520  53 54 20 53 49 44 45 20-44 52 2E 20 53 55 4E 20   ST SIDE DR. SUN 
  2264. 0530  43 49 54 59 20 20 20 20-20 20 20 20 20 41 52 38   CITY         AR8
  2265. 0540  33 38 33 32 37 32 38 31-32 33 34 34 35 35 20 20   38327281234455
  2266. 0550  20 32 31 30 2E 30 30 20-20 20 20 31 35 2E 30 30    210.00    15.00
  2267. 0560  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  2268. 0570  20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 
  2269.  
  2270.  
  2271.  
  2272. BREAKDOWN OF FIELDS IN FIRST RECORD :
  2273.  
  2274. 0480  52 4F 42 45 52 54 20 42-4C 41 4B 45 20 20 20 20   ROBERT BLAKE
  2275. 0490  20 20 20 20 
  2276.  
  2277. 0490              4D 49 4C 4C-20 57 41 4C 4C 20 43 4F       MILL WALL CO
  2278. 04A0  56 45 52 49 4E 47 53 20-                          VERINGS 
  2279.  
  2280. 04A0                         -31 30 32 32 32 20 45 20   VERINGS 10222 E 
  2281. 04B0  54 45 4E 20 4D 49 4C 45-20 52 44 2E               TEN MILE RD.
  2282.  
  2283. 04B0                                      54 52 4F 59               TROY
  2284. 04C0  20 20 20 20 20 20 20 20-20 20 20 20 20 
  2285.  
  2286. 04C0                                         4E 54                   NT
  2287.  
  2288. 04C0                                               31                  1
  2289. 04D0  32 33 34 35                                       2345
  2290.  
  2291. 04D0              32 31 32                                  212
  2292.  
  2293. 04D0                       31-32 33 34 35 36 37                1234567
  2294.  
  2295. 04D0                                            20 20 
  2296. 04E0  20 31 30 31 2E 31 32                               101.12 
  2297.  
  2298. 04E0                       20-20 20 20 20 30 2E 30 30               0.00
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.                                35
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324. (***************************************************************)
  2325. (*                                                             *)
  2326. (*        FILER A LA PASCAL DATA BASE SOURCE CODE FILE         *)
  2327. (*                                                             *)
  2328. (*        (C) 1985 by  John M. Harlan                          *)
  2329. (*                     24000 Telegraph                         *)
  2330. (*                     Southfield, MI. 48034                   *)
  2331. (*                                                             *)
  2332. (*     The FILER GROUP of programs is released on a "FREE      *)
  2333. (*     SOFTWARE" basis.  The recipient is free to examine      *)
  2334. (*     and use the software with the understanding that if     *)
  2335. (*     the FILER GROUP of programs prove to be of use and      *)
  2336. (*     value,  a contribution to the author is encouraged.     *)
  2337. (*                                                             *)
  2338. (*     While reasonable effort has been made to ensure the     *)
  2339. (*     reliability of the FILER GROUP of programs, no war-     *)
  2340. (*     ranty is given. The recipient uses the programs at      *)
  2341. (*     his own risk  and in no event shall the author be       *)
  2342. (*     liable for damages arising from their use.              *)
  2343. (*                                                             *)
  2344. (*                                                             *)
  2345. (***************************************************************)
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.                                36
  2372.