GEN.LST 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226
  1. Listing:
  2. 1 IMPLEMENTATION MODULE Gen;
  3. 2 (*
  4. 3 * ModBase
  5. 4 * Release 3.0
  6. 5 * (c) Copyright 1986 - 1991 PMI
  7. 6 Copyright 1988 - 1991 John McMonagle
  8. 7 * P.O. Box 8402
  9. 8 * Green Bay Wi 53308
  10. 9 * All Rights Reserved
  11. 10 * by Ed Ross
  12. 11 *)
  13. 12
  14. 13 FROM GenLists IMPORT GenList,CopyList,DisposeList,ElmtNow,GetElmt,
  15. 14 GetElmtAdr,ListDelete,ListInsert,ListLength,NewList,StrCode,
  16. 15 ListReplace;
  17. 16 FROM ListUtils IMPORT TextFileToList;
  18. 17 FROM StrEdit IMPORT Append,SetLength,DeleteChar,DeleteRightJustified;
  19. 18 FROM StrConv IMPORT CardinalToStr;
  20. 19 FROM M2Strings IMPORT Length,Delete,Delete;
  21. ***** ^ duplicate identifier
  22. 20 FROM Str IMPORT Copy,Slice;
  23. 21 FROM PosUtils IMPORT Pos;
  24. 22 FROM StringIO IMPORT ErrorMessage,WriteStr,WriteEol;
  25. 23 FROM HandleIO IMPORT CreateFile;
  26. 24 FROM Prompts IMPORT Prompt;
  27. 25 FROM PosUtils IMPORT Present,Equal;
  28. ***** ^ duplicate identifier
  29. 26 FROM StrEdit IMPORT CAPstr,CrunchBlanks,ReplaceStr;
  30. ***** ^ duplicate identifier
  31. 27 FROM DataTypes IMPORT IndexElmtRec,IdxList,FldList,TableName,
  32. 28 DBFName,DataElmtRec,TableName;
  33. ***** ^ duplicate identifier
  34. 29
  35. 30 CONST
  36. 31 TableNm ='@TABLENAME@'; (* name of table without appendages *)
  37. ***** ^ not supported yet
  38. 32
  39. 33 IdxFldNm='@IDX@'; (* indexed fld name *)
  40. ***** ^ not supported yet
  41. 34 IdxName ='@IDXNAME@'; (* name of index (fld name with trunc to 8)*)
  42. ***** ^ not supported yet
  43. 35 FldName ='@FLDNAME@'; (* field name (indexed and non indexed *)
  44. ***** ^ not supported yet
  45. 36 IdxNbr ='@IDXNBR@'; (* index number *)
  46. ***** ^ not supported yet
  47. 37 IdxChar = '@IDXCHAR@'; (* accel key /Highlight key for menu *)
  48. ***** ^ not supported yet
  49. 38
  50. 39
  51. 40 ForEachFld = '>>FOR EACH FLD<<'; (* for each field start loop *)
  52. ***** ^ not supported yet
  53. 41 EndEachFld = '>>END FLD<<';
  54. ***** ^ not supported yet
  55. 42
  56. 43 ForEachIdx = '>>FOR EACH IDX<<'; (* for every index in table*)
  57. ***** ^ not supported yet
  58. 44 EndEachIdx = '>>END IDX<<';
  59. ***** ^ not supported yet
  60. 45 MakeRec = '>>MAKE RECORD<<'; (* create a record from data *)
  61. ***** ^ not supported yet
  62. 46 MakeDBF = '>>MAKE DATABASE<<';
  63. ***** ^ not supported yet
  64. 47 MoveTo = '>>MOVE TO DB<<'; (* move data from record to db rec *)
  65. ***** ^ not supported yet
  66. 48 MoveFrom = '>>MOVE FROM DB<<';
  67. ***** ^ not supported yet
  68. 49 OutFileName= '>>FILE NAME =';
  69. ***** ^ not supported yet
  70. 50 IfIdx = '>>IF INDEX ='; (* either Real, Character, or *)
  71. ***** ^ not supported yet
  72. 51 (* or Numeric (cardinal ) *)
  73. 52 EndIfIdx = '>>END IF<<'; (* end of conditional*)
  74. ***** ^ not supported yet
  75. 53 Include = '>>INCLUDE FILE ='; (* include a file by name of *)
  76. ***** ^ not supported yet
  77. 54 VAR
  78. 55
  79. 56 FileList : GenList;
  80. 57 Handle : CARDINAL;
  81. 58 SubList : GenList;
  82. 59 Condition : BOOLEAN; (* if processing in a conditional statement *)
  83. 60 ChangingState : BOOLEAN;
  84. 61 ProcessIdxType : CHAR;
  85. 62
  86. 63 PROCEDURE WriteCard(H: CARDINAL; Card : CARDINAL);
  87. 64 VAR
  88. 65 Str : ARRAY[0..10] OF CHAR;
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. 66 BEGIN
  92. 67 CardinalToStr(Card,3,Str);
  93. ***** ^ not supported yet
  94. ***** ^ not supported yet
  95. 68 WriteStr(H,Str);
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. 69
  99. 70 END WriteCard;
  100. ***** ^ not supported yet
  101. 71
  102. 72
  103. 73 PROCEDURE MakeModRec(ItemList : GenList);
  104. 74 VAR Str : ARRAY[0..80] OF CHAR;
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. 75 J : CARDINAL;
  108. 76 Code,Size: CARDINAL;
  109. 77 Item : POINTER TO DataElmtRec;
  110. ***** ^ not supported yet
  111. 78 BEGIN
  112. 79 WriteStr(Handle,TableName);
  113. ***** ^ not supported yet
  114. ***** ^ not supported yet
  115. 80 WriteEol(Handle,'Rec = RECORD');
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. 81 FOR J := 1 TO ListLength(ItemList) DO
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. 82 GetElmtAdr(ItemList,J,Item,Code,Size);
  122. ***** ^ not supported yet
  123. ***** ^ not supported yet
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. 83 WriteStr(Handle,' ');
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. 84 WriteStr(Handle,Item^.Name);
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. 85 WriteStr(Handle,' : ');
  134. ***** ^ not supported yet
  135. ***** ^ not supported yet
  136. 86 WriteStr(Handle,Item^.RecType);
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ not supported yet
  140. 87 WriteStr(Handle,';'); (* write the comments *)
  141. ***** ^ not supported yet
  142. ***** ^ not supported yet
  143. 88 WriteStr(Handle,' (* ');
  144. ***** ^ not supported yet
  145. ***** ^ not supported yet
  146. 89 WriteStr(Handle,Item^.Desc);
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. ***** ^ not supported yet
  150. 90 WriteEol(Handle,' *)');
  151. ***** ^ not supported yet
  152. ***** ^ not supported yet
  153. 91 END;
  154. 92 WriteEol(Handle,'END;');
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. 93
  158. 94 END MakeModRec;
  159. ***** ^ not supported yet
  160. 95
  161. 96 PROCEDURE MakeMoveTo(ItemList : GenList); (* create move to record *)
  162. 97 (* generate the code to move data from a record to the database *)
  163. 98 VAR J : CARDINAL;
  164. 99 Item : POINTER TO DataElmtRec;
  165. ***** ^ not supported yet
  166. 100 Size,Code : CARDINAL;
  167. 101
  168. 102 BEGIN
  169. 103 WriteStr(Handle,'PROCEDURE Move');
  170. ***** ^ not supported yet
  171. ***** ^ not supported yet
  172. 104 WriteStr(Handle,TableName);
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. 105 WriteStr(Handle,'ToDBF(Rec : ');
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. 106 WriteStr(Handle,TableName);
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. 107 WriteEol(Handle,'Rec ); ');
  182. ***** ^ not supported yet
  183. ***** ^ not supported yet
  184. 108 WriteEol(Handle,'(* This code will move the data from the record to *)');
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. 109 WriteEol(Handle,'(* the data base *)');
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. 110 WriteEol(Handle,'BEGIN');
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. 111 WriteEol(Handle,' WITH Rec DO');
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. 112 FOR J := 1 TO ListLength(ItemList) DO
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 113 GetElmtAdr(ItemList,J,Item,Code,Size);
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. ***** ^ not supported yet
  204. 114 CASE Item^.Type OF
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. 115 'C' : WriteStr(Handle,' Replace( ');
  208. ***** ^ not supported yet
  209. ***** ^ not supported yet
  210. 116 WriteStr(Handle,DBFName);
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. 117 WriteStr(Handle,',');
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. 118 WriteCard(Handle,J);
  217. ***** ^ not supported yet
  218. ***** ^ not supported yet
  219. 119 WriteStr(Handle,',');
  220. ***** ^ not supported yet
  221. ***** ^ not supported yet
  222. 120 WriteStr(Handle,Item^.Name);
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. ***** ^ not supported yet
  226. 121 WriteStr(Handle,');');
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. 122
  230. 123 |'N' : WriteStr(Handle,' ReplaceN( ');
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. 124 WriteStr(Handle,DBFName);
  234. ***** ^ not supported yet
  235. ***** ^ not supported yet
  236. 125 WriteStr(Handle,',');
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. 126 WriteCard(Handle,J);
  240. ***** ^ not supported yet
  241. ***** ^ not supported yet
  242. 127 WriteStr(Handle,',');
  243. ***** ^ not supported yet
  244. ***** ^ not supported yet
  245. 128 IF Item^.Dec > 0
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. 129 THEN WriteStr(Handle,Item^.Name);
  249. ***** ^ not supported yet
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. 130 ELSE WriteStr(Handle,'FLOAT(');
  253. ***** ^ not supported yet
  254. ***** ^ not supported yet
  255. 131 WriteStr(Handle,Item^.Name);
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. 132 WriteStr(Handle,')');
  260. ***** ^ not supported yet
  261. ***** ^ not supported yet
  262. 133 END;
  263. 134 WriteStr(Handle,');');
  264. ***** ^ not supported yet
  265. ***** ^ not supported yet
  266. 135 |'D' : WriteStr(Handle,' ReplaceD( ');
  267. ***** ^ not supported yet
  268. ***** ^ not supported yet
  269. 136 WriteStr(Handle,DBFName);
  270. ***** ^ not supported yet
  271. ***** ^ not supported yet
  272. 137 WriteStr(Handle,',');
  273. ***** ^ not supported yet
  274. ***** ^ not supported yet
  275. 138 WriteCard(Handle,J);
  276. ***** ^ not supported yet
  277. ***** ^ not supported yet
  278. 139 WriteStr(Handle,',');
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. 140 WriteStr(Handle,Item^.Name);
  282. ***** ^ not supported yet
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. 141 WriteStr(Handle,');');
  286. ***** ^ not supported yet
  287. ***** ^ not supported yet
  288. 142
  289. 143 |'L' : WriteStr(Handle,' ReplaceL( ');
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. 144 WriteStr(Handle,DBFName);
  293. ***** ^ not supported yet
  294. ***** ^ not supported yet
  295. 145 WriteStr(Handle,',');
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. 146 WriteCard(Handle,J);
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. 147 WriteStr(Handle,',');
  302. ***** ^ not supported yet
  303. ***** ^ not supported yet
  304. 148 WriteStr(Handle,Item^.Name);
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. ***** ^ not supported yet
  308. 149 WriteStr(Handle,');');
  309. ***** ^ not supported yet
  310. ***** ^ not supported yet
  311. 150 END; (* end of case of *)
  312. 151 WriteStr(Handle,' (* ');
  313. ***** ^ not supported yet
  314. ***** ^ not supported yet
  315. 152 WriteStr(Handle,Item^.Desc);
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. 153 WriteEol(Handle,' *)');
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. 154 END; (* end of for each field *)
  323. 155 WriteEol(Handle,'END; (* end of with REC *)');
  324. ***** ^ not supported yet
  325. ***** ^ not supported yet
  326. 156 WriteStr(Handle,'END Move');
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. 157 WriteStr(Handle,TableName);
  330. ***** ^ not supported yet
  331. ***** ^ not supported yet
  332. 158 WriteEol(Handle,'ToDBF;');
  333. ***** ^ not supported yet
  334. ***** ^ not supported yet
  335. 159 WriteEol(Handle,'');
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. 160 WriteEol(Handle,'');
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. 161 END MakeMoveTo;
  342. ***** ^ not supported yet
  343. 162
  344. 163
  345. 164
  346. 165
  347. 166
  348. 167 PROCEDURE MakeMoveFrom(ItemList : GenList); (* create move to record *)
  349. 168 (* generate the code to move data from a record to the database *)
  350. 169 VAR J : CARDINAL;
  351. 170 Item : POINTER TO DataElmtRec;
  352. ***** ^ not supported yet
  353. 171 Size,Code : CARDINAL;
  354. 172
  355. 173 BEGIN
  356. 174 WriteStr(Handle,'PROCEDURE Move');
  357. ***** ^ not supported yet
  358. ***** ^ not supported yet
  359. 175 WriteStr(Handle,TableName);
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. 176 WriteStr(Handle,'FromDBF(VAR Rec : ');
  363. ***** ^ not supported yet
  364. ***** ^ not supported yet
  365. 177 WriteStr(Handle,TableName);
  366. ***** ^ not supported yet
  367. ***** ^ not supported yet
  368. 178 WriteEol(Handle,'Rec ); ');
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. 179 WriteEol(Handle,'(* This code will move the data from the Database to *)');
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. 180 WriteEol(Handle,'(* the record *)');
  375. ***** ^ not supported yet
  376. ***** ^ not supported yet
  377. 181 WriteEol(Handle,'VAR B : BOOLEAN;');
  378. ***** ^ not supported yet
  379. ***** ^ not supported yet
  380. 182 WriteEol(Handle,' R : Real8;');
  381. ***** ^ not supported yet
  382. ***** ^ not supported yet
  383. 183 WriteEol(Handle,'BEGIN');
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. 184 WriteEol(Handle,' WITH Rec DO');
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. 185 FOR J := 1 TO ListLength(ItemList) DO
  390. ***** ^ not supported yet
  391. ***** ^ not supported yet
  392. 186 GetElmtAdr(ItemList,J,Item,Code,Size);
  393. ***** ^ not supported yet
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. 187 CASE Item^.Type OF
  398. ***** ^ not supported yet
  399. ***** ^ not supported yet
  400. 188 'C' : WriteStr(Handle,' GetField( ');
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. 189 WriteStr(Handle,DBFName);
  404. ***** ^ not supported yet
  405. ***** ^ not supported yet
  406. 190 WriteStr(Handle,',');
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. 191 WriteCard(Handle,J);
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. 192 WriteStr(Handle,',');
  413. ***** ^ not supported yet
  414. ***** ^ not supported yet
  415. 193 WriteStr(Handle,Item^.Name);
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. ***** ^ not supported yet
  419. 194 WriteStr(Handle,');');
  420. ***** ^ not supported yet
  421. ***** ^ not supported yet
  422. 195
  423. 196 |'N' : WriteStr(Handle,' GetNumField( ');
  424. ***** ^ not supported yet
  425. ***** ^ not supported yet
  426. 197 WriteStr(Handle,DBFName);
  427. ***** ^ not supported yet
  428. ***** ^ not supported yet
  429. 198 WriteStr(Handle,',');
  430. ***** ^ not supported yet
  431. ***** ^ not supported yet
  432. 199 WriteCard(Handle,J);
  433. ***** ^ not supported yet
  434. ***** ^ not supported yet
  435. 200 WriteStr(Handle,',');
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. 201 IF Item^.Dec > 0
  439. ***** ^ not supported yet
  440. ***** ^ not supported yet
  441. 202 THEN WriteStr(Handle,Item^.Name);
  442. ***** ^ not supported yet
  443. ***** ^ not supported yet
  444. ***** ^ not supported yet
  445. 203 ELSE WriteEol(Handle,'R);');
  446. ***** ^ not supported yet
  447. ***** ^ not supported yet
  448. 204 WriteStr(Handle,' ');
  449. ***** ^ not supported yet
  450. ***** ^ not supported yet
  451. 205 WriteStr(Handle,Item^.Name);
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. ***** ^ not supported yet
  455. 206 WriteStr(Handle,':= TRUNC(R');
  456. ***** ^ not supported yet
  457. ***** ^ not supported yet
  458. 207 END;
  459. 208 WriteStr(Handle,');');
  460. ***** ^ not supported yet
  461. ***** ^ not supported yet
  462. 209 |'D' : WriteStr(Handle,' GetDateField( ');
  463. ***** ^ not supported yet
  464. ***** ^ not supported yet
  465. 210 WriteStr(Handle,DBFName);
  466. ***** ^ not supported yet
  467. ***** ^ not supported yet
  468. 211 WriteStr(Handle,',');
  469. ***** ^ not supported yet
  470. ***** ^ not supported yet
  471. 212 WriteCard(Handle,J);
  472. ***** ^ not supported yet
  473. ***** ^ not supported yet
  474. 213 WriteStr(Handle,',');
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. 214 WriteStr(Handle,Item^.Name);
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. ***** ^ not supported yet
  481. 215 WriteStr(Handle,');');
  482. ***** ^ not supported yet
  483. ***** ^ not supported yet
  484. 216
  485. 217 |'L' : WriteStr(Handle,' GetLogicalField( ');
  486. ***** ^ not supported yet
  487. ***** ^ not supported yet
  488. 218 WriteStr(Handle,DBFName);
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. 219 WriteStr(Handle,',');
  492. ***** ^ not supported yet
  493. ***** ^ not supported yet
  494. 220 WriteCard(Handle,J);
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. 221 WriteStr(Handle,',');
  498. ***** ^ not supported yet
  499. ***** ^ not supported yet
  500. 222 WriteStr(Handle,Item^.Name);
  501. ***** ^ not supported yet
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. 223 WriteStr(Handle,');');
  505. ***** ^ not supported yet
  506. ***** ^ not supported yet
  507. 224 END; (* end of case of *)
  508. 225 WriteStr(Handle,' (* ');
  509. ***** ^ not supported yet
  510. ***** ^ not supported yet
  511. 226 WriteStr(Handle,Item^.Desc);
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. 227 WriteEol(Handle,' *)');
  516. ***** ^ not supported yet
  517. ***** ^ not supported yet
  518. 228 END; (* end of for each field *)
  519. 229 WriteEol(Handle,'END; (* end of with REC^ *)');
  520. ***** ^ not supported yet
  521. ***** ^ not supported yet
  522. 230 WriteStr(Handle,'END Move');
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. 231 WriteStr(Handle,TableName);
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. 232 WriteEol(Handle,'FromDBF;');
  529. ***** ^ not supported yet
  530. ***** ^ not supported yet
  531. 233 WriteEol(Handle,'');
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. 234 WriteEol(Handle,'');
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. 235
  538. 236 END MakeMoveFrom;
  539. ***** ^ not supported yet
  540. 237
  541. 238 PROCEDURE MakeDatabase( ItemList : GenList);
  542. 239 (* produce the code to build the data base *)
  543. 240 VAR
  544. 241 Str : ARRAY[0..80] OF CHAR;
  545. ***** ^ not supported yet
  546. ***** ^ not supported yet
  547. 242 TmpStr : ARRAY[0..15] OF CHAR;
  548. ***** ^ not supported yet
  549. ***** ^ not supported yet
  550. 243 Code, Size : CARDINAL;
  551. 244 Item : POINTER TO DataElmtRec;
  552. ***** ^ not supported yet
  553. 245 J : CARDINAL;
  554. 246 BEGIN
  555. 247 WriteEol(Handle,'PROCEDURE MakeDatabase();');
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. 248 WriteEol(Handle,'VAR ');
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. 249 WriteEol(Handle,' Error : CARDINAL;');
  562. ***** ^ not supported yet
  563. ***** ^ not supported yet
  564. 250 WriteEol(Handle,' Desc : POINTER TO ARRAY [1..200] OF DBFieldDescriptor;');
  565. ***** ^ not supported yet
  566. ***** ^ not supported yet
  567. 251 WriteEol(Handle,'BEGIN');
  568. ***** ^ not supported yet
  569. ***** ^ not supported yet
  570. 252 CardinalToStr(ListLength(ItemList),3,Str);
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. ***** ^ not supported yet
  575. 253 WriteStr(Handle,' ALLOCATE(Desc,');
  576. ***** ^ not supported yet
  577. ***** ^ not supported yet
  578. 254 WriteStr(Handle,Str);
  579. ***** ^ not supported yet
  580. ***** ^ not supported yet
  581. 255 WriteEol(Handle,' * SIZE(DBFieldDescriptor));');
  582. ***** ^ not supported yet
  583. ***** ^ not supported yet
  584. 256 WriteStr(Handle,' Fill(Desc, ');
  585. ***** ^ not supported yet
  586. ***** ^ not supported yet
  587. 257 WriteStr(Handle, Str);
  588. ***** ^ not supported yet
  589. ***** ^ not supported yet
  590. 258 WriteEol(Handle,' * SIZE(DBFieldDescriptor),0);');
  591. ***** ^ not supported yet
  592. ***** ^ not supported yet
  593. 259 FOR J := 1 TO ListLength(ItemList) DO
  594. ***** ^ not supported yet
  595. ***** ^ not supported yet
  596. 260 GetElmtAdr(ItemList,J,Item,Code,Size);
  597. ***** ^ not supported yet
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. 261 WriteStr(Handle,' MakeDescriptor(');
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. 262 CardinalToStr(J,3,Str);
  605. ***** ^ not supported yet
  606. ***** ^ not supported yet
  607. 263
  608. 264 TmpStr := ' Desc^[';
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. 265 Append(TmpStr,Str);
  612. ***** ^ not supported yet
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. 266 Append(TmpStr,"], '");
  616. ***** ^ not supported yet
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. 267 WriteStr(Handle,TmpStr);
  620. ***** ^ not supported yet
  621. ***** ^ not supported yet
  622. 268 WriteStr(Handle,Item^.Name);
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. 269 WriteStr(Handle,"'," );
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. 270
  630. 271 WriteCard(Handle,Item^.Len);
  631. ***** ^ not supported yet
  632. ***** ^ not supported yet
  633. ***** ^ not supported yet
  634. 272 WriteStr(Handle,"," );
  635. ***** ^ not supported yet
  636. ***** ^ not supported yet
  637. 273
  638. 274 WriteCard(Handle,Item^.Dec);
  639. ***** ^ not supported yet
  640. ***** ^ not supported yet
  641. ***** ^ not supported yet
  642. 275 WriteStr(Handle,", '" );
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. 276
  646. 277 WriteStr(Handle,Item^.Type);
  647. ***** ^ not supported yet
  648. ***** ^ not supported yet
  649. ***** ^ not supported yet
  650. 278 WriteEol(Handle,"');");
  651. ***** ^ not supported yet
  652. ***** ^ not supported yet
  653. 279 END;
  654. 280 WriteStr(Handle," InitDBF('");
  655. ***** ^ not supported yet
  656. ***** ^ not supported yet
  657. 281 WriteStr(Handle,TableName);
  658. ***** ^ not supported yet
  659. ***** ^ not supported yet
  660. 282 WriteStr(Handle,".DBF',");
  661. ***** ^ not supported yet
  662. ***** ^ not supported yet
  663. 283 WriteStr(Handle,TableName);
  664. ***** ^ not supported yet
  665. ***** ^ not supported yet
  666. 284 WriteEol(Handle,"DBF,0,FALSE,TRUE,FALSE,DefaultFixUp);");
  667. ***** ^ not supported yet
  668. ***** ^ not supported yet
  669. 285 WriteEol(Handle," (* It would be a good to test error.*)");
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. 286 WriteStr(Handle," Error:=BuildDBF(");
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. 287 WriteStr(Handle,"Desc^,");
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. 288 WriteStr(Handle,Str);
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. 289 WriteStr(Handle,',');
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. 290 WriteStr(Handle,TableName);
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. 291 WriteEol(Handle,'DBF);');
  688. ***** ^ not supported yet
  689. ***** ^ not supported yet
  690. 292 WriteStr(Handle,' CloseDBF(');
  691. ***** ^ not supported yet
  692. ***** ^ not supported yet
  693. 293 WriteStr(Handle,TableName);
  694. ***** ^ not supported yet
  695. ***** ^ not supported yet
  696. 294 WriteEol(Handle,'DBF);');
  697. ***** ^ not supported yet
  698. ***** ^ not supported yet
  699. 295 WriteStr(Handle,' DEALLOCATE(Desc,');
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 296 WriteStr(Handle,Str);
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. 297 WriteEol(Handle,' * SIZE(DBFieldDescriptor));');
  706. ***** ^ not supported yet
  707. ***** ^ not supported yet
  708. 298 WriteEol(Handle,'END MakeDatabase;');
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. 299 END MakeDatabase;
  712. ***** ^ not supported yet
  713. 300
  714. 301
  715. 302 PROCEDURE ReplaceName(SrchStr, ReplStr : ARRAY OF CHAR; VAR TheList : GenList);
  716. ***** ^ not supported yet
  717. 303 (* loop through the file and replace the strings *)
  718. 304 VAR
  719. 305 J : CARDINAL;
  720. 306 Str : ARRAY[0..300] OF CHAR;
  721. ***** ^ not supported yet
  722. ***** ^ not supported yet
  723. 307 Size,Code : CARDINAL;
  724. 308 BEGIN
  725. 309 FOR J := 1 TO ListLength(TheList) DO
  726. ***** ^ not supported yet
  727. ***** ^ not supported yet
  728. 310 GetElmt(TheList,J,Str,Code);
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. ***** ^ not supported yet
  732. ***** ^ not supported yet
  733. 311 ReplaceStr(SrchStr,ReplStr,Str);
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. ***** ^ not supported yet
  737. ***** ^ not supported yet
  738. 312 ListReplace(Str,StrCode,TheList,J);
  739. ***** ^ not supported yet
  740. ***** ^ not supported yet
  741. ***** ^ not supported yet
  742. ***** ^ not supported yet
  743. ***** ^ not supported yet
  744. 313 END;
  745. 314 END ReplaceName;
  746. ***** ^ not supported yet
  747. 315
  748. 316 PROCEDURE OKCondition(VAR Str:ARRAY OF CHAR ) : BOOLEAN;
  749. ***** ^ not supported yet
  750. 317
  751. 318 (* this routine will return true if the line should be included
  752. 319 otherwise it will return false - don't include the line
  753. 320 no -duh *)
  754. 321 VAR
  755. 322 IndexType : CHAR;
  756. 323 BEGIN
  757. 324
  758. 325 IF NOT (Present(IfIdx,Str) OR Present(EndIfIdx,Str))
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. ***** ^ not supported yet
  762. ***** ^ not supported yet
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. 326 (* check if this is a conditional stm*)
  766. 327 THEN RETURN Condition (* Nope - return current state *)
  767. 328 ELSIF Present(EndIfIdx,Str) (* check for end of condition *)
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. 329 THEN
  772. 330 Copy(Str , '');
  773. ***** ^ not supported yet
  774. ***** ^ not supported yet
  775. ***** ^ not supported yet
  776. 331 Condition := TRUE;
  777. 332 RETURN TRUE;
  778. 333 END; (* if we fell through this must be the
  779. 334 begining of a conditional statement*)
  780. 335 (* the value must be R - Real *)
  781. 336 (* N - Numeric Cardinal*)
  782. 337 (* C - Character *)
  783. 338
  784. 339 DeleteRightJustified ( Str, 0, Pos('=',Str)+1); (* get rid of the prefix *)
  785. ***** ^ not supported yet
  786. ***** ^ not supported yet
  787. ***** ^ not supported yet
  788. ***** ^ not supported yet
  789. ***** ^ not supported yet
  790. 340 DeleteChar(' ',Str); (* whats left should be index type*)
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. 341 IF Str[0] = ProcessIdxType
  794. ***** ^ not supported yet
  795. ***** ^ not supported yet
  796. 342 THEN Condition := TRUE
  797. 343 ELSE Condition := FALSE;
  798. 344 END;
  799. 345 Copy(Str , '');
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. 346 RETURN Condition;
  804. 347
  805. 348 END OKCondition;
  806. ***** ^ not supported yet
  807. 349
  808. 350
  809. 351
  810. 352 PROCEDURE ProcessRepeat(VAR TheList : GenList; VAR Spot : CARDINAL;
  811. 353 StartMark,EndMark: ARRAY OF CHAR); FORWARD;
  812. ***** ^ not supported yet
  813. 354
  814. 355 PROCEDURE WriteList(VAR TheList : GenList);
  815. 356 (* Write the list to the file *)
  816. 357 (* Write until a ">>for each idx<<or >>for each fld<<" is encountered*)
  817. 358 (* Extract the items that are for idx or flds; create a sublist and *)
  818. 359 (* call writelist (recursivly) *)
  819. 360
  820. 361 VAR
  821. 362 J : CARDINAL;
  822. 363 S : ARRAY[0..200] OF CHAR;
  823. ***** ^ not supported yet
  824. ***** ^ not supported yet
  825. 364 Code,Size : CARDINAL;
  826. 365 BEGIN
  827. 366 J := 1;
  828. 367 LOOP
  829. 368 IF J > ListLength(TheList) THEN
  830. ***** ^ not supported yet
  831. ***** ^ not supported yet
  832. 369 EXIT; (* I alter the J variable in a subroutine *)
  833. 370 END; (* so use a loop construct rather than for *)
  834. 371 GetElmt(TheList,J,S,Code);
  835. ***** ^ not supported yet
  836. ***** ^ not supported yet
  837. ***** ^ not supported yet
  838. ***** ^ not supported yet
  839. 372 IF OKCondition(S) (* not in a conditional gen area*)
  840. ***** ^ not supported yet
  841. ***** ^ not supported yet
  842. 373 THEN
  843. 374 IF Present(ForEachIdx,S)
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ not supported yet
  847. 375 THEN ProcessRepeat(TheList,J,ForEachIdx,EndEachIdx)
  848. ***** ^ not supported yet
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. 376 ELSIF Present(ForEachFld,S)
  853. ***** ^ not supported yet
  854. ***** ^ not supported yet
  855. ***** ^ not supported yet
  856. 377 THEN ProcessRepeat(TheList,J,ForEachIdx,EndEachIdx);
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. ***** ^ not supported yet
  860. ***** ^ not supported yet
  861. 378 ELSIF Present(MakeRec,S)
  862. ***** ^ not supported yet
  863. ***** ^ not supported yet
  864. ***** ^ not supported yet
  865. 379 THEN MakeModRec(FldList);
  866. ***** ^ not supported yet
  867. ***** ^ not supported yet
  868. 380 INC(J);
  869. ***** ^ undeclared identifier
  870. ***** ^ not supported yet
  871. 381 ELSIF Present(MoveTo,S)
  872. ***** ^ not supported yet
  873. ***** ^ not supported yet
  874. ***** ^ not supported yet
  875. 382 THEN MakeMoveTo(FldList);
  876. ***** ^ not supported yet
  877. ***** ^ not supported yet
  878. 383 INC(J);
  879. ***** ^ undeclared identifier
  880. ***** ^ not supported yet
  881. 384 ELSIF Present(MoveFrom,S)
  882. ***** ^ not supported yet
  883. ***** ^ not supported yet
  884. ***** ^ not supported yet
  885. 385 THEN MakeMoveFrom(FldList);
  886. ***** ^ not supported yet
  887. ***** ^ not supported yet
  888. 386 INC(J);
  889. ***** ^ undeclared identifier
  890. ***** ^ not supported yet
  891. 387 ELSIF Present(MakeDBF,S)
  892. ***** ^ not supported yet
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. 388 THEN MakeDatabase(FldList);
  896. ***** ^ not supported yet
  897. ***** ^ not supported yet
  898. 389 INC(J);
  899. ***** ^ undeclared identifier
  900. ***** ^ not supported yet
  901. 390
  902. 391 ELSE
  903. 392 WriteEol(Handle,S);
  904. ***** ^ not supported yet
  905. ***** ^ not supported yet
  906. 393 INC(J);
  907. ***** ^ undeclared identifier
  908. ***** ^ not supported yet
  909. 394 END;
  910. 395 ELSE INC(J); (* else if in condition *)
  911. ***** ^ undeclared identifier
  912. ***** ^ not supported yet
  913. 396 END; (* end of if in condition *)
  914. 397 END; (* end of LOOP *)
  915. 398 END WriteList;
  916. ***** ^ not supported yet
  917. 399
  918. 400 PROCEDURE ProcessRepeat(VAR TheList : GenList; VAR Spot : CARDINAL;
  919. 401 StartMark,EndMark: ARRAY OF CHAR);
  920. ***** ^ not supported yet
  921. 402 (* write out the line containing the for each field *)
  922. 403 (* Make a sublist for the for each fld *)
  923. 404 (* make a copy of the sublist *)
  924. 405 (* for each fld replace the idx stuff *)
  925. 406 (* writelist(the sublist) *)
  926. 407
  927. 408 VAR
  928. 409 S: ARRAY [0..200] OF CHAR;
  929. ***** ^ not supported yet
  930. ***** ^ not supported yet
  931. 410 Size,Code : CARDINAL;
  932. 411 TmpStr : ARRAY[0..200] OF CHAR;
  933. ***** ^ not supported yet
  934. ***** ^ not supported yet
  935. 412 SubList, TmpList : GenList;
  936. 413 J : CARDINAL;
  937. 414 IdxRec : POINTER TO IndexElmtRec;
  938. ***** ^ not supported yet
  939. 415
  940. 416 BEGIN
  941. 417 GetElmt(TheList,Spot,S,Code);
  942. ***** ^ not supported yet
  943. ***** ^ not supported yet
  944. ***** ^ not supported yet
  945. ***** ^ not supported yet
  946. 418 Copy(TmpStr , S); (* for the first line *)
  947. ***** ^ not supported yet
  948. ***** ^ not supported yet
  949. ***** ^ not supported yet
  950. 419 J := Pos(StartMark,TmpStr)+Length(StartMark);
  951. ***** ^ not supported yet
  952. ***** ^ not supported yet
  953. ***** ^ not supported yet
  954. ***** ^ not supported yet
  955. ***** ^ not supported yet
  956. 420 SetLength(TmpStr,Pos(StartMark,TmpStr));
  957. ***** ^ not supported yet
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. ***** ^ not supported yet
  961. ***** ^ not supported yet
  962. 421 WriteStr(Handle,TmpStr); (* write out the remainder of the currentline*)
  963. ***** ^ not supported yet
  964. ***** ^ not supported yet
  965. 422 Delete(S,0,J); (* dump the front of str + the start mark *)
  966. ***** ^ not supported yet
  967. ***** ^ not supported yet
  968. ***** ^ not supported yet
  969. 423 NewList(SubList);
  970. ***** ^ not supported yet
  971. ***** ^ not supported yet
  972. 424 LOOP (* create a sublist for the repeat field *)
  973. 425 INC(Spot);
  974. ***** ^ undeclared identifier
  975. ***** ^ not supported yet
  976. 426 IF Present(EndMark,S)
  977. ***** ^ not supported yet
  978. ***** ^ not supported yet
  979. ***** ^ not supported yet
  980. 427 THEN EXIT; (* last line processing *)
  981. 428 END;
  982. 429 ListInsert(S,StrCode,SubList,1000); (* insert a replace line *)
  983. ***** ^ not supported yet
  984. ***** ^ not supported yet
  985. ***** ^ not supported yet
  986. ***** ^ not supported yet
  987. ***** ^ not supported yet
  988. 430
  989. 431 IF Spot > ListLength(TheList)
  990. ***** ^ not supported yet
  991. ***** ^ not supported yet
  992. 432 THEN EXIT;
  993. 433 END;
  994. 434 GetElmt(TheList,Spot,S,Code);
  995. ***** ^ not supported yet
  996. ***** ^ not supported yet
  997. ***** ^ not supported yet
  998. ***** ^ not supported yet
  999. 435 END;
  1000. 436 Copy(TmpStr , S);
  1001. ***** ^ not supported yet
  1002. ***** ^ not supported yet
  1003. ***** ^ not supported yet
  1004. 437 (********************************************)
  1005. 438 (* last line processing *)
  1006. 439 (* if I need to have embedded loops put the *)
  1007. 440 (* search for start of loop here and call *)
  1008. 441 (* process repeating recursive call *)
  1009. 442 (********************************************)
  1010. 443
  1011. 444 IF Present(EndMark,TmpStr)
  1012. ***** ^ not supported yet
  1013. ***** ^ not supported yet
  1014. ***** ^ not supported yet
  1015. 445 THEN
  1016. 446 SetLength(TmpStr,Pos(EndMark,TmpStr));
  1017. ***** ^ not supported yet
  1018. ***** ^ not supported yet
  1019. ***** ^ not supported yet
  1020. ***** ^ not supported yet
  1021. ***** ^ not supported yet
  1022. 447 J := Pos(EndMark,S)+Length(EndMark);
  1023. ***** ^ not supported yet
  1024. ***** ^ not supported yet
  1025. ***** ^ not supported yet
  1026. ***** ^ not supported yet
  1027. ***** ^ not supported yet
  1028. 448 Delete(S,0,J); (* dump the front of str + the start mark *)
  1029. ***** ^ not supported yet
  1030. ***** ^ not supported yet
  1031. ***** ^ not supported yet
  1032. 449 END;
  1033. 450 (* DEC(Spot);
  1034. 451 ListReplace(S,StrCode,TheList,Spot); Replace with write at end*)
  1035. 452 IF Length(TmpStr) > 0
  1036. ***** ^ not supported yet
  1037. ***** ^ not supported yet
  1038. 453 THEN
  1039. 454 ListInsert(TmpStr,StrCode,SubList,1000);
  1040. ***** ^ not supported yet
  1041. ***** ^ not supported yet
  1042. ***** ^ not supported yet
  1043. ***** ^ not supported yet
  1044. ***** ^ not supported yet
  1045. 455 END;
  1046. 456
  1047. 457
  1048. 458 (* now for each index or fld copy the list, replace the idx or fld
  1049. 459 and write list - NOTICE THIS IS A RECURSIVE CALL to witelist *)
  1050. 460
  1051. 461 FOR J := 1 TO ListLength(IdxList) DO
  1052. ***** ^ not supported yet
  1053. ***** ^ not supported yet
  1054. 462 GetElmtAdr(IdxList,J,IdxRec,Size,Code);
  1055. ***** ^ not supported yet
  1056. ***** ^ not supported yet
  1057. ***** ^ not supported yet
  1058. ***** ^ not supported yet
  1059. 463 ProcessIdxType := IdxRec^.IndexType; (* set for conditional gen*)
  1060. ***** ^ not supported yet
  1061. ***** ^ not supported yet
  1062. 464 NewList(TmpList);
  1063. ***** ^ not supported yet
  1064. ***** ^ not supported yet
  1065. 465 CopyList(SubList,TmpList);
  1066. ***** ^ not supported yet
  1067. ***** ^ not supported yet
  1068. ***** ^ not supported yet
  1069. 466 ReplaceName(IdxFldNm,IdxRec^.FldName,TmpList);
  1070. ***** ^ not supported yet
  1071. ***** ^ not supported yet
  1072. ***** ^ not supported yet
  1073. ***** ^ not supported yet
  1074. ***** ^ not supported yet
  1075. 467 ReplaceName(FldName,IdxRec^.FldName,TmpList);
  1076. ***** ^ not supported yet
  1077. ***** ^ not supported yet
  1078. ***** ^ not supported yet
  1079. ***** ^ not supported yet
  1080. ***** ^ not supported yet
  1081. 468 ReplaceName(IdxName,IdxRec^.IdxName,TmpList);
  1082. ***** ^ not supported yet
  1083. ***** ^ not supported yet
  1084. ***** ^ not supported yet
  1085. ***** ^ not supported yet
  1086. ***** ^ not supported yet
  1087. 469 ReplaceName(IdxChar,IdxRec^.HighLight,TmpList);
  1088. ***** ^ not supported yet
  1089. ***** ^ not supported yet
  1090. ***** ^ not supported yet
  1091. ***** ^ not supported yet
  1092. ***** ^ not supported yet
  1093. 470 WriteList(TmpList);
  1094. ***** ^ not supported yet
  1095. ***** ^ not supported yet
  1096. 471 DisposeList(TmpList);
  1097. ***** ^ not supported yet
  1098. ***** ^ not supported yet
  1099. 472 WriteStr(Handle,S); (* fininsh the last line *)
  1100. ***** ^ not supported yet
  1101. ***** ^ not supported yet
  1102. 473 END;
  1103. 474 DisposeList(SubList);
  1104. ***** ^ not supported yet
  1105. ***** ^ not supported yet
  1106. 475 END ProcessRepeat;
  1107. ***** ^ not supported yet
  1108. 476
  1109. 477
  1110. 478
  1111. 479
  1112. 480
  1113. 481
  1114. 482
  1115. 483
  1116. 484
  1117. 485
  1118. 486
  1119. 487
  1120. 488 PROCEDURE GenFile(TemplateName : ARRAY OF CHAR);
  1121. ***** ^ not supported yet
  1122. 489 VAR
  1123. 490 FileName : ARRAY[0..80] OF CHAR;
  1124. ***** ^ not supported yet
  1125. ***** ^ not supported yet
  1126. 491 TmpStr : ARRAY [0..80] OF CHAR;
  1127. ***** ^ not supported yet
  1128. ***** ^ not supported yet
  1129. 492 ExtPart : ARRAY[0..3] OF CHAR;
  1130. ***** ^ not supported yet
  1131. ***** ^ not supported yet
  1132. 493 EM : ErrorMessage;
  1133. 494 FileList : GenList;
  1134. 495 Code : CARDINAL;
  1135. 496 BEGIN
  1136. 497 NewList(FileList);
  1137. ***** ^ not supported yet
  1138. ***** ^ not supported yet
  1139. 498 Condition := TRUE; (* ititialize the conditional generation stuff*)
  1140. 499 ChangingState := FALSE;
  1141. 500 EM := TextFileToList(TemplateName,FileList);
  1142. ***** ^ not supported yet
  1143. ***** ^ not supported yet
  1144. ***** ^ not supported yet
  1145. ***** ^ not supported yet
  1146. 501 ReplaceName(TableNm,TableName,FileList);
  1147. ***** ^ not supported yet
  1148. ***** ^ not supported yet
  1149. ***** ^ not supported yet
  1150. ***** ^ not supported yet
  1151. 502
  1152. 503 (* If the file name is in the template, create a new file *)
  1153. 504 GetElmt(FileList,1,FileName,Code);
  1154. ***** ^ not supported yet
  1155. ***** ^ not supported yet
  1156. ***** ^ not supported yet
  1157. ***** ^ not supported yet
  1158. 505 IF Present(OutFileName,FileName)
  1159. ***** ^ not supported yet
  1160. ***** ^ not supported yet
  1161. ***** ^ not supported yet
  1162. 506 THEN
  1163. 507 TmpStr := OutFileName;
  1164. ***** ^ not supported yet
  1165. ***** ^ not supported yet
  1166. 508 Code := Length(TmpStr);
  1167. ***** ^ not supported yet
  1168. ***** ^ not supported yet
  1169. 509 Delete(FileName,Pos(OutFileName,FileName),Code); (* dump the front of line*)
  1170. ***** ^ not supported yet
  1171. ***** ^ not supported yet
  1172. ***** ^ not supported yet
  1173. ***** ^ not supported yet
  1174. ***** ^ not supported yet
  1175. ***** ^ not supported yet
  1176. 510 DeleteChar(' ',FileName); (* get rid of any excess blanks *)
  1177. ***** ^ not supported yet
  1178. ***** ^ not supported yet
  1179. 511 IF Pos('.',FileName)> 8 (* if name to long 8 + period *)
  1180. ***** ^ not supported yet
  1181. ***** ^ not supported yet
  1182. 512 THEN
  1183. 513
  1184. 514 Slice(ExtPart,FileName,Pos('.',FileName)+1,3);
  1185. ***** ^ not supported yet
  1186. ***** ^ not supported yet
  1187. ***** ^ not supported yet
  1188. ***** ^ not supported yet
  1189. ***** ^ not supported yet
  1190. ***** ^ not supported yet
  1191. 515 SetLength(FileName,8); (* set to max length *)
  1192. ***** ^ not supported yet
  1193. ***** ^ not supported yet
  1194. ***** ^ not supported yet
  1195. 516 Append(FileName,'.');
  1196. ***** ^ not supported yet
  1197. ***** ^ not supported yet
  1198. ***** ^ not supported yet
  1199. 517 Append(FileName,ExtPart);
  1200. ***** ^ not supported yet
  1201. ***** ^ not supported yet
  1202. ***** ^ not supported yet
  1203. 518 END;
  1204. 519 EM := CreateFile(Handle,FileName);
  1205. ***** ^ not supported yet
  1206. ***** ^ not supported yet
  1207. ***** ^ not supported yet
  1208. 520 ListDelete(FileList,1,1); (* delete file name *)
  1209. ***** ^ not supported yet
  1210. ***** ^ not supported yet
  1211. ***** ^ not supported yet
  1212. 521 END; (* if file is named *)
  1213. 522 WriteList(FileList);
  1214. ***** ^ not supported yet
  1215. ***** ^ not supported yet
  1216. 523
  1217. 524 END GenFile;
  1218. ***** ^ not supported yet
  1219. 525
  1220. 526 END Gen.
  1221. ***** ^ not supported yet
  1222. 694 errors