home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / ENTERPRS / CPM / UTILS / S / ZDB18C.LBR / ZDB18SRC.LYR / ZDB18.D < prev    next >
Text File  |  1993-03-31  |  4KB  |  178 lines

  1. ; ZDB18.D, string and date module for ZDB18
  2. ; 01/29/92
  3. ; Joe Mortensen
  4. ;
  5. ;    string and data storage
  6. ;
  7. srtfnm:    dc    'SORTED.$$$'    ; temporary file name for sort file
  8. bakfil:    dc    'BACKUP.DTA'    ; backup file name
  9. ziptyp:    db    'ZIP Code '    ; zip code index message
  10. lntyp:    db    'Last Name'    ; last name index message
  11. ;
  12. ; Field title panel
  13. ;
  14. panel:    db    15        ; number of elements
  15.     db    01,01,1,'ZDB vers ',vers/10+ '0','.',vers mod 10 +'0'
  16.     db    suffix
  17.     db    2,0
  18.     db    01,22,1
  19. datafil:db    '                ',2,0
  20. inxmsg:    db    03,15,'Index >',1
  21. inxtyp:    db    'Last Name ',2,0    ; default index is last name
  22.     dc    03,51,'Last modified >'
  23.     dc    06,10,'First Name >'
  24.     dc    07,11,'Last Name >'
  25.     dc    08,11,'Address 1 >'
  26.     dc    09,11,'Address 2 >'
  27.     dc    10,16,'City >'
  28.     dc    11,15,'State >'
  29.     dc    12,17,'Zip >'
  30.     dc    13,13,'Country >'
  31.     dc    15,15,'Phone >'
  32.     dc    17,10,'Comments 1 >'
  33.     dc    18,10,'Comments 2 >'
  34. ;
  35. ; cursor positions for record display fields
  36. ;
  37. pospanel:
  38.     db    11        ; number of fields
  39.     db    06,22,fslen    ; fstnm
  40.     db    07,22,lnlen    ; lname
  41.     db    08,22,a1len    ; addr1
  42.     db    09,22,a2len    ; addr2
  43.     db    10,22,cilen    ; city
  44.     db    11,22,stlen    ; state
  45.     db    12,22,zilen    ; zip
  46.     db    13,22,ctlen    ; ctry
  47.     db    15,22,phlen    ; phon
  48.     db    17,22,c1len    ; cmnts1
  49.     db    18,22,c2len    ; cmnts2
  50. ;
  51. ; addresses of record buffer fields
  52. ;
  53. fieldpanel:
  54.     dw    fstnm
  55.     dw    lname
  56.     dw    addr1
  57.     dw    addr2
  58.     dw    city
  59.     dw    state
  60.     dw    zip
  61.     dw    ctry
  62.     dw    phon
  63.     dw    cmnts1
  64.     dw    cmnts2
  65. ;
  66. ; Sort Specification Block for use with SORT
  67. ;
  68. ssb:
  69. first:    dw    0        ; address of the first record
  70. n:    dw    0        ; number of records
  71. size:    dw    16        ; length of each record
  72. comp:    dw    compv        ; address of our compare routine
  73. order:    dw    0        ; address of the order table
  74. point:    db    on        ; on to use pointers
  75. norec:    db    0        ; on to only sort pointers
  76. ;
  77. ; cdf file type
  78. ;
  79. cdftyp:    db    'CDF'
  80. wstyp:    db    'WSF'
  81. ;
  82. ; uninitialized data area
  83. ;
  84.     dseg
  85. ;
  86. ; initialize the following data area at startup
  87. ;
  88. data    equ    $        ; start of data area
  89. ;
  90. ; I/O Control Block for Datafile
  91. ;
  92. ioctl:    ds    1        ; use 16K buffer
  93.     ds    5        ; filled in by FXIO
  94. work:    ds    2        ; address of working buffer
  95. iocfc:    ds    1        ; filled in by FXIO to 0
  96.     ds    8        ; file name
  97. iotyp:    ds    3        ; file type
  98.     ds    24        ; filled in by FXIO
  99. ;
  100. ; record fields and field lengths
  101. ;
  102. ; each of these fields must be null-terminated so actual actual
  103. ; field length is one less
  104. ;
  105. edblk:                ; start of first record
  106. edblk1    equ    $+128        ; start of second record
  107. fstnm:    ds    21
  108. fslen    equ    $-fstnm
  109. lname:    ds    21
  110. lnlen    equ    $-lname
  111. addr1:    ds    24
  112. a1len    equ    $-addr1
  113. addr2:    ds    24
  114. a2len    equ    $-addr2
  115. city:    ds    18
  116. cilen    equ    $-city
  117. state:    ds    3        ; only 2-letter codes allowed
  118. stlen    equ    $-state
  119. zip:    ds    11
  120. zilen    equ    $-zip
  121. ctry:    ds    14
  122. ctlen    equ    $-ctry
  123. phon:    ds    39
  124. phlen    equ    $-phon
  125. cmnts1:    ds    39
  126. c1len    equ    $-cmnts1
  127. cmnts2:    ds    39
  128. c2len    equ    $-cmnts2
  129. ;
  130. datmod:    ds    3        ; no need for null-terminator here
  131.                 ; stored as bcd
  132. ;
  133. tcap:    ds    2        ; address of arrow keys in tcap
  134. cpos:    ds    1        ; cursor position (column and line)
  135. lpos:    ds    1
  136. ;
  137. xcopy:    ds    4        ; input buffer for number of copies
  138. copies:    ds    1        ; copies to print
  139. envflg:    ds    1        ; envelope flag
  140. prtflg:    ds    1        ; print flag signals need for ff
  141. eflag:    ds    1        ; print flag for empty field
  142. fflag:    ds    1        ; WS/ASCII file flag
  143. insflg:    ds    1        ; ON for character insert mode
  144. prkey:    ds    2        ; address of key to search
  145. fndflg:    ds    1        ; found flag for selection key
  146. keyflg:    ds    1        ; flag for output by key
  147. keylen:    ds    2        ; length of search key for prdir & dfile
  148. ;
  149. capflag:ds    1        ; edloop flag for state caps input
  150. datbuf:    ds    3        ; temporary date buffer
  151. today:    ds    6        ; current date and time (bcd)
  152. wsdatbuf:
  153.     ds    19
  154. ;
  155. recs:    ds    2        ; number of records in file
  156. fptr:    ds    2        ; pointer to current record
  157. xfptr:    ds    2        ; last record read during indexing
  158. newflg:    ds    1        ; new flag (used with add/edit)
  159. ;
  160. count:    ds    2        ; counter for sort loop
  161. xcount:    ds    2        ; counter for express search, print loop
  162. recptr:    ds    2        ; record pointer for sorted file
  163. xrecptr:ds    2        ; last record pointer for sorted file
  164. srttyp:    ds    1        ; 0=last/first names, nz=zip index
  165. srtfcb:    ds    36        ; sort file control block
  166. sfdrv:    ds    1        ; sort file drive
  167. sfusr:    ds    1        ; sort file user area
  168. bakfcb:    ds    36        ; backup file control block
  169. fdrv:    ds    1        ; file drive
  170. fusr:    ds    1        ; file user area
  171. nambuf:    ds    12        ; buffer for original file name
  172. srch:    ds    11        ; search string
  173. inxptr:    ds    2        ; index record pointer for qfind
  174. datalen    equ    $-data
  175. ;
  176.     ds    80        ; stack space
  177. stack:    ds    2        ; old stack location
  178.