DBFINVOI.LST 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. Listing:
  2. 1 IMPLEMENTATION MODULE DBFInvoice;
  3. 2 (*
  4. 3 * ModBase
  5. 4 * Release 3.0
  6. 5 * (c) Copyright 1986 - 1991 PMI
  7. 6 * P.O. Box 8402
  8. 7 * Green Bay Wi 53308
  9. 8 * All Rights Reserved
  10. 9 * by Ed Ross
  11. 10 *)
  12. 11
  13. 12 FROM ModBase3 IMPORT InitDBF,OpenDBF,CloseDBF,ReadDBRec,GetField,
  14. 13 DBFile,DefaultFixUp,NilDBF;
  15. 14 FROM DBCopier IMPORT DBPack;
  16. 15 FROM DBIndxes IMPORT InitIndex,OpenIndex,AddToUpdateList,CloseIndex,
  17. 16 CurrentRec,FindPositionCh,BuildIndex,GoTop,GoBottom,
  18. 17 NextRecord,PrevRecord,CurrentKeyCh,FindPositionN,
  19. 18 CurrentKeyN,DBIndex,InitCompIndex,BuildCompIndex;
  20. 19 FROM DBStuff IMPORT MakeKey;
  21. 20 FROM Drectory IMPORT DeleteFile;
  22. 21 FROM StrEdit IMPORT CrunchBlanks,CAPstr,Append;
  23. 22 FROM StrConv IMPORT StrToReal;
  24. 23 FROM NumTypes IMPORT Real8,REALToReal8;
  25. 24 FROM ScanUtils IMPORT Present,CaseSens;
  26. 25 FROM DBFields IMPORT GetDateField,GetLogicalField,GetNumField,Replace,
  27. 26 ReplaceD,ReplaceN;
  28. 27
  29. 28
  30. 29 CONST
  31. 30 Buffer = 0;
  32. 31 Safty = TRUE;
  33. 32 Exclusive = FALSE;
  34. 33 AutoLock = TRUE;
  35. 34 VAR
  36. 35 DBInit,IndexOpen : BOOLEAN;
  37. 36
  38. 37 PROCEDURE MoveInvoiceToDBF(Rec : InvoiceRec );
  39. ***** ^ undeclared identifier
  40. 38 (* This code will move the data from the record to *)
  41. 39 (* the data base *)
  42. 40 BEGIN
  43. 41 WITH Rec DO
  44. ***** ^ not supported yet
  45. 42 Replace( InvoiceDBF, 1,INVOICE); (* Invoice number *)
  46. ***** ^ not supported yet
  47. ***** ^ undeclared identifier
  48. ***** ^ undeclared identifier
  49. 43 ReplaceD( InvoiceDBF, 2,INVDATE ); (* Invoce date *)
  50. ***** ^ not supported yet
  51. ***** ^ undeclared identifier
  52. ***** ^ undeclared identifier
  53. 44 Replace( InvoiceDBF, 3,CUSTID); (* FK - customer id number *)
  54. ***** ^ not supported yet
  55. ***** ^ undeclared identifier
  56. ***** ^ undeclared identifier
  57. 45 ReplaceN( InvoiceDBF, 4,INVNET ); (* Invoice net *)
  58. ***** ^ not supported yet
  59. ***** ^ undeclared identifier
  60. ***** ^ undeclared identifier
  61. 46 ReplaceN( InvoiceDBF, 5,INVTAX ); (* Invoice Tax *)
  62. ***** ^ not supported yet
  63. ***** ^ undeclared identifier
  64. ***** ^ undeclared identifier
  65. 47 ReplaceN( InvoiceDBF, 6,AMTOUT ); (* Amount outstanding *)
  66. ***** ^ not supported yet
  67. ***** ^ undeclared identifier
  68. ***** ^ undeclared identifier
  69. 48 ReplaceN( InvoiceDBF, 7,TOTALAMT ); (* Invoice discount *)
  70. ***** ^ not supported yet
  71. ***** ^ undeclared identifier
  72. ***** ^ undeclared identifier
  73. 49 Replace( InvoiceDBF, 8,SPORDER ); (* special order boolean *)
  74. ***** ^ not supported yet
  75. ***** ^ undeclared identifier
  76. ***** ^ undeclared identifier
  77. 50 Replace( InvoiceDBF, 9,HELIUM ); (* Helium associated with order *)
  78. ***** ^ not supported yet
  79. ***** ^ undeclared identifier
  80. ***** ^ undeclared identifier
  81. 51 ReplaceN( InvoiceDBF, 10,INVDSCNT ); (* special discount *)
  82. ***** ^ not supported yet
  83. ***** ^ undeclared identifier
  84. ***** ^ undeclared identifier
  85. 52 Replace( InvoiceDBF, 11,CUSTPO ); (* customer's purchase order *)
  86. ***** ^ not supported yet
  87. ***** ^ undeclared identifier
  88. ***** ^ undeclared identifier
  89. 53 Replace( InvoiceDBF, 12,INVPRNT ); (* Invoice printed Y/N *)
  90. ***** ^ not supported yet
  91. ***** ^ undeclared identifier
  92. ***** ^ undeclared identifier
  93. 54 Replace( InvoiceDBF, 13,INVCLSD ); (* Invoice closed - no special out *)
  94. ***** ^ not supported yet
  95. ***** ^ undeclared identifier
  96. ***** ^ undeclared identifier
  97. 55 ReplaceD( InvoiceDBF, 14,SHIPDATE ); (* Date Shipped *)
  98. ***** ^ not supported yet
  99. ***** ^ undeclared identifier
  100. ***** ^ undeclared identifier
  101. 56 Replace( InvoiceDBF, 15,SALESMAN ); (* Whodoneit *)
  102. ***** ^ not supported yet
  103. ***** ^ undeclared identifier
  104. ***** ^ undeclared identifier
  105. 57 Replace( InvoiceDBF, 16,TERMS ); (* terms of invoice *)
  106. ***** ^ not supported yet
  107. ***** ^ undeclared identifier
  108. ***** ^ undeclared identifier
  109. 58 Replace( InvoiceDBF, 17,SHIPVIA ); (* method of shippment *)
  110. ***** ^ not supported yet
  111. ***** ^ undeclared identifier
  112. ***** ^ undeclared identifier
  113. 59 ReplaceN( InvoiceDBF, 18,SHIPPING ); (* shipping charge *)
  114. ***** ^ not supported yet
  115. ***** ^ undeclared identifier
  116. ***** ^ undeclared identifier
  117. 60 ReplaceN( InvoiceDBF, 19,REALToReal8(FLOAT(DFLTLVL))); (* default price level *)
  118. ***** ^ not supported yet
  119. ***** ^ undeclared identifier
  120. ***** ^ not supported yet
  121. ***** ^ undeclared identifier
  122. ***** ^ undeclared identifier
  123. 61 CAPstr(TAXABLE);
  124. ***** ^ not supported yet
  125. ***** ^ undeclared identifier
  126. 62 Replace(InvoiceDBF,20,TAXABLE); (* if taxable *)
  127. ***** ^ not supported yet
  128. ***** ^ undeclared identifier
  129. ***** ^ undeclared identifier
  130. 63 CAPstr(FREEFRGHT);
  131. ***** ^ not supported yet
  132. ***** ^ undeclared identifier
  133. 64 Replace(InvoiceDBF,21,FREEFRGHT); (* free freight *)
  134. ***** ^ not supported yet
  135. ***** ^ undeclared identifier
  136. ***** ^ undeclared identifier
  137. 65 Replace( InvoiceDBF, 22,NOTESFOR ); (* Notes for Inv, Pkg or both *)
  138. ***** ^ not supported yet
  139. ***** ^ undeclared identifier
  140. ***** ^ undeclared identifier
  141. 66 Replace( InvoiceDBF, 23,NOTE1 ); (* *)
  142. ***** ^ not supported yet
  143. ***** ^ undeclared identifier
  144. ***** ^ undeclared identifier
  145. 67 Replace( InvoiceDBF, 24,NOTE2 ); (* *)
  146. ***** ^ not supported yet
  147. ***** ^ undeclared identifier
  148. ***** ^ undeclared identifier
  149. 68 Replace( InvoiceDBF, 25,NOTE3 ); (* *)
  150. ***** ^ not supported yet
  151. ***** ^ undeclared identifier
  152. ***** ^ undeclared identifier
  153. 69 END; (* end of with REC *)
  154. ***** ^ not supported yet
  155. 70 END MoveInvoiceToDBF;
  156. ***** ^ not supported yet
  157. 71
  158. 72
  159. 73
  160. 74 PROCEDURE MoveInvoiceFromDBF(VAR Rec : InvoiceRec );
  161. ***** ^ undeclared identifier
  162. 75 (* This code will move the data from the Database to *)
  163. 76 (* the record *)
  164. 77 VAR B : BOOLEAN;
  165. 78 R : Real8;
  166. 79 BEGIN
  167. 80 WITH Rec DO
  168. ***** ^ not supported yet
  169. 81 GetField( InvoiceDBF, 1,INVOICE); (* Invoice number *)
  170. ***** ^ not supported yet
  171. ***** ^ undeclared identifier
  172. ***** ^ undeclared identifier
  173. 82 GetDateField( InvoiceDBF, 2,INVDATE ); (* Invoce date *)
  174. ***** ^ not supported yet
  175. ***** ^ undeclared identifier
  176. ***** ^ undeclared identifier
  177. 83 GetField( InvoiceDBF, 3,CUSTID); (* FK - customer id number *)
  178. ***** ^ not supported yet
  179. ***** ^ undeclared identifier
  180. ***** ^ undeclared identifier
  181. 84 GetNumField( InvoiceDBF, 4,INVNET ); (* Invoice net *)
  182. ***** ^ not supported yet
  183. ***** ^ undeclared identifier
  184. ***** ^ undeclared identifier
  185. 85 GetNumField( InvoiceDBF, 5,INVTAX ); (* Invoice Tax *)
  186. ***** ^ not supported yet
  187. ***** ^ undeclared identifier
  188. ***** ^ undeclared identifier
  189. 86 GetNumField( InvoiceDBF, 6,AMTOUT ); (* Amount outstanding *)
  190. ***** ^ not supported yet
  191. ***** ^ undeclared identifier
  192. ***** ^ undeclared identifier
  193. 87 GetNumField( InvoiceDBF, 7,TOTALAMT ); (* Invoice discount *)
  194. ***** ^ not supported yet
  195. ***** ^ undeclared identifier
  196. ***** ^ undeclared identifier
  197. 88 GetField( InvoiceDBF, 8,SPORDER); (* special order boolean *)
  198. ***** ^ not supported yet
  199. ***** ^ undeclared identifier
  200. ***** ^ undeclared identifier
  201. 89 GetField( InvoiceDBF, 9,HELIUM ); (* Helium associated with order *)
  202. ***** ^ not supported yet
  203. ***** ^ undeclared identifier
  204. ***** ^ undeclared identifier
  205. 90 GetNumField( InvoiceDBF, 10,INVDSCNT);
  206. ***** ^ not supported yet
  207. ***** ^ undeclared identifier
  208. ***** ^ undeclared identifier
  209. 91 GetField( InvoiceDBF, 11,CUSTPO ); (* customer's purchase order *)
  210. ***** ^ not supported yet
  211. ***** ^ undeclared identifier
  212. ***** ^ undeclared identifier
  213. 92 GetField( InvoiceDBF, 12,INVPRNT); (* Invoice printed Y/N *)
  214. ***** ^ not supported yet
  215. ***** ^ undeclared identifier
  216. ***** ^ undeclared identifier
  217. 93 GetField( InvoiceDBF, 13,INVCLSD); (* Invoice closed - no special out *)
  218. ***** ^ not supported yet
  219. ***** ^ undeclared identifier
  220. ***** ^ undeclared identifier
  221. 94 GetDateField( InvoiceDBF, 14,SHIPDATE ); (* Date Shipped *)
  222. ***** ^ not supported yet
  223. ***** ^ undeclared identifier
  224. ***** ^ undeclared identifier
  225. 95 GetField( InvoiceDBF, 15,SALESMAN ); (* Whodoneit *)
  226. ***** ^ not supported yet
  227. ***** ^ undeclared identifier
  228. ***** ^ undeclared identifier
  229. 96 GetField( InvoiceDBF, 16,TERMS ); (* terms of invoice *)
  230. ***** ^ not supported yet
  231. ***** ^ undeclared identifier
  232. ***** ^ undeclared identifier
  233. 97 GetField( InvoiceDBF, 17,SHIPVIA ); (* method of shippment *)
  234. ***** ^ not supported yet
  235. ***** ^ undeclared identifier
  236. ***** ^ undeclared identifier
  237. 98 GetNumField(InvoiceDBF,18,SHIPPING); (* shipping amount *)
  238. ***** ^ not supported yet
  239. ***** ^ undeclared identifier
  240. ***** ^ undeclared identifier
  241. 99 GetNumField(InvoiceDBF,19,R); (* default discount table level*)
  242. ***** ^ not supported yet
  243. ***** ^ undeclared identifier
  244. ***** ^ not supported yet
  245. 100 DFLTLVL := TRUNC(R);
  246. ***** ^ undeclared identifier
  247. ***** ^ undeclared identifier
  248. ***** ^ not supported yet
  249. 101 GetField( InvoiceDBF, 20,TAXABLE); (* if taxable invoice *)
  250. ***** ^ not supported yet
  251. ***** ^ undeclared identifier
  252. ***** ^ undeclared identifier
  253. 102 GetField( InvoiceDBF,21,FREEFRGHT);
  254. ***** ^ not supported yet
  255. ***** ^ undeclared identifier
  256. ***** ^ undeclared identifier
  257. 103 GetField( InvoiceDBF, 22,NOTESFOR ); (* Notes for Inv, Pkg or both *)
  258. ***** ^ not supported yet
  259. ***** ^ undeclared identifier
  260. ***** ^ undeclared identifier
  261. 104 GetField( InvoiceDBF, 23,NOTE1 ); (* *)
  262. ***** ^ not supported yet
  263. ***** ^ undeclared identifier
  264. ***** ^ undeclared identifier
  265. 105 GetField( InvoiceDBF, 24,NOTE2 ); (* *)
  266. ***** ^ not supported yet
  267. ***** ^ undeclared identifier
  268. ***** ^ undeclared identifier
  269. 106 GetField( InvoiceDBF, 25,NOTE3 ); (* *)
  270. ***** ^ not supported yet
  271. ***** ^ undeclared identifier
  272. ***** ^ undeclared identifier
  273. 107 END; (* end of with REC^ *)
  274. ***** ^ not supported yet
  275. 108 END MoveInvoiceFromDBF;
  276. ***** ^ not supported yet
  277. 109
  278. 110 PROCEDURE MakeCustKey(DBF : DBFile; Idx: DBIndex;
  279. 111 VAR Key : ARRAY OF CHAR);
  280. ***** ^ not supported yet
  281. 112
  282. 113
  283. 114 (* when indexed by customer id - append the status of on the key *)
  284. 115
  285. 116 VAR B : BOOLEAN;
  286. 117 Str : ARRAY[0..3] OF CHAR;
  287. ***** ^ not supported yet
  288. ***** ^ not supported yet
  289. 118 BEGIN
  290. 119 GetField(DBF,3,Key);
  291. ***** ^ not supported yet
  292. ***** ^ not supported yet
  293. ***** ^ not supported yet
  294. 120 GetField(DBF,12,Str);
  295. ***** ^ not supported yet
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. 121 Append(Key,Str);
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. 122 MakeKey(Key);
  303. ***** ^ not supported yet
  304. ***** ^ not supported yet
  305. 123 END MakeCustKey;
  306. ***** ^ not supported yet
  307. 124
  308. 125 PROCEDURE MakeInvoiceKey(DBF : DBFile; Idx: DBIndex;
  309. 126 VAR Key : ARRAY OF CHAR);
  310. ***** ^ not supported yet
  311. 127
  312. 128
  313. 129 (* when indexed by customer id - append the status of on the key *)
  314. 130
  315. 131 VAR B : BOOLEAN;
  316. 132 Str : ARRAY[0..3] OF CHAR;
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. 133 BEGIN
  320. 134 GetField(DBF,1,Key);
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. 135 MakeKey(Key);
  325. ***** ^ not supported yet
  326. ***** ^ not supported yet
  327. 136 END MakeInvoiceKey;
  328. ***** ^ not supported yet
  329. 137
  330. 138
  331. 139
  332. 140
  333. 141 PROCEDURE OpenInvoiceDBF(WithIdx : BOOLEAN);
  334. 142 VAR
  335. 143 B : CARDINAL;
  336. 144 BEGIN
  337. 145 IndexOpen := WithIdx;
  338. 146
  339. 147 (* Open the DBF file *)
  340. 148 IF NOT DBInit THEN
  341. 149 DBInit:=TRUE;
  342. 150 InitDBF("Invoice.DBF", InvoiceDBF,Buffer,Safty,Exclusive,AutoLock,
  343. ***** ^ not supported yet
  344. ***** ^ not supported yet
  345. ***** ^ undeclared identifier
  346. ***** ^ not supported yet
  347. ***** ^ not supported yet
  348. ***** ^ not supported yet
  349. 151 DefaultFixUp );
  350. ***** ^ not supported yet
  351. 152 InitCompIndex( "Invoice.Idx",InvoiceIdx,InvoiceDBF,MakeInvoiceKey,
  352. ***** ^ not supported yet
  353. ***** ^ not supported yet
  354. ***** ^ undeclared identifier
  355. ***** ^ undeclared identifier
  356. ***** ^ not supported yet
  357. 153 Buffer, Safty,FALSE,Exclusive);
  358. ***** ^ not supported yet
  359. ***** ^ not supported yet
  360. 154 AddToUpdateList( InvoiceDBF, InvoiceIdx );
  361. ***** ^ not supported yet
  362. ***** ^ undeclared identifier
  363. ***** ^ undeclared identifier
  364. 155 InitCompIndex( "Custid.Idx",CustidIdx,InvoiceDBF,MakeCustKey,
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. ***** ^ undeclared identifier
  368. ***** ^ undeclared identifier
  369. ***** ^ not supported yet
  370. 156 Buffer, Safty,FALSE,Exclusive);
  371. ***** ^ not supported yet
  372. ***** ^ not supported yet
  373. 157 AddToUpdateList( InvoiceDBF, CustidIdx );
  374. ***** ^ not supported yet
  375. ***** ^ undeclared identifier
  376. ***** ^ undeclared identifier
  377. 158
  378. 159 END;
  379. 160 IF NOT OpenDBF( InvoiceDBF)
  380. ***** ^ not supported yet
  381. ***** ^ undeclared identifier
  382. 161 THEN END;
  383. 162
  384. 163 IF WithIdx
  385. 164 THEN
  386. 165 (* open all indexes and append to dbfile *)
  387. 166 IF NOT OpenIndex( InvoiceIdx )
  388. ***** ^ not supported yet
  389. ***** ^ undeclared identifier
  390. 167 THEN
  391. 168 B := BuildCompIndex(InvoiceIdx,'C', 'INVOICE',10);
  392. ***** ^ not supported yet
  393. ***** ^ undeclared identifier
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. 169 END;
  397. 170 ActInvoiceIdx := InvoiceIdx; (* make current index *)
  398. ***** ^ undeclared identifier
  399. ***** ^ undeclared identifier
  400. 171 IF NOT OpenIndex( CustidIdx )
  401. ***** ^ not supported yet
  402. ***** ^ undeclared identifier
  403. 172 THEN
  404. 173 B := BuildCompIndex(CustidIdx, 'C','CUSTID',10);
  405. ***** ^ not supported yet
  406. ***** ^ undeclared identifier
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. 174 END;
  410. 175 ActInvoiceIdx := CustidIdx; (* make current index *)
  411. ***** ^ undeclared identifier
  412. ***** ^ undeclared identifier
  413. 176 END; (* with index *)
  414. 177 END OpenInvoiceDBF;
  415. ***** ^ not supported yet
  416. 178
  417. 179
  418. 180
  419. 181 PROCEDURE CloseInvoiceDBF (); (* close Data and index files *)
  420. 182
  421. 183 BEGIN
  422. 184 CloseDBF(InvoiceDBF); (* close dbf file *)
  423. ***** ^ not supported yet
  424. ***** ^ undeclared identifier
  425. 185 IF IndexOpen
  426. 186 THEN
  427. 187 CloseIndex(InvoiceIdx ); (* close index file *)
  428. ***** ^ not supported yet
  429. ***** ^ undeclared identifier
  430. 188 CloseIndex(CustidIdx ); (* close index file *)
  431. ***** ^ not supported yet
  432. ***** ^ undeclared identifier
  433. 189 END;
  434. 190 END CloseInvoiceDBF;
  435. ***** ^ not supported yet
  436. 191
  437. 192
  438. 193
  439. 194 PROCEDURE FindInvoiceByInvoice( Key : ARRAY OF CHAR) : BOOLEAN;
  440. ***** ^ not supported yet
  441. 195 VAR Found : BOOLEAN;
  442. 196 CKey : ARRAY[0..80] OF CHAR;
  443. ***** ^ not supported yet
  444. ***** ^ not supported yet
  445. 197 BEGIN
  446. 198 ActInvoiceIdx := InvoiceIdx ; (* make this index the active idx*)
  447. ***** ^ undeclared identifier
  448. ***** ^ undeclared identifier
  449. 199 MakeKey(Key);
  450. ***** ^ not supported yet
  451. ***** ^ not supported yet
  452. 200 FindPositionCh( InvoiceIdx, Key, Found);
  453. ***** ^ not supported yet
  454. ***** ^ undeclared identifier
  455. ***** ^ not supported yet
  456. ***** ^ not supported yet
  457. 201 CurrentKeyCh(InvoiceIdx,CKey);
  458. ***** ^ not supported yet
  459. ***** ^ undeclared identifier
  460. ***** ^ not supported yet
  461. 202 Found := Present(Key,CKey,CaseSens);
  462. ***** ^ not supported yet
  463. ***** ^ not supported yet
  464. ***** ^ not supported yet
  465. ***** ^ not supported yet
  466. 203 IF Found
  467. 204 THEN ReadDBRec( InvoiceDBF, CurrentRec( InvoiceIdx));
  468. ***** ^ not supported yet
  469. ***** ^ undeclared identifier
  470. ***** ^ not supported yet
  471. ***** ^ undeclared identifier
  472. 205 END;
  473. 206 RETURN Found;
  474. 207 END FindInvoiceByInvoice;
  475. ***** ^ not supported yet
  476. 208
  477. 209
  478. 210
  479. 211
  480. 212
  481. 213
  482. 214
  483. 215 PROCEDURE FindInvoiceByCustid( Key : ARRAY OF CHAR) : BOOLEAN;
  484. ***** ^ not supported yet
  485. 216 VAR Found : BOOLEAN;
  486. 217 CKey : ARRAY[0..80] OF CHAR;
  487. ***** ^ not supported yet
  488. ***** ^ not supported yet
  489. 218 BEGIN
  490. 219 ActInvoiceIdx := CustidIdx ; (* make this index the active idx*)
  491. ***** ^ undeclared identifier
  492. ***** ^ undeclared identifier
  493. 220 MakeKey(Key);
  494. ***** ^ not supported yet
  495. ***** ^ not supported yet
  496. 221 FindPositionCh( CustidIdx, Key, Found);
  497. ***** ^ not supported yet
  498. ***** ^ undeclared identifier
  499. ***** ^ not supported yet
  500. ***** ^ not supported yet
  501. 222 CurrentKeyCh(CustidIdx,CKey);
  502. ***** ^ not supported yet
  503. ***** ^ undeclared identifier
  504. ***** ^ not supported yet
  505. 223 Found := Present(Key,CKey,CaseSens);
  506. ***** ^ not supported yet
  507. ***** ^ not supported yet
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. 224 IF Found
  511. 225 THEN ReadDBRec( InvoiceDBF, CurrentRec( CustidIdx));
  512. ***** ^ not supported yet
  513. ***** ^ undeclared identifier
  514. ***** ^ not supported yet
  515. ***** ^ undeclared identifier
  516. 226 END;
  517. 227 RETURN Found;
  518. 228 END FindInvoiceByCustid;
  519. ***** ^ not supported yet
  520. 229
  521. 230
  522. 231
  523. 232
  524. 233
  525. 234
  526. 235
  527. 236 PROCEDURE NextInvoice () : BOOLEAN;
  528. 237 VAR
  529. 238 L : LONGINT; (* record number *)
  530. 239 BEGIN
  531. 240 IF NextRecord( ActInvoiceIdx,L)
  532. ***** ^ not supported yet
  533. ***** ^ undeclared identifier
  534. ***** ^ not supported yet
  535. 241 THEN ReadDBRec( InvoiceDBF,L );
  536. ***** ^ not supported yet
  537. ***** ^ undeclared identifier
  538. ***** ^ not supported yet
  539. 242 RETURN TRUE;
  540. 243 ELSE RETURN FALSE;
  541. 244 END;
  542. 245 END NextInvoice;
  543. ***** ^ not supported yet
  544. 246
  545. 247 PROCEDURE PrevInvoice () : BOOLEAN;
  546. 248 VAR
  547. 249 L : LONGINT; (* record number *)
  548. 250 BEGIN
  549. 251 IF PrevRecord( ActInvoiceIdx,L)
  550. ***** ^ not supported yet
  551. ***** ^ undeclared identifier
  552. ***** ^ not supported yet
  553. 252 THEN ReadDBRec( InvoiceDBF,L );
  554. ***** ^ not supported yet
  555. ***** ^ undeclared identifier
  556. ***** ^ not supported yet
  557. 253 RETURN TRUE;
  558. 254 ELSE RETURN FALSE;
  559. 255 END;
  560. 256 END PrevInvoice;
  561. ***** ^ not supported yet
  562. 257
  563. 258 PROCEDURE FirstInvoice ();
  564. 259 VAR
  565. 260 L : LONGINT; (* record number *)
  566. 261 BEGIN
  567. 262 GoTop(ActInvoiceIdx);
  568. ***** ^ not supported yet
  569. ***** ^ undeclared identifier
  570. 263 ReadDBRec( InvoiceDBF,CurrentRec( ActInvoiceIdx));
  571. ***** ^ not supported yet
  572. ***** ^ undeclared identifier
  573. ***** ^ not supported yet
  574. ***** ^ undeclared identifier
  575. 264 END FirstInvoice;
  576. ***** ^ not supported yet
  577. 265
  578. 266 PROCEDURE LastInvoice ();
  579. 267 VAR
  580. 268 L : LONGINT; (* record number *)
  581. 269 BEGIN
  582. 270 GoBottom(ActInvoiceIdx);
  583. ***** ^ not supported yet
  584. ***** ^ undeclared identifier
  585. 271 ReadDBRec( InvoiceDBF,CurrentRec( ActInvoiceIdx));
  586. ***** ^ not supported yet
  587. ***** ^ undeclared identifier
  588. ***** ^ not supported yet
  589. ***** ^ undeclared identifier
  590. 272 END LastInvoice;
  591. ***** ^ not supported yet
  592. 273
  593. 274
  594. 275 PROCEDURE PackInvoice();
  595. 276 VAR
  596. 277 EM : CARDINAL;
  597. 278 BEGIN
  598. 279 CloseInvoiceDBF();
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. 280
  602. 281
  603. 282 InitDBF("Invoice.DBF", InvoiceDBF,Buffer,Safty,TRUE,AutoLock,DefaultFixUp );
  604. ***** ^ not supported yet
  605. ***** ^ not supported yet
  606. ***** ^ undeclared identifier
  607. ***** ^ not supported yet
  608. ***** ^ not supported yet
  609. ***** ^ not supported yet
  610. 283 IF NOT OpenDBF( InvoiceDBF)
  611. ***** ^ not supported yet
  612. ***** ^ undeclared identifier
  613. 284 THEN END;
  614. 285 DBPack(InvoiceDBF);
  615. ***** ^ not supported yet
  616. ***** ^ undeclared identifier
  617. 286 CloseDBF(InvoiceDBF);
  618. ***** ^ not supported yet
  619. ***** ^ undeclared identifier
  620. 287 EM := DeleteFile('Invoice.IDX');
  621. ***** ^ not supported yet
  622. ***** ^ not supported yet
  623. 288 EM := DeleteFile('CustId.Idx');
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. 289 OpenInvoiceDBF(TRUE); (* open & rebuild the index *)
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. 290 CloseInvoiceDBF();
  630. ***** ^ not supported yet
  631. ***** ^ not supported yet
  632. 291
  633. 292 END PackInvoice;
  634. ***** ^ not supported yet
  635. 293
  636. 294 BEGIN
  637. 295 NilDBF(InvoiceDBF);
  638. ***** ^ not supported yet
  639. ***** ^ undeclared identifier
  640. 296 IndexOpen := FALSE;
  641. 297 DBInit:=FALSE;
  642. 298 END DBFInvoice.
  643. ***** ^ not supported yet
  644. 344 errors