LISTUTIL.LST 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161
  1. Listing:
  2. 1 IMPLEMENTATION MODULE ListUtils;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1992 PMI
  8. 7 * Green Bay, Wisconsin
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 * $Header: D:/logfiles/mods/listutil.mov 1.6 10 Mar 1991 15:35:08 coleb $
  13. 12 *
  14. 13 *
  15. 14 * For GenList manipulation routines that don't need access to
  16. 15 * the internal structure of a GenList.
  17. 16 *)
  18. 17
  19. 18
  20. 19 IMPORT ByteFiddler;
  21. 20 IMPORT EnvironUtils;
  22. 21 IMPORT ErrorManager;
  23. 22 IMPORT HandleIO;
  24. 23 IMPORT GenLists;
  25. 24 IMPORT LowLevel;
  26. 25 IMPORT M2Strings;
  27. 26 IMPORT Numbers;
  28. 27 IMPORT NumTypes;
  29. 28 IMPORT PosUtils;
  30. 29 IMPORT StrConv;
  31. 30 IMPORT StrEdit;
  32. 31 IMPORT StringIO;
  33. 32 IMPORT SYSTEM;
  34. 33 IMPORT VStorage;
  35. 34
  36. 35 VAR
  37. 36 Initialized : BOOLEAN;
  38. 37
  39. 38 PROCEDURE Init();
  40. 39 BEGIN
  41. 40 IF Initialized THEN
  42. 41 RETURN;
  43. 42 ELSE
  44. 43 Initialized := TRUE;
  45. 44 END;
  46. 45 ByteFiddler.Init();
  47. ***** ^ not supported yet
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. 46 EnvironUtils.Init();
  51. ***** ^ not supported yet
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. 47 ErrorManager.Init();
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. ***** ^ not supported yet
  58. 48 HandleIO.Init();
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. 49 GenLists.Init();
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. 50 LowLevel.Init();
  67. ***** ^ not supported yet
  68. ***** ^ not supported yet
  69. ***** ^ not supported yet
  70. 51 M2Strings.Init();
  71. ***** ^ not supported yet
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. 52 Numbers.Init();
  75. ***** ^ not supported yet
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. 53 NumTypes.Init();
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. 54 PosUtils.Init();
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. 55 StrConv.Init();
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. ***** ^ not supported yet
  90. 56 StrEdit.Init();
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. ***** ^ not supported yet
  94. 57 StringIO.Init();
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. 58 VStorage.Init();
  99. ***** ^ not supported yet
  100. ***** ^ not supported yet
  101. ***** ^ not supported yet
  102. 59 END Init;
  103. ***** ^ not supported yet
  104. 60
  105. 61
  106. 62 PROCEDURE InitResponse(msg : ARRAY OF CHAR);
  107. ***** ^ not supported yet
  108. 63 (*All calls to InitResponse are diagnostic. Remove them from
  109. 64 finished programs.*)
  110. 65 VAR
  111. 66 TmpStr : ARRAY [0..79] OF CHAR;
  112. ***** ^ not supported yet
  113. ***** ^ not supported yet
  114. 67 BEGIN
  115. 68 StrEdit.AssignStr('Uninit. list passed to ', TmpStr);
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. ***** ^ not supported yet
  119. ***** ^ not supported yet
  120. 69 StrEdit.Append(TmpStr, msg);
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. ***** ^ not supported yet
  124. ***** ^ not supported yet
  125. 70 ErrorManager.WARN(TmpStr);
  126. ***** ^ not supported yet
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. 71 END InitResponse;
  130. ***** ^ not supported yet
  131. 72
  132. 73
  133. 74 (*$O-*)
  134. 75 PROCEDURE CharCount( TheList : GenLists.GenList;
  135. ***** ^ not supported yet
  136. 76 StartLine, EndLine: CARDINAL ): LONGINT;
  137. 77 VAR
  138. 78 tmp1, tmp2: LONGINT;
  139. 79 lngth, cnt: CARDINAL;
  140. 80 BEGIN
  141. 81 tmp2 := NumTypes.L0;
  142. ***** ^ not supported yet
  143. ***** ^ not supported yet
  144. 82 lngth := GenLists.ListLength( TheList );
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. ***** ^ not supported yet
  148. 83 IF EndLine > lngth THEN
  149. 84 EndLine := lngth;
  150. 85 END;
  151. 86 FOR cnt := StartLine TO EndLine DO
  152. 87 tmp1 := Numbers.Lc( ElmtSize(TheList, cnt) );
  153. ***** ^ not supported yet
  154. ***** ^ not supported yet
  155. ***** ^ undeclared identifier
  156. ***** ^ not supported yet
  157. ***** ^ not supported yet
  158. 88 (*Workaround for Logitech LONGINT bug.*)
  159. 89 tmp2 := tmp2 + tmp1;
  160. 90 END;
  161. 91 RETURN tmp2;
  162. 92 END CharCount;
  163. ***** ^ not supported yet
  164. 93 (*$O=*)
  165. 94
  166. 95
  167. 96 PROCEDURE CheckLength(VAR TheList : GenLists.GenList;
  168. ***** ^ not supported yet
  169. 97 LeftMargin, LngthLimit : CARDINAL);
  170. 98 VAR
  171. 99 delimiters : ARRAY [0..15] OF CHAR;
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. 100 tmpsize, cnt, DumType, BreakSpot : CARDINAL;
  175. 101 tmpadr: SYSTEM.ADDRESS;
  176. ***** ^ not supported yet
  177. 102 BEGIN
  178. 103 delimiters := ' -,)]?+';
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. 104 cnt := 1;
  182. 105 WHILE cnt <= GenLists.ListLength( TheList) DO
  183. ***** ^ not supported yet
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. 106 tmpsize := ElmtSize( TheList, cnt );
  187. ***** ^ undeclared identifier
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. 107 (* we assign this out here to make it easier to see in
  191. 108 the RTD *)
  192. 109 IF tmpsize > LngthLimit THEN
  193. 110 GenLists.GetElmtAdr( TheList, cnt, tmpadr, tmpsize, DumType );
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 111 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. 112 (*reduce size to real string length*)
  204. 113 BreakSpot := PosUtils.BreakPtAdr( tmpadr, tmpsize, LngthLimit,
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. 114 delimiters) + 1;
  209. ***** ^ not supported yet
  210. 115 GenLists.ListInsertAdr( LowLevel.AddAddr(tmpadr,
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. ***** ^ not supported yet
  215. ***** ^ not supported yet
  216. 116 BreakSpot), (tmpsize -BreakSpot) + LeftMargin + 1,
  217. ***** ^ not supported yet
  218. 117 0, TheList, cnt + 1 );
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. 118 (* We can't use StrCode as the type in this
  222. 119 ListInsertAdr because we need to reserve room in
  223. 120 the list element beyond the null. *)
  224. 121 GenLists.ChangeTypeCode( TheList, cnt + 1, GenLists.StrCode );
  225. ***** ^ not supported yet
  226. ***** ^ not supported yet
  227. ***** ^ not supported yet
  228. ***** ^ not supported yet
  229. ***** ^ not supported yet
  230. 122 LowLevel.Fill( LowLevel.AddAddr(tmpadr, BreakSpot), 1, 0C );
  231. ***** ^ not supported yet
  232. ***** ^ not supported yet
  233. ***** ^ not supported yet
  234. ***** ^ not supported yet
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. 123 (*Make sure there's a null terminator at end of old
  239. 124 string.*)
  240. 125 IF LeftMargin > 0 THEN
  241. 126 GenLists.GetElmtAdr( TheList, cnt + 1, tmpadr, tmpsize, DumType );
  242. ***** ^ not supported yet
  243. ***** ^ not supported yet
  244. ***** ^ not supported yet
  245. ***** ^ not supported yet
  246. ***** ^ not supported yet
  247. 127 LowLevel.ShiftArrayRight( tmpadr, tmpsize, LeftMargin );
  248. ***** ^ not supported yet
  249. ***** ^ not supported yet
  250. ***** ^ not supported yet
  251. ***** ^ not supported yet
  252. 128 LowLevel.Fill( tmpadr, LeftMargin, ' ' );
  253. ***** ^ not supported yet
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. ***** ^ not supported yet
  257. 129 END;
  258. 130 END;
  259. 131 INC( cnt );
  260. ***** ^ undeclared identifier
  261. ***** ^ not supported yet
  262. 132 END;
  263. 133 END CheckLength;
  264. ***** ^ not supported yet
  265. 134
  266. 135
  267. 136 PROCEDURE IndentationAt( TheList : GenLists.GenList;
  268. ***** ^ not supported yet
  269. 137 Line : CARDINAL ): CARDINAL;
  270. 138 VAR
  271. 139 tmpsize, indent, DumType: CARDINAL;
  272. 140 tmpadr: SYSTEM.ADDRESS;
  273. ***** ^ not supported yet
  274. 141 BEGIN
  275. 142 GenLists.GetElmtAdr( TheList, Line, tmpadr, tmpsize, DumType );
  276. ***** ^ not supported yet
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. 143 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
  282. ***** ^ not supported yet
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. 144 IF tmpsize = 0 THEN
  286. 145 RETURN 65535;
  287. 146 END;
  288. 147 indent := LowLevel.ScanNE(tmpsize, ' ', tmpadr);
  289. ***** ^ not supported yet
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. 148 RETURN indent;
  293. 149 END IndentationAt;
  294. ***** ^ not supported yet
  295. 150
  296. 151
  297. 152 PROCEDURE ReformPara( VAR TheList : GenLists.GenList;
  298. ***** ^ not supported yet
  299. 153 LeftMargin, RightMargin : CARDINAL; VAR
  300. 154 StartLine, CursorLine, CursorCol: CARDINAL;
  301. 155 VAR LinesAdded, BytesAdded: INTEGER; VAR
  302. 156 CursorBytePos: LONGINT );
  303. 157
  304. 158 VAR
  305. 159 blank : ARRAY [0..0] OF CHAR;
  306. ***** ^ not supported yet
  307. ***** ^ not supported yet
  308. 160 delimiters : ARRAY [0..15] OF CHAR;
  309. ***** ^ not supported yet
  310. ***** ^ not supported yet
  311. 161 tmpsize, cnt, indent, DumType, BreakSpot : CARDINAL;
  312. 162 tmpadr: SYSTEM.ADDRESS;
  313. ***** ^ not supported yet
  314. 163 done : BOOLEAN;
  315. 164 BEGIN
  316. 165 blank[0] := ' ';
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. 166 delimiters := ' -,)]?+';
  320. ***** ^ not supported yet
  321. ***** ^ not supported yet
  322. 167 cnt := StartLine;
  323. 168 LinesAdded := 0;
  324. 169 BytesAdded := 0;
  325. 170 done := FALSE;
  326. 171 WHILE (NOT done) AND (cnt <= GenLists.ListLength( TheList)) DO
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. 172 IF cnt = GenLists.ListLength( TheList ) THEN
  331. ***** ^ not supported yet
  332. ***** ^ not supported yet
  333. ***** ^ not supported yet
  334. 173 StartLine := cnt;
  335. 174 done := TRUE;
  336. 175 ELSE
  337. 176 indent := IndentationAt( TheList, cnt + 1 );
  338. ***** ^ not supported yet
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. 177 END;
  342. 178 IF (NOT done) AND (indent = LeftMargin) THEN
  343. 179 (* We bring the next line up and append it to this one. Means the
  344. 180 reformat stops when we reach a line where indentation <>
  345. 181 LeftMargin. *)
  346. 182 GenLists.GetElmtAdr( TheList, cnt, tmpadr, tmpsize, DumType );
  347. ***** ^ not supported yet
  348. ***** ^ not supported yet
  349. ***** ^ not supported yet
  350. ***** ^ not supported yet
  351. ***** ^ not supported yet
  352. 183 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ not supported yet
  356. 184 (*reduce size to real string length*)
  357. 185 IF (tmpsize > 0) AND (ByteFiddler.PeekChar(
  358. ***** ^ not supported yet
  359. ***** ^ not supported yet
  360. 186 LowLevel.AddAddr( tmpadr, tmpsize - 1 )) # ' ') THEN
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. ***** ^ not supported yet
  364. ***** ^ not supported yet
  365. 187 (* If this line doesn't end with a blank. *)
  366. 188 InsertIntoElmt( TheList, cnt, SYSTEM.ADR(blank), 1, 65535 );
  367. ***** ^ undeclared identifier
  368. ***** ^ not supported yet
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. ***** ^ not supported yet
  373. 189 (*Append a blank to this line because we're not going to
  374. 190 insert leading blanks from the line below.*)
  375. 191 INC( BytesAdded );
  376. ***** ^ undeclared identifier
  377. ***** ^ not supported yet
  378. 192 END;
  379. 193 IF CursorLine > (cnt + 1) THEN
  380. 194 DEC( CursorLine );
  381. ***** ^ undeclared identifier
  382. ***** ^ not supported yet
  383. 195 ELSIF (CursorLine = (cnt + 1)) THEN
  384. 196 DEC( CursorLine );
  385. ***** ^ undeclared identifier
  386. ***** ^ not supported yet
  387. 197 CursorCol := CursorCol + ElmtSize(TheList, cnt);
  388. ***** ^ undeclared identifier
  389. ***** ^ not supported yet
  390. ***** ^ not supported yet
  391. 198 END;
  392. 199 GenLists.GetElmtAdr( TheList, cnt + 1, tmpadr, tmpsize, DumType );
  393. ***** ^ not supported yet
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. 200 InsertIntoElmt( TheList, cnt, LowLevel.AddAddr(tmpadr, indent),
  399. ***** ^ undeclared identifier
  400. ***** ^ not supported yet
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. ***** ^ not supported yet
  404. ***** ^ not supported yet
  405. 201 ElmtSize(TheList, cnt + 1) - indent, 65535 );
  406. ***** ^ undeclared identifier
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. ***** ^ not supported yet
  410. 202 BytesAdded := BytesAdded - INTEGER(indent) - 2;
  411. ***** ^ not supported yet
  412. 203 (* We've deleted leading spaces and separating CR/LF. *)
  413. 204 GenLists.ListDelete( TheList, cnt + 1, 1 );
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. 205 DEC( LinesAdded );
  419. ***** ^ undeclared identifier
  420. ***** ^ not supported yet
  421. 206 ELSE
  422. 207 done := TRUE;
  423. 208 END;
  424. 209
  425. 210 GenLists.GetElmtAdr( TheList, cnt, tmpadr, tmpsize, DumType );
  426. ***** ^ not supported yet
  427. ***** ^ not supported yet
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. 211 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
  432. ***** ^ not supported yet
  433. ***** ^ not supported yet
  434. ***** ^ not supported yet
  435. 212 (*reduce size to real string length*)
  436. 213 IF (tmpsize > RightMargin) THEN
  437. 214 done := FALSE;
  438. 215 BreakSpot := PosUtils.BreakPtAdr( tmpadr, tmpsize, RightMargin,
  439. ***** ^ not supported yet
  440. ***** ^ not supported yet
  441. ***** ^ not supported yet
  442. 216 delimiters) + 1;
  443. ***** ^ not supported yet
  444. 217 IF CursorLine > cnt THEN
  445. 218 INC( CursorLine );
  446. ***** ^ undeclared identifier
  447. ***** ^ not supported yet
  448. 219 ELSIF (CursorLine = cnt) AND (CursorCol >= BreakSpot) THEN
  449. 220 INC( CursorLine );
  450. ***** ^ undeclared identifier
  451. ***** ^ not supported yet
  452. 221 CursorCol := CursorCol - BreakSpot;
  453. 222 END;
  454. 223 GenLists.ListInsertAdr( LowLevel.AddAddr(tmpadr,
  455. ***** ^ not supported yet
  456. ***** ^ not supported yet
  457. ***** ^ not supported yet
  458. ***** ^ not supported yet
  459. ***** ^ not supported yet
  460. 224 BreakSpot), (tmpsize -BreakSpot) + LeftMargin + 1,
  461. ***** ^ not supported yet
  462. 225 0, TheList, cnt + 1 );
  463. ***** ^ not supported yet
  464. ***** ^ not supported yet
  465. 226 (* We can't use StrCode as the type in this
  466. 227 ListInsertAdr because we need to reserve room in
  467. 228 the list element beyond the null. *)
  468. 229 INC( LinesAdded );
  469. ***** ^ undeclared identifier
  470. ***** ^ not supported yet
  471. 230 GenLists.ChangeTypeCode( TheList, cnt + 1, GenLists.StrCode );
  472. ***** ^ not supported yet
  473. ***** ^ not supported yet
  474. ***** ^ not supported yet
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. 231 LowLevel.Fill( LowLevel.AddAddr(tmpadr, BreakSpot), 1, 0C );
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. ***** ^ not supported yet
  481. ***** ^ not supported yet
  482. ***** ^ not supported yet
  483. ***** ^ not supported yet
  484. ***** ^ not supported yet
  485. 232 (*Make sure there's a null terminator at end of old
  486. 233 string.*)
  487. 234 IF LeftMargin > 0 THEN
  488. 235 GenLists.GetElmtAdr( TheList, cnt + 1, tmpadr, tmpsize, DumType );
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. ***** ^ not supported yet
  494. 236 LowLevel.ShiftArrayRight( tmpadr, tmpsize, LeftMargin );
  495. ***** ^ not supported yet
  496. ***** ^ not supported yet
  497. ***** ^ not supported yet
  498. ***** ^ not supported yet
  499. 237 LowLevel.Fill( tmpadr, LeftMargin, ' ' );
  500. ***** ^ not supported yet
  501. ***** ^ not supported yet
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. 238 IF CursorLine = (cnt + 1) THEN
  505. 239 CursorCol := CursorCol + LeftMargin;
  506. 240 END;
  507. 241 BytesAdded := BytesAdded + INTEGER(LeftMargin) + 2 ;
  508. ***** ^ not supported yet
  509. 242 (* We've added leading spaces on new line plus CR/LF
  510. 243 on this one. *)
  511. 244 ELSE
  512. 245 BytesAdded := BytesAdded + 2;
  513. 246 (* We've added only the CR/LF. *)
  514. 247 END;
  515. 248 END;
  516. 249 INC( cnt );
  517. ***** ^ undeclared identifier
  518. ***** ^ not supported yet
  519. 250 END;
  520. 251 IF (CursorBytePos > NumTypes.L0) THEN
  521. ***** ^ not supported yet
  522. ***** ^ not supported yet
  523. 252 (* They want us to compute new byte position. *)
  524. 253 IF CursorLine > 1 THEN
  525. 254 CursorBytePos := CharCount( TheList, 1, CursorLine - 1 ) +
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. 255 Numbers.Lc( CursorCol );
  530. ***** ^ not supported yet
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. 256 ELSE
  534. 257 CursorBytePos := Numbers.Lc( CursorCol );
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. 258 END;
  539. 259 END;
  540. 260 StartLine := cnt;
  541. 261 END ReformPara;
  542. ***** ^ not supported yet
  543. 262
  544. 263
  545. 264 PROCEDURE DeTabList( VAR TheList: GenLists.GenList; VAR
  546. ***** ^ not supported yet
  547. 265 ListChanged: BOOLEAN );
  548. 266 VAR
  549. 267 TmpStr: ARRAY [0..255] OF CHAR;
  550. ***** ^ not supported yet
  551. ***** ^ not supported yet
  552. 268 ListEnd, StartingSpot, StrSpot: CARDINAL;
  553. 269 TabStr: ARRAY [0..0] OF CHAR;
  554. ***** ^ not supported yet
  555. ***** ^ not supported yet
  556. 270 BEGIN
  557. 271 TabStr[0] := 11C;
  558. ***** ^ not supported yet
  559. ***** ^ not supported yet
  560. 272 ListEnd := GenLists.ListLength( TheList );
  561. ***** ^ not supported yet
  562. ***** ^ not supported yet
  563. ***** ^ not supported yet
  564. 273 StartingSpot := 1;
  565. 274 ListChanged := FALSE;
  566. 275 WHILE (StartingSpot <= ListEnd) AND (StartingSpot # 0) DO
  567. 276 StartingSpot := GenLists.ScanList( TabStr, TheList, StartingSpot,
  568. ***** ^ not supported yet
  569. ***** ^ not supported yet
  570. ***** ^ not supported yet
  571. ***** ^ not supported yet
  572. 277 ListEnd, StrSpot );
  573. ***** ^ not supported yet
  574. 278 IF StartingSpot > 0 THEN
  575. 279 ListChanged := TRUE;
  576. 280 GetStr( TheList, StartingSpot, TmpStr );
  577. ***** ^ undeclared identifier
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. 281 StrEdit.CutTrailingChars( ' ', TmpStr );
  581. ***** ^ not supported yet
  582. ***** ^ not supported yet
  583. ***** ^ not supported yet
  584. 282 StrEdit.ReplaceTabs( TmpStr, 8 );
  585. ***** ^ not supported yet
  586. ***** ^ not supported yet
  587. ***** ^ not supported yet
  588. ***** ^ not supported yet
  589. 283 GenLists.ListReplace( TmpStr, GenLists.StrCode, TheList,
  590. ***** ^ not supported yet
  591. ***** ^ not supported yet
  592. ***** ^ not supported yet
  593. ***** ^ not supported yet
  594. ***** ^ not supported yet
  595. ***** ^ not supported yet
  596. 284 StartingSpot );
  597. ***** ^ not supported yet
  598. 285 END;
  599. 286 END;
  600. 287 END DeTabList;
  601. ***** ^ not supported yet
  602. 288
  603. 289
  604. 290 PROCEDURE EnTabList( VAR TheList: GenLists.GenList; LeadingOnly: BOOLEAN; VAR
  605. ***** ^ not supported yet
  606. 291 ListChanged: BOOLEAN );
  607. 292 VAR
  608. 293 TmpStr: ARRAY [0..255] OF CHAR;
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. 294 ListEnd, StartingSpot, StrSpot: CARDINAL;
  612. 295 BlankStr: ARRAY [0..8] OF CHAR;
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. 296 BEGIN
  616. 297 BlankStr := ' ';
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. 298 ListEnd := GenLists.ListLength( TheList );
  620. ***** ^ not supported yet
  621. ***** ^ not supported yet
  622. ***** ^ not supported yet
  623. 299 StartingSpot := 1;
  624. 300 ListChanged := FALSE;
  625. 301 WHILE (StartingSpot <= ListEnd) AND (StartingSpot # 0) DO
  626. 302 StartingSpot := GenLists.ScanList( BlankStr, TheList, StartingSpot,
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. ***** ^ not supported yet
  630. ***** ^ not supported yet
  631. 303 ListEnd, StrSpot );
  632. ***** ^ not supported yet
  633. 304 IF StartingSpot > 0 THEN
  634. 305 ListChanged := TRUE;
  635. 306 GetStr( TheList, StartingSpot, TmpStr );
  636. ***** ^ undeclared identifier
  637. ***** ^ not supported yet
  638. ***** ^ not supported yet
  639. 307 StrEdit.CutTrailingChars( ' ', TmpStr );
  640. ***** ^ not supported yet
  641. ***** ^ not supported yet
  642. ***** ^ not supported yet
  643. 308 StrEdit.InsertTabs( TmpStr, 8, LeadingOnly );
  644. ***** ^ not supported yet
  645. ***** ^ not supported yet
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. 309 GenLists.ListReplace( TmpStr, GenLists.StrCode, TheList,
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. ***** ^ not supported yet
  652. ***** ^ not supported yet
  653. ***** ^ not supported yet
  654. ***** ^ not supported yet
  655. 310 StartingSpot );
  656. ***** ^ not supported yet
  657. 311 END;
  658. 312 END;
  659. 313 END EnTabList;
  660. ***** ^ not supported yet
  661. 314
  662. 315
  663. 316 PROCEDURE ElmtSize( TheList: GenLists.GenList; spot: CARDINAL ): CARDINAL;
  664. ***** ^ not supported yet
  665. 317 VAR
  666. 318 TheAddr: SYSTEM.ADDRESS;
  667. ***** ^ not supported yet
  668. 319 TheSize, TypeCode: CARDINAL;
  669. 320 BEGIN
  670. 321 GenLists.GetElmtAdr( TheList, spot, TheAddr, TheSize, TypeCode );
  671. ***** ^ not supported yet
  672. ***** ^ not supported yet
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. ***** ^ not supported yet
  676. 322 IF TypeCode = GenLists.StrCode THEN
  677. ***** ^ not supported yet
  678. ***** ^ not supported yet
  679. 323 TheSize := LowLevel.ScanEQ( TheSize, 0C, TheAddr );
  680. ***** ^ not supported yet
  681. ***** ^ not supported yet
  682. ***** ^ not supported yet
  683. 324 END;
  684. 325 RETURN TheSize;
  685. 326 END ElmtSize;
  686. ***** ^ not supported yet
  687. 327
  688. 328
  689. 329 PROCEDURE GetStr( TheList: GenLists.GenList; spot: CARDINAL; VAR
  690. ***** ^ not supported yet
  691. 330 TheStr: ARRAY OF CHAR );
  692. ***** ^ not supported yet
  693. 331 VAR
  694. 332 TypeCode: CARDINAL;
  695. 333 BEGIN
  696. 334 GenLists.GetElmt( TheList, spot, TheStr, TypeCode );
  697. ***** ^ not supported yet
  698. ***** ^ not supported yet
  699. ***** ^ not supported yet
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 335 IF TypeCode # GenLists.StrCode THEN
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. 336 ErrorManager.WARN('Not a string');
  706. ***** ^ not supported yet
  707. ***** ^ not supported yet
  708. ***** ^ not supported yet
  709. 337 END;
  710. 338 END GetStr;
  711. ***** ^ not supported yet
  712. 339
  713. 340 PROCEDURE HandleToList( TheHandle : VStorage.MemHandle;
  714. ***** ^ not supported yet
  715. 341 BlockSize : CARDINAL; delimiter1, delimiter2 : ARRAY OF
  716. 342 CHAR; RecSize, TypeCode : CARDINAL; VAR TheList : GenLists.GenList);
  717. ***** ^ not supported yet
  718. ***** ^ not supported yet
  719. 343 VAR
  720. 344 BytesDone, Delim1Len, Delim2Len : CARDINAL;
  721. 345 TwoDelimiters, FixedLengthRecs : BOOLEAN;
  722. 346
  723. 347 PROCEDURE AnElmtStartsHere( OffSet: CARDINAL ): BOOLEAN;
  724. 348 VAR
  725. 349 TmpAdr: SYSTEM.ADDRESS;
  726. ***** ^ not supported yet
  727. 350 BEGIN
  728. 351 IF FixedLengthRecs OR (NOT TwoDelimiters) THEN
  729. 352 RETURN FALSE;
  730. 353 END;
  731. 354 TmpAdr := VStorage.LockMem( TheHandle );
  732. ***** ^ not supported yet
  733. ***** ^ not supported yet
  734. ***** ^ not supported yet
  735. ***** ^ not supported yet
  736. 355 VStorage.UnLockMem( TheHandle );
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. ***** ^ not supported yet
  740. 356 LowLevel.IncAddr( TmpAdr, OffSet );
  741. ***** ^ not supported yet
  742. ***** ^ not supported yet
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. 357 IF (BytesDone >= BlockSize) OR (0 = PosUtils.PosAdr(
  746. ***** ^ not supported yet
  747. ***** ^ not supported yet
  748. 358 delimiter1, TmpAdr, BlockSize - BytesDone)) THEN
  749. ***** ^ not supported yet
  750. ***** ^ not supported yet
  751. ***** ^ not supported yet
  752. 359 RETURN TRUE;
  753. 360 END;
  754. 361 RETURN FALSE;
  755. 362 END AnElmtStartsHere;
  756. ***** ^ not supported yet
  757. 363
  758. 364 PROCEDURE AnElmtEndsHere( OffSet: CARDINAL ): BOOLEAN;
  759. 365 VAR
  760. 366 TmpAdr: SYSTEM.ADDRESS;
  761. ***** ^ not supported yet
  762. 367 BEGIN
  763. 368 IF FixedLengthRecs OR (NOT TwoDelimiters) THEN
  764. 369 RETURN FALSE;
  765. 370 END;
  766. 371 TmpAdr := VStorage.LockMem( TheHandle );
  767. ***** ^ not supported yet
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. 372 VStorage.UnLockMem( TheHandle );
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. ***** ^ not supported yet
  775. 373 LowLevel.IncAddr( TmpAdr, OffSet );
  776. ***** ^ not supported yet
  777. ***** ^ not supported yet
  778. ***** ^ not supported yet
  779. ***** ^ not supported yet
  780. 374 IF (BytesDone >= BlockSize) OR (0 = PosUtils.PosAdr(
  781. ***** ^ not supported yet
  782. ***** ^ not supported yet
  783. 375 delimiter2, TmpAdr, BlockSize - BytesDone)) THEN
  784. ***** ^ not supported yet
  785. ***** ^ not supported yet
  786. ***** ^ not supported yet
  787. 376 RETURN TRUE;
  788. 377 END;
  789. 378 RETURN FALSE;
  790. 379 END AnElmtEndsHere;
  791. ***** ^ not supported yet
  792. 380
  793. 381 PROCEDURE SizeOfElement( OldAdr: SYSTEM.ADDRESS ): CARDINAL;
  794. ***** ^ not supported yet
  795. 382 (*Returns the address of the first byte following delimiter2,
  796. 383 but dist includes only the bytes preceding delimiter2.*)
  797. 384 BEGIN
  798. 385 IF FixedLengthRecs THEN
  799. 386 RETURN RecSize;
  800. 387 ELSE
  801. 388 RETURN PosUtils.PosAdr( delimiter2, OldAdr, BlockSize-BytesDone);
  802. ***** ^ not supported yet
  803. ***** ^ not supported yet
  804. ***** ^ not supported yet
  805. ***** ^ not supported yet
  806. ***** ^ not supported yet
  807. 389 END;
  808. 390 END SizeOfElement;
  809. ***** ^ not supported yet
  810. 391
  811. 392 PROCEDURE MakeOneList( TheList : GenLists.GenList );
  812. ***** ^ not supported yet
  813. 393 VAR
  814. 394 TmpTypeCode, TmpSize: CARDINAL;
  815. 395 TmpAdr: SYSTEM.ADDRESS;
  816. ***** ^ not supported yet
  817. 396 SubList : GenLists.GenList;
  818. ***** ^ not supported yet
  819. 397 BEGIN
  820. 398 LOOP
  821. 399 IF TwoDelimiters THEN
  822. 400 LOOP
  823. 401 (*Skip the leading delim1, if there is one, and
  824. 402 move at least to the byte just beyond the next
  825. 403 delim1.*)
  826. 404 IF AnElmtStartsHere(BytesDone) THEN
  827. ***** ^ not supported yet
  828. ***** ^ not supported yet
  829. 405 INC( BytesDone, Delim1Len );
  830. ***** ^ undeclared identifier
  831. ***** ^ not supported yet
  832. 406 EXIT;
  833. 407 ELSE
  834. 408 INC( BytesDone, Delim1Len );
  835. ***** ^ undeclared identifier
  836. ***** ^ not supported yet
  837. 409 END;
  838. 410 END;
  839. 411 END;
  840. 412 IF (BytesDone >= BlockSize) THEN
  841. 413 EXIT;
  842. 414 END;
  843. 415 IF (TypeCode < 65000)
  844. 416 AND (NOT FixedLengthRecs)
  845. 417 AND TwoDelimiters THEN
  846. 418 TmpAdr := VStorage.LockMem( TheHandle );
  847. ***** ^ not supported yet
  848. ***** ^ not supported yet
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. 419 LowLevel.IncAddr( TmpAdr, BytesDone );
  852. ***** ^ not supported yet
  853. ***** ^ not supported yet
  854. ***** ^ not supported yet
  855. ***** ^ not supported yet
  856. 420 LowLevel.Move( TmpAdr, SYSTEM.ADR(TmpTypeCode), 2);
  857. ***** ^ not supported yet
  858. ***** ^ not supported yet
  859. ***** ^ not supported yet
  860. ***** ^ not supported yet
  861. ***** ^ not supported yet
  862. ***** ^ not supported yet
  863. ***** ^ not supported yet
  864. 421 VStorage.UnLockMem( TheHandle );
  865. ***** ^ not supported yet
  866. ***** ^ not supported yet
  867. ***** ^ not supported yet
  868. 422 INC( BytesDone, 2 );
  869. ***** ^ undeclared identifier
  870. ***** ^ not supported yet
  871. 423 ELSE
  872. 424 TmpTypeCode := TypeCode;
  873. 425 END;
  874. 426 IF (TmpTypeCode = GenLists.ListCode) OR AnElmtStartsHere(
  875. ***** ^ not supported yet
  876. ***** ^ not supported yet
  877. ***** ^ not supported yet
  878. 427 BytesDone ) THEN
  879. ***** ^ not supported yet
  880. 428 GenLists.NewList( SubList );
  881. ***** ^ not supported yet
  882. ***** ^ not supported yet
  883. ***** ^ not supported yet
  884. 429 IF AnElmtEndsHere( BytesDone ) THEN
  885. ***** ^ not supported yet
  886. ***** ^ not supported yet
  887. 430 (*Null list.*)
  888. 431 INC( BytesDone, Delim2Len );
  889. ***** ^ undeclared identifier
  890. ***** ^ not supported yet
  891. 432 ELSE
  892. 433 MakeOneList( SubList );
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. 434 END;
  896. 435 GenLists.ListInsert( SubList, GenLists.ListCode, TheList, 65535 );
  897. ***** ^ not supported yet
  898. ***** ^ not supported yet
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. ***** ^ not supported yet
  902. ***** ^ not supported yet
  903. ***** ^ not supported yet
  904. 436 ELSE
  905. 437 TmpAdr := VStorage.LockMem( TheHandle );
  906. ***** ^ not supported yet
  907. ***** ^ not supported yet
  908. ***** ^ not supported yet
  909. ***** ^ not supported yet
  910. 438 VStorage.UnLockMem( TheHandle );
  911. ***** ^ not supported yet
  912. ***** ^ not supported yet
  913. ***** ^ not supported yet
  914. 439 LowLevel.IncAddr( TmpAdr, BytesDone );
  915. ***** ^ not supported yet
  916. ***** ^ not supported yet
  917. ***** ^ not supported yet
  918. ***** ^ not supported yet
  919. 440 TmpSize := SizeOfElement( TmpAdr );
  920. ***** ^ not supported yet
  921. ***** ^ not supported yet
  922. 441 GenLists.ListInsertAdr( TmpAdr, TmpSize, TmpTypeCode,
  923. ***** ^ not supported yet
  924. ***** ^ not supported yet
  925. ***** ^ not supported yet
  926. 442 TheList, 65535 );
  927. ***** ^ not supported yet
  928. ***** ^ not supported yet
  929. 443 INC( BytesDone, TmpSize + Delim2Len );
  930. ***** ^ undeclared identifier
  931. ***** ^ not supported yet
  932. 444 END;
  933. 445 IF (BytesDone >= BlockSize) OR (AnElmtEndsHere(BytesDone)) THEN
  934. ***** ^ not supported yet
  935. ***** ^ not supported yet
  936. 446 (*Increment past the delimiter2 that ends the whole list.*)
  937. 447 INC( BytesDone, Delim2Len );
  938. ***** ^ undeclared identifier
  939. ***** ^ not supported yet
  940. 448 EXIT;
  941. 449 END;
  942. 450 END;
  943. 451 END MakeOneList;
  944. ***** ^ not supported yet
  945. 452
  946. 453 BEGIN
  947. 454 (*HandleToList*)
  948. 455 IF NOT GenLists.Initialized( TheList ) THEN
  949. ***** ^ not supported yet
  950. ***** ^ not supported yet
  951. ***** ^ not supported yet
  952. 456 InitResponse( 'HandleToList' );
  953. ***** ^ not supported yet
  954. ***** ^ not supported yet
  955. 457 END;
  956. 458 Delim1Len := M2Strings.Length(delimiter1);
  957. ***** ^ not supported yet
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. 459 Delim2Len := M2Strings.Length(delimiter2);
  961. ***** ^ not supported yet
  962. ***** ^ not supported yet
  963. ***** ^ not supported yet
  964. 460 TwoDelimiters := FALSE;
  965. 461 IF ((Delim1Len>0) OR (Delim2Len>0)) AND (RecSize>0) THEN
  966. 462 ErrorManager.WARN("Delim-RecSize conflict");
  967. ***** ^ not supported yet
  968. ***** ^ not supported yet
  969. ***** ^ not supported yet
  970. 463 RETURN;
  971. 464 END;
  972. 465 FixedLengthRecs := RecSize>0;
  973. 466 IF FixedLengthRecs THEN
  974. 467 IF ((BlockSize MOD RecSize) # 0) THEN
  975. 468 ErrorManager.WARN('Bad Recsize');
  976. ***** ^ not supported yet
  977. ***** ^ not supported yet
  978. ***** ^ not supported yet
  979. 469 RETURN;
  980. 470 END;
  981. 471 ELSE
  982. 472 IF NOT PosUtils.Equal(delimiter1,delimiter2) THEN
  983. ***** ^ not supported yet
  984. ***** ^ not supported yet
  985. ***** ^ not supported yet
  986. ***** ^ not supported yet
  987. 473 TwoDelimiters := TRUE;
  988. 474 END;
  989. 475 END;
  990. 476
  991. 477 BytesDone := 0;
  992. 478
  993. 479 MakeOneList( TheList );
  994. ***** ^ not supported yet
  995. ***** ^ not supported yet
  996. 480
  997. 481 VStorage.DeallocMem( TheHandle, BlockSize );
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. ***** ^ not supported yet
  1001. ***** ^ not supported yet
  1002. 482 END HandleToList;
  1003. ***** ^ not supported yet
  1004. 483
  1005. 484
  1006. 485 (*$O-*)
  1007. 486 (*We turn off optimization for this procedure because of a bug in
  1008. 487 Logitech's v3.0.*)
  1009. 488
  1010. 489 PROCEDURE ListToFileHandle( TheList: GenLists.GenList; TheHandle:
  1011. ***** ^ not supported yet
  1012. 490 CARDINAL; delim1, delim2: ARRAY OF CHAR;
  1013. ***** ^ not supported yet
  1014. 491 InitialNestingLevel: CARDINAL; VAR BytesWritten:
  1015. 492 LONGINT ): CARDINAL;
  1016. 493 VAR
  1017. 494 TmpAdr: SYSTEM.ADDRESS;
  1018. ***** ^ not supported yet
  1019. 495 LstCount, LstLngth, TypeCode, TmpSize, DumRecSz,
  1020. 496 Delim1Lngth, Delim2Lngth, tmpc: CARDINAL;
  1021. 497 SubList: GenLists.GenList;
  1022. ***** ^ not supported yet
  1023. 498 NilList, TwoDelimiters: BOOLEAN;
  1024. 499 SavedMessage: CARDINAL;
  1025. 500 TmpL, TmpBytesWritten: LONGINT;
  1026. 501
  1027. 502 BEGIN
  1028. 503 BytesWritten := NumTypes.L0;
  1029. ***** ^ not supported yet
  1030. ***** ^ not supported yet
  1031. 504 Delim1Lngth := M2Strings.Length( delim1 );
  1032. ***** ^ not supported yet
  1033. ***** ^ not supported yet
  1034. ***** ^ not supported yet
  1035. 505 Delim2Lngth := M2Strings.Length( delim2 );
  1036. ***** ^ not supported yet
  1037. ***** ^ not supported yet
  1038. ***** ^ not supported yet
  1039. 506 TwoDelimiters := (Delim1Lngth > 0) AND (Delim2Lngth > 0);
  1040. 507 (*We begin and end the procedure by bracketing the
  1041. 508 entire block with a StartSep and EndSep, if the
  1042. 509 parameter list indicates that they're in use. That's
  1043. 510 the convention NdxFiles uses to indicate that the block
  1044. 511 as a whole represents a list.*)
  1045. 512 IF (Delim1Lngth > 0) AND (InitialNestingLevel = 0) THEN
  1046. 513 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1047. ***** ^ not supported yet
  1048. ***** ^ not supported yet
  1049. 514 SYSTEM.ADR(delim1), Delim1Lngth );
  1050. ***** ^ not supported yet
  1051. ***** ^ not supported yet
  1052. ***** ^ not supported yet
  1053. ***** ^ not supported yet
  1054. 515 TmpL := Numbers.Lc(Delim1Lngth);
  1055. ***** ^ not supported yet
  1056. ***** ^ not supported yet
  1057. ***** ^ not supported yet
  1058. 516 (*Necessary because of a bug in Logitech's LONGINT
  1059. 517 addition.*)
  1060. 518 BytesWritten := BytesWritten + TmpL;
  1061. 519 END;
  1062. 520 IF TwoDelimiters AND (InitialNestingLevel = 0) THEN
  1063. 521 tmpc := GenLists.ListCode;
  1064. ***** ^ not supported yet
  1065. ***** ^ not supported yet
  1066. 522 (*We have to do this because some implementations won't
  1067. 523 give us the address of a constant.*)
  1068. 524 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1069. ***** ^ not supported yet
  1070. ***** ^ not supported yet
  1071. 525 SYSTEM.ADR(tmpc), SYSTEM.TSIZE(CARDINAL) );
  1072. ***** ^ not supported yet
  1073. ***** ^ not supported yet
  1074. ***** ^ not supported yet
  1075. ***** ^ not supported yet
  1076. ***** ^ not supported yet
  1077. ***** ^ not supported yet
  1078. 526 BytesWritten := BytesWritten + Numbers.Lc(SYSTEM.TSIZE(CARDINAL));
  1079. ***** ^ not supported yet
  1080. ***** ^ not supported yet
  1081. ***** ^ not supported yet
  1082. ***** ^ not supported yet
  1083. ***** ^ not supported yet
  1084. 527 END;
  1085. 528 IF GenLists.Initialized( TheList ) THEN
  1086. ***** ^ not supported yet
  1087. ***** ^ not supported yet
  1088. ***** ^ not supported yet
  1089. 529 NilList := FALSE;
  1090. 530 ELSE
  1091. 531 GenLists.NewList( TheList );
  1092. ***** ^ not supported yet
  1093. ***** ^ not supported yet
  1094. ***** ^ not supported yet
  1095. 532 NilList := TRUE;
  1096. 533 END;
  1097. 534 GenLists.ListToBlock( TheList, delim1, delim2,
  1098. ***** ^ not supported yet
  1099. ***** ^ not supported yet
  1100. ***** ^ not supported yet
  1101. ***** ^ not supported yet
  1102. ***** ^ not supported yet
  1103. 535 TmpAdr, TmpSize, DumRecSz);
  1104. ***** ^ not supported yet
  1105. ***** ^ not supported yet
  1106. 536 IF (GenLists.ErrorFlag = GenLists.NoListError) THEN
  1107. ***** ^ not supported yet
  1108. ***** ^ not supported yet
  1109. ***** ^ not supported yet
  1110. ***** ^ not supported yet
  1111. 537 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1112. ***** ^ not supported yet
  1113. ***** ^ not supported yet
  1114. 538 TmpAdr, TmpSize );
  1115. ***** ^ not supported yet
  1116. ***** ^ not supported yet
  1117. 539 (*Write the Ndx as a single block.*)
  1118. 540 VStorage.DosDealloc( TmpAdr, TmpSize);
  1119. ***** ^ not supported yet
  1120. ***** ^ not supported yet
  1121. ***** ^ not supported yet
  1122. ***** ^ not supported yet
  1123. 541 (*Get rid of temporary buffer space used.*)
  1124. 542 BytesWritten := BytesWritten + Numbers.Lc(TmpSize);
  1125. ***** ^ not supported yet
  1126. ***** ^ not supported yet
  1127. ***** ^ not supported yet
  1128. 543 IF (Delim2Lngth > 0) AND (InitialNestingLevel = 0) THEN
  1129. 544 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1130. ***** ^ not supported yet
  1131. ***** ^ not supported yet
  1132. 545 SYSTEM.ADR(delim2), Delim2Lngth );
  1133. ***** ^ not supported yet
  1134. ***** ^ not supported yet
  1135. ***** ^ not supported yet
  1136. ***** ^ not supported yet
  1137. 546 BytesWritten := BytesWritten + Numbers.Lc(Delim2Lngth);
  1138. ***** ^ not supported yet
  1139. ***** ^ not supported yet
  1140. ***** ^ not supported yet
  1141. 547 END;
  1142. 548 IF NilList THEN
  1143. 549 GenLists.DisposeList( TheList );
  1144. ***** ^ not supported yet
  1145. ***** ^ not supported yet
  1146. ***** ^ not supported yet
  1147. 550 END;
  1148. 551 RETURN SavedMessage;
  1149. 552 END;
  1150. 553 (*Write the NdxElements one by one if there isn't
  1151. 554 enough memory to write them as a block.*)
  1152. 555 LstLngth := GenLists.ListLength( TheList );
  1153. ***** ^ not supported yet
  1154. ***** ^ not supported yet
  1155. ***** ^ not supported yet
  1156. 556 LstCount := 1;
  1157. 557 WHILE LstCount <= LstLngth DO
  1158. 558 GenLists.GetElmtAdr( TheList, LstCount, TmpAdr,
  1159. ***** ^ not supported yet
  1160. ***** ^ not supported yet
  1161. ***** ^ not supported yet
  1162. ***** ^ not supported yet
  1163. 559 TmpSize, TypeCode );
  1164. ***** ^ not supported yet
  1165. 560 IF Delim1Lngth > 0 THEN
  1166. 561 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1167. ***** ^ not supported yet
  1168. ***** ^ not supported yet
  1169. 562 SYSTEM.ADR(delim1), Delim1Lngth );
  1170. ***** ^ not supported yet
  1171. ***** ^ not supported yet
  1172. ***** ^ not supported yet
  1173. ***** ^ not supported yet
  1174. 563 BytesWritten := BytesWritten + Numbers.Lc(Delim1Lngth);
  1175. ***** ^ not supported yet
  1176. ***** ^ not supported yet
  1177. ***** ^ not supported yet
  1178. 564 END;
  1179. 565 IF TwoDelimiters THEN
  1180. 566 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1181. ***** ^ not supported yet
  1182. ***** ^ not supported yet
  1183. 567 SYSTEM.ADR(TypeCode), SYSTEM.TSIZE(CARDINAL) );
  1184. ***** ^ not supported yet
  1185. ***** ^ not supported yet
  1186. ***** ^ not supported yet
  1187. ***** ^ not supported yet
  1188. ***** ^ not supported yet
  1189. ***** ^ not supported yet
  1190. 568 BytesWritten := BytesWritten + Numbers.Lc(SYSTEM.TSIZE(CARDINAL));
  1191. ***** ^ not supported yet
  1192. ***** ^ not supported yet
  1193. ***** ^ not supported yet
  1194. ***** ^ not supported yet
  1195. ***** ^ not supported yet
  1196. 569 END;
  1197. 570 IF TypeCode = GenLists.ListCode THEN
  1198. ***** ^ not supported yet
  1199. ***** ^ not supported yet
  1200. 571 GenLists.GetChildList( TheList, LstCount, SubList );
  1201. ***** ^ not supported yet
  1202. ***** ^ not supported yet
  1203. ***** ^ not supported yet
  1204. ***** ^ not supported yet
  1205. 572 SavedMessage := ListToFileHandle( SubList, TheHandle,
  1206. ***** ^ not supported yet
  1207. ***** ^ not supported yet
  1208. 573 delim1, delim2, InitialNestingLevel + 1,
  1209. ***** ^ not supported yet
  1210. ***** ^ not supported yet
  1211. 574 TmpBytesWritten );
  1212. ***** ^ not supported yet
  1213. 575 BytesWritten := BytesWritten + TmpBytesWritten;
  1214. 576 IF SavedMessage # StringIO.NoError THEN
  1215. ***** ^ not supported yet
  1216. ***** ^ not supported yet
  1217. 577 IF NilList THEN
  1218. 578 GenLists.DisposeList( TheList );
  1219. ***** ^ not supported yet
  1220. ***** ^ not supported yet
  1221. ***** ^ not supported yet
  1222. 579 END;
  1223. 580 RETURN SavedMessage;
  1224. 581 END;
  1225. 582 ELSE
  1226. 583 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1227. ***** ^ not supported yet
  1228. ***** ^ not supported yet
  1229. 584 TmpAdr, TmpSize );
  1230. ***** ^ not supported yet
  1231. ***** ^ not supported yet
  1232. 585 BytesWritten := BytesWritten + Numbers.Lc( TmpSize );
  1233. ***** ^ not supported yet
  1234. ***** ^ not supported yet
  1235. ***** ^ not supported yet
  1236. 586 END;
  1237. 587 IF Delim2Lngth > 0 THEN
  1238. 588 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1239. ***** ^ not supported yet
  1240. ***** ^ not supported yet
  1241. 589 SYSTEM.ADR(delim2), Delim2Lngth );
  1242. ***** ^ not supported yet
  1243. ***** ^ not supported yet
  1244. ***** ^ not supported yet
  1245. ***** ^ not supported yet
  1246. 590 BytesWritten := BytesWritten + Numbers.Lc(Delim2Lngth);
  1247. ***** ^ not supported yet
  1248. ***** ^ not supported yet
  1249. ***** ^ not supported yet
  1250. 591 END;
  1251. 592 INC(LstCount);
  1252. ***** ^ undeclared identifier
  1253. ***** ^ not supported yet
  1254. 593 END;
  1255. 594 IF (Delim2Lngth > 0) AND (InitialNestingLevel = 0) THEN
  1256. 595 SavedMessage := HandleIO.BlockWrite( TheHandle,
  1257. ***** ^ not supported yet
  1258. ***** ^ not supported yet
  1259. 596 SYSTEM.ADR(delim2), Delim2Lngth );
  1260. ***** ^ not supported yet
  1261. ***** ^ not supported yet
  1262. ***** ^ not supported yet
  1263. ***** ^ not supported yet
  1264. 597 BytesWritten := BytesWritten + Numbers.Lc(Delim2Lngth);
  1265. ***** ^ not supported yet
  1266. ***** ^ not supported yet
  1267. ***** ^ not supported yet
  1268. 598 END;
  1269. 599 IF NilList THEN
  1270. 600 GenLists.DisposeList( TheList );
  1271. ***** ^ not supported yet
  1272. ***** ^ not supported yet
  1273. ***** ^ not supported yet
  1274. 601 END;
  1275. 602 RETURN SavedMessage;
  1276. 603 END ListToFileHandle;
  1277. ***** ^ not supported yet
  1278. 604 (*$O=*)
  1279. 605
  1280. 606
  1281. 607 PROCEDURE InsertElmtsOf( List1: GenLists.GenList; StartingAt,
  1282. ***** ^ not supported yet
  1283. 608 NumberOfLines: CARDINAL; VAR List2: GenLists.GenList;
  1284. ***** ^ not supported yet
  1285. 609 InsertionPoint: CARDINAL );
  1286. 610 VAR
  1287. 611 cnt, tmpsize, TypeCode, List2Lngth : CARDINAL;
  1288. 612 tmpadr: SYSTEM.ADDRESS;
  1289. ***** ^ not supported yet
  1290. 613 BEGIN
  1291. 614 NumberOfLines := Numbers.Min( NumberOfLines,
  1292. ***** ^ not supported yet
  1293. ***** ^ not supported yet
  1294. 615 GenLists.ListLength( List1 ) );
  1295. ***** ^ not supported yet
  1296. ***** ^ not supported yet
  1297. ***** ^ not supported yet
  1298. 616 List2Lngth := GenLists.ListLength( List2 );
  1299. ***** ^ not supported yet
  1300. ***** ^ not supported yet
  1301. ***** ^ not supported yet
  1302. 617 IF Numbers.Lc(InsertionPoint) +
  1303. ***** ^ not supported yet
  1304. ***** ^ not supported yet
  1305. ***** ^ not supported yet
  1306. 618 Numbers.Lc( NumberOfLines ) > NumTypes.L65535 THEN
  1307. ***** ^ not supported yet
  1308. ***** ^ not supported yet
  1309. ***** ^ not supported yet
  1310. ***** ^ not supported yet
  1311. ***** ^ not supported yet
  1312. 619 InsertionPoint := List2Lngth + 1;
  1313. 620 END;
  1314. 621 FOR cnt := 1 TO NumberOfLines DO
  1315. 622 GenLists.GetElmtAdr( List1, StartingAt + cnt - 1, tmpadr,
  1316. ***** ^ not supported yet
  1317. ***** ^ not supported yet
  1318. ***** ^ not supported yet
  1319. ***** ^ not supported yet
  1320. 623 tmpsize, TypeCode );
  1321. ***** ^ not supported yet
  1322. 624 GenLists.ListInsertAdr( tmpadr, tmpsize, TypeCode, List2,
  1323. ***** ^ not supported yet
  1324. ***** ^ not supported yet
  1325. ***** ^ not supported yet
  1326. ***** ^ not supported yet
  1327. 625 InsertionPoint + (cnt - 1) );
  1328. ***** ^ not supported yet
  1329. 626 END;
  1330. 627 END InsertElmtsOf;
  1331. ***** ^ not supported yet
  1332. 628
  1333. 629
  1334. 630 PROCEDURE InsertIntoElmt( VAR TheList: GenLists.GenList;
  1335. ***** ^ not supported yet
  1336. 631 ListSpot: CARDINAL; StrAdr: SYSTEM.ADDRESS; StrSize:
  1337. ***** ^ not supported yet
  1338. 632 CARDINAL; ElmtSpot: CARDINAL );
  1339. 633 VAR
  1340. 634 tmpadr1, tmpadr2: SYSTEM.ADDRESS;
  1341. ***** ^ not supported yet
  1342. 635 TypeCode, tmpsize: CARDINAL;
  1343. 636 BEGIN
  1344. 637 GenLists.GetElmtAdr( TheList, ListSpot, tmpadr1, tmpsize, TypeCode );
  1345. ***** ^ not supported yet
  1346. ***** ^ not supported yet
  1347. ***** ^ not supported yet
  1348. ***** ^ not supported yet
  1349. ***** ^ not supported yet
  1350. 638 (* Make sure we're inserting into a string. *)
  1351. 639 IF TypeCode # GenLists.StrCode THEN
  1352. ***** ^ not supported yet
  1353. ***** ^ not supported yet
  1354. 640 ErrorManager.WARN('Not a string');
  1355. ***** ^ not supported yet
  1356. ***** ^ not supported yet
  1357. ***** ^ not supported yet
  1358. 641 END;
  1359. 642 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr1 );
  1360. ***** ^ not supported yet
  1361. ***** ^ not supported yet
  1362. ***** ^ not supported yet
  1363. 643 (* This means you can insert your string at ElmtSpot 65535 and
  1364. 644 have it neatly appended. *)
  1365. 645 IF ElmtSpot > tmpsize THEN
  1366. 646 ElmtSpot := tmpsize;
  1367. 647 END;
  1368. 648 VStorage.DosAlloc( tmpadr2, tmpsize + StrSize );
  1369. ***** ^ not supported yet
  1370. ***** ^ not supported yet
  1371. ***** ^ not supported yet
  1372. ***** ^ not supported yet
  1373. 649 LowLevel.Move( tmpadr1, tmpadr2, ElmtSpot );
  1374. ***** ^ not supported yet
  1375. ***** ^ not supported yet
  1376. ***** ^ not supported yet
  1377. ***** ^ not supported yet
  1378. ***** ^ not supported yet
  1379. 650 LowLevel.Move( StrAdr, LowLevel.AddAddr(tmpadr2, ElmtSpot), StrSize );
  1380. ***** ^ not supported yet
  1381. ***** ^ not supported yet
  1382. ***** ^ not supported yet
  1383. ***** ^ not supported yet
  1384. ***** ^ not supported yet
  1385. ***** ^ not supported yet
  1386. ***** ^ not supported yet
  1387. ***** ^ not supported yet
  1388. 651 LowLevel.Move( LowLevel.AddAddr(tmpadr1, ElmtSpot),
  1389. ***** ^ not supported yet
  1390. ***** ^ not supported yet
  1391. ***** ^ not supported yet
  1392. ***** ^ not supported yet
  1393. ***** ^ not supported yet
  1394. ***** ^ not supported yet
  1395. 652 LowLevel.AddAddr(tmpadr2, ElmtSpot + StrSize), tmpsize - ElmtSpot );
  1396. ***** ^ not supported yet
  1397. ***** ^ not supported yet
  1398. ***** ^ not supported yet
  1399. ***** ^ not supported yet
  1400. ***** ^ not supported yet
  1401. 653 GenLists.ListReplaceAdr( tmpadr2, tmpsize + StrSize, GenLists.StrCode,
  1402. ***** ^ not supported yet
  1403. ***** ^ not supported yet
  1404. ***** ^ not supported yet
  1405. ***** ^ not supported yet
  1406. ***** ^ not supported yet
  1407. 654 TheList, ListSpot );
  1408. ***** ^ not supported yet
  1409. ***** ^ not supported yet
  1410. 655 VStorage.DosDealloc( tmpadr2, tmpsize + StrSize );
  1411. ***** ^ not supported yet
  1412. ***** ^ not supported yet
  1413. ***** ^ not supported yet
  1414. ***** ^ not supported yet
  1415. 656 END InsertIntoElmt;
  1416. ***** ^ not supported yet
  1417. 657
  1418. 658
  1419. 659 PROCEDURE IsBlankList( TheList: GenLists.GenList ): BOOLEAN;
  1420. ***** ^ not supported yet
  1421. 660 (*We use this procedure to test Editor fields that have been
  1422. 661 marked "required."*)
  1423. 662 VAR
  1424. 663 SomethingFound: BOOLEAN;
  1425. 664 lngth, cnt, TypeCode: CARDINAL;
  1426. 665 LocalStr: ARRAY [0..127] OF CHAR;
  1427. ***** ^ not supported yet
  1428. ***** ^ not supported yet
  1429. 666 BEGIN
  1430. 667 IF NOT GenLists.Initialized(TheList) THEN
  1431. ***** ^ not supported yet
  1432. ***** ^ not supported yet
  1433. ***** ^ not supported yet
  1434. 668 RETURN TRUE;
  1435. 669 END;
  1436. 670 SomethingFound := FALSE;
  1437. 671 lngth := GenLists.ListLength( TheList );
  1438. ***** ^ not supported yet
  1439. ***** ^ not supported yet
  1440. ***** ^ not supported yet
  1441. 672 cnt := 1;
  1442. 673 WHILE (cnt <= lngth) AND (NOT SomethingFound) DO
  1443. 674 GenLists.GetElmt( TheList, cnt, LocalStr, TypeCode );
  1444. ***** ^ not supported yet
  1445. ***** ^ not supported yet
  1446. ***** ^ not supported yet
  1447. ***** ^ not supported yet
  1448. ***** ^ not supported yet
  1449. 675 SomethingFound := (TypeCode # GenLists.StrCode) OR (NOT
  1450. ***** ^ not supported yet
  1451. ***** ^ not supported yet
  1452. 676 PosUtils.IsBlank( LocalStr ));
  1453. ***** ^ not supported yet
  1454. ***** ^ not supported yet
  1455. ***** ^ not supported yet
  1456. 677 INC(cnt);
  1457. ***** ^ undeclared identifier
  1458. ***** ^ not supported yet
  1459. 678 END;
  1460. 679 RETURN NOT SomethingFound;
  1461. 680 END IsBlankList;
  1462. ***** ^ not supported yet
  1463. 681
  1464. 682
  1465. 683 PROCEDURE ListToString( TheList: GenLists.GenList; VAR TheStr: ARRAY OF CHAR);
  1466. ***** ^ not supported yet
  1467. ***** ^ not supported yet
  1468. 684 VAR
  1469. 685 tmpstr: ARRAY [0..255] OF CHAR;
  1470. ***** ^ not supported yet
  1471. ***** ^ not supported yet
  1472. 686 lngth, TypeCode, cnt: CARDINAL;
  1473. 687 BEGIN
  1474. 688 lngth := GenLists.ListLength( TheList );
  1475. ***** ^ not supported yet
  1476. ***** ^ not supported yet
  1477. ***** ^ not supported yet
  1478. 689 StrEdit.SetLength( TheStr, 0 );
  1479. ***** ^ not supported yet
  1480. ***** ^ not supported yet
  1481. ***** ^ not supported yet
  1482. ***** ^ not supported yet
  1483. 690 FOR cnt := 1 TO lngth DO
  1484. 691 GenLists.GetElmt( TheList, cnt, tmpstr, TypeCode );
  1485. ***** ^ not supported yet
  1486. ***** ^ not supported yet
  1487. ***** ^ not supported yet
  1488. ***** ^ not supported yet
  1489. ***** ^ not supported yet
  1490. 692 IF TypeCode = GenLists.StrCode THEN
  1491. ***** ^ not supported yet
  1492. ***** ^ not supported yet
  1493. 693 StrEdit.Append( TheStr, tmpstr );
  1494. ***** ^ not supported yet
  1495. ***** ^ not supported yet
  1496. ***** ^ not supported yet
  1497. ***** ^ not supported yet
  1498. 694 END;
  1499. 695 END;
  1500. 696 END ListToString;
  1501. ***** ^ not supported yet
  1502. 697
  1503. 698
  1504. 699
  1505. 700 PROCEDURE LongestLine( TheList: GenLists.GenList ): CARDINAL;
  1506. ***** ^ not supported yet
  1507. 701 VAR
  1508. 702 LstLngth, lngth, cnt, longest: CARDINAL;
  1509. 703 BEGIN
  1510. 704 LstLngth := GenLists.ListLength( TheList );
  1511. ***** ^ not supported yet
  1512. ***** ^ not supported yet
  1513. ***** ^ not supported yet
  1514. 705 longest := 0;
  1515. 706 FOR cnt := 1 TO LstLngth DO
  1516. 707 lngth := ElmtSize( TheList, cnt );
  1517. ***** ^ not supported yet
  1518. ***** ^ not supported yet
  1519. ***** ^ not supported yet
  1520. 708 IF lngth > longest THEN
  1521. 709 longest := lngth;
  1522. 710 END;
  1523. 711 END;
  1524. 712 RETURN longest;
  1525. 713 END LongestLine;
  1526. ***** ^ not supported yet
  1527. 714
  1528. 715
  1529. 716 PROCEDURE OverwriteElmt( VAR TheList: GenLists.GenList;
  1530. ***** ^ not supported yet
  1531. 717 ListSpot: CARDINAL; StrAdr: SYSTEM.ADDRESS; StrSize:
  1532. ***** ^ not supported yet
  1533. 718 CARDINAL; ElmtSpot: CARDINAL );
  1534. 719 VAR
  1535. 720 tmpadr1, tmpadr2: SYSTEM.ADDRESS;
  1536. ***** ^ not supported yet
  1537. 721 excess, TypeCode, tmpsize: CARDINAL;
  1538. 722 BEGIN
  1539. 723 GenLists.GetElmtAdr( TheList, ListSpot, tmpadr1, tmpsize, TypeCode );
  1540. ***** ^ not supported yet
  1541. ***** ^ not supported yet
  1542. ***** ^ not supported yet
  1543. ***** ^ not supported yet
  1544. ***** ^ not supported yet
  1545. 724 IF TypeCode # GenLists.StrCode THEN
  1546. ***** ^ not supported yet
  1547. ***** ^ not supported yet
  1548. 725 ErrorManager.WARN('Not a string');
  1549. ***** ^ not supported yet
  1550. ***** ^ not supported yet
  1551. ***** ^ not supported yet
  1552. 726 END;
  1553. 727 IF tmpsize >= (ElmtSpot + StrSize) THEN
  1554. 728 LowLevel.Move( StrAdr, LowLevel.AddAddr(tmpadr1, ElmtSpot), StrSize );
  1555. ***** ^ not supported yet
  1556. ***** ^ not supported yet
  1557. ***** ^ not supported yet
  1558. ***** ^ not supported yet
  1559. ***** ^ not supported yet
  1560. ***** ^ not supported yet
  1561. ***** ^ not supported yet
  1562. ***** ^ not supported yet
  1563. 729 ELSE
  1564. 730 excess := (ElmtSpot + StrSize) - tmpsize;
  1565. 731 VStorage.DosAlloc( tmpadr2, tmpsize + excess );
  1566. ***** ^ not supported yet
  1567. ***** ^ not supported yet
  1568. ***** ^ not supported yet
  1569. ***** ^ not supported yet
  1570. 732 LowLevel.Move( tmpadr1, tmpadr2, ElmtSpot );
  1571. ***** ^ not supported yet
  1572. ***** ^ not supported yet
  1573. ***** ^ not supported yet
  1574. ***** ^ not supported yet
  1575. ***** ^ not supported yet
  1576. 733 LowLevel.Move( StrAdr, LowLevel.AddAddr(tmpadr2, ElmtSpot), StrSize );
  1577. ***** ^ not supported yet
  1578. ***** ^ not supported yet
  1579. ***** ^ not supported yet
  1580. ***** ^ not supported yet
  1581. ***** ^ not supported yet
  1582. ***** ^ not supported yet
  1583. ***** ^ not supported yet
  1584. ***** ^ not supported yet
  1585. 734 GenLists.ListReplaceAdr( tmpadr2, tmpsize + excess,
  1586. ***** ^ not supported yet
  1587. ***** ^ not supported yet
  1588. ***** ^ not supported yet
  1589. 735 GenLists.StrCode, TheList, ListSpot );
  1590. ***** ^ not supported yet
  1591. ***** ^ not supported yet
  1592. ***** ^ not supported yet
  1593. ***** ^ not supported yet
  1594. 736 VStorage.DosDealloc( tmpadr2, tmpsize + excess );
  1595. ***** ^ not supported yet
  1596. ***** ^ not supported yet
  1597. ***** ^ not supported yet
  1598. ***** ^ not supported yet
  1599. 737 END;
  1600. 738 END OverwriteElmt;
  1601. ***** ^ not supported yet
  1602. 739
  1603. 740
  1604. 741 PROCEDURE ObjectSpot( BinaryObject : ARRAY OF SYSTEM.BYTE;
  1605. ***** ^ not supported yet
  1606. 742 TheList : GenLists.GenList; StartingAt, EndingAt :
  1607. ***** ^ not supported yet
  1608. 743 CARDINAL) : CARDINAL;
  1609. 744 VAR
  1610. 745 cnt, ListEnd, ObjSize, TmpSize, TypeCode : CARDINAL;
  1611. 746 TmpAdr : SYSTEM.ADDRESS;
  1612. ***** ^ not supported yet
  1613. 747 BEGIN
  1614. 748 (*ObjectSpot*)
  1615. 749 ListEnd := GenLists.ListLength( TheList );
  1616. ***** ^ not supported yet
  1617. ***** ^ not supported yet
  1618. ***** ^ not supported yet
  1619. 750 IF ListEnd < EndingAt THEN
  1620. 751 EndingAt := ListEnd;
  1621. 752 END;
  1622. 753 IF StartingAt > EndingAt THEN
  1623. 754 RETURN 0;
  1624. 755 END;
  1625. 756 ObjSize := HIGH( BinaryObject ) + 1;
  1626. ***** ^ undeclared identifier
  1627. ***** ^ not supported yet
  1628. 757 FOR cnt := StartingAt TO EndingAt DO
  1629. 758 GenLists.GetElmtAdr( TheList, cnt, TmpAdr, TmpSize, TypeCode );
  1630. ***** ^ not supported yet
  1631. ***** ^ not supported yet
  1632. ***** ^ not supported yet
  1633. ***** ^ not supported yet
  1634. ***** ^ not supported yet
  1635. 759 IF TmpSize = ObjSize THEN
  1636. 760 IF PosUtils.PatternScan( SYSTEM.ADR(BinaryObject), ObjSize,
  1637. ***** ^ not supported yet
  1638. ***** ^ not supported yet
  1639. ***** ^ not supported yet
  1640. ***** ^ not supported yet
  1641. ***** ^ not supported yet
  1642. 761 TmpAdr, TmpSize ) = 0 THEN
  1643. ***** ^ not supported yet
  1644. ***** ^ not supported yet
  1645. 762 RETURN cnt;
  1646. 763 END;
  1647. 764 END;
  1648. 765 END;
  1649. 766 RETURN 0;
  1650. 767 (*BinaryObject not found between StartingAt and EndingAt.*)
  1651. 768 END ObjectSpot;
  1652. ***** ^ not supported yet
  1653. 769
  1654. 770
  1655. 771 PROCEDURE PrintList( fhandle: CARDINAL; TheList : GenLists.GenList;
  1656. ***** ^ not supported yet
  1657. 772 LeftMargin: CARDINAL; Separator: ARRAY OF CHAR );
  1658. ***** ^ not supported yet
  1659. 773
  1660. 774 PROCEDURE PrintRecursive( fhandle: CARDINAL; TheList :
  1661. 775 GenLists.GenList; Separator: ARRAY OF CHAR; InSubList:
  1662. ***** ^ not supported yet
  1663. ***** ^ not supported yet
  1664. 776 BOOLEAN );
  1665. 777 VAR
  1666. 778 SubLeader, TmpStr : ARRAY [0..80] OF CHAR;
  1667. ***** ^ not supported yet
  1668. ***** ^ not supported yet
  1669. 779 SubList : GenLists.GenList;
  1670. ***** ^ not supported yet
  1671. 780 TmpSiz, cnt, ListLen, TypeCode, spot : CARDINAL;
  1672. 781 FirstTime: BOOLEAN;
  1673. 782 TmpAdr: SYSTEM.ADDRESS;
  1674. ***** ^ not supported yet
  1675. 783
  1676. 784 BEGIN
  1677. 785 IF InSubList THEN
  1678. 786 StringIO.PrintMessage( HandleIO.FillFile( fhandle,
  1679. ***** ^ not supported yet
  1680. ***** ^ not supported yet
  1681. ***** ^ not supported yet
  1682. ***** ^ not supported yet
  1683. 787 LeftMargin, ' ' ) );
  1684. ***** ^ not supported yet
  1685. 788 StringIO.WriteStr( fhandle, '{' );
  1686. ***** ^ not supported yet
  1687. ***** ^ not supported yet
  1688. ***** ^ not supported yet
  1689. 789 END;
  1690. 790 FirstTime := TRUE;
  1691. 791 spot := 1;
  1692. 792 ListLen := GenLists.ListLength(TheList);
  1693. ***** ^ not supported yet
  1694. ***** ^ not supported yet
  1695. ***** ^ not supported yet
  1696. 793 IF GenLists.ErrorFlag # GenLists.NoListError THEN
  1697. ***** ^ not supported yet
  1698. ***** ^ not supported yet
  1699. ***** ^ not supported yet
  1700. ***** ^ not supported yet
  1701. 794 ErrorManager.WARN('Uninitialized list?');
  1702. ***** ^ not supported yet
  1703. ***** ^ not supported yet
  1704. ***** ^ not supported yet
  1705. 795 END;
  1706. 796 REPEAT
  1707. 797 IF spot<=ListLen THEN
  1708. 798 GenLists.GetElmtAdr( TheList, spot, TmpAdr, TmpSiz, TypeCode );
  1709. ***** ^ not supported yet
  1710. ***** ^ not supported yet
  1711. ***** ^ not supported yet
  1712. ***** ^ not supported yet
  1713. ***** ^ not supported yet
  1714. 799 IF TypeCode=GenLists.ListCode THEN
  1715. ***** ^ not supported yet
  1716. ***** ^ not supported yet
  1717. 800 GenLists.GetChildList(TheList, spot, SubList);
  1718. ***** ^ not supported yet
  1719. ***** ^ not supported yet
  1720. ***** ^ not supported yet
  1721. ***** ^ not supported yet
  1722. 801 PrintRecursive( fhandle, SubList, Separator, TRUE);
  1723. ***** ^ not supported yet
  1724. ***** ^ not supported yet
  1725. ***** ^ not supported yet
  1726. ***** ^ not supported yet
  1727. 802 ELSE
  1728. 803 IF FirstTime THEN
  1729. 804 FirstTime := FALSE;
  1730. 805 ELSE
  1731. 806 StringIO.WriteStr( fhandle, Separator );
  1732. ***** ^ not supported yet
  1733. ***** ^ not supported yet
  1734. ***** ^ not supported yet
  1735. 807 END;
  1736. 808 IF TypeCode = GenLists.StrCode THEN
  1737. ***** ^ not supported yet
  1738. ***** ^ not supported yet
  1739. 809 GetStr( TheList, spot, TmpStr );
  1740. ***** ^ not supported yet
  1741. ***** ^ not supported yet
  1742. ***** ^ not supported yet
  1743. 810 IF PosUtils.Present( Separator, TmpStr ) THEN
  1744. ***** ^ not supported yet
  1745. ***** ^ not supported yet
  1746. ***** ^ not supported yet
  1747. ***** ^ not supported yet
  1748. 811 StringIO.WriteStr( fhandle, '"' );
  1749. ***** ^ not supported yet
  1750. ***** ^ not supported yet
  1751. ***** ^ not supported yet
  1752. 812 StringIO.WriteStr( fhandle, TmpStr );
  1753. ***** ^ not supported yet
  1754. ***** ^ not supported yet
  1755. ***** ^ not supported yet
  1756. 813 StringIO.WriteStr( fhandle, '"' );
  1757. ***** ^ not supported yet
  1758. ***** ^ not supported yet
  1759. ***** ^ not supported yet
  1760. 814 ELSE
  1761. 815 StringIO.PrintMessage( HandleIO.FillFile( fhandle,
  1762. ***** ^ not supported yet
  1763. ***** ^ not supported yet
  1764. ***** ^ not supported yet
  1765. ***** ^ not supported yet
  1766. 816 LeftMargin, ' ' ) );
  1767. ***** ^ not supported yet
  1768. 817 StringIO.WriteStr( fhandle, TmpStr );
  1769. ***** ^ not supported yet
  1770. ***** ^ not supported yet
  1771. ***** ^ not supported yet
  1772. 818 END;
  1773. 819 ELSE
  1774. 820 StrConv.CardinalToStr( spot, 2, TmpStr );
  1775. ***** ^ not supported yet
  1776. ***** ^ not supported yet
  1777. ***** ^ not supported yet
  1778. 821 StringIO.PrintMessage( HandleIO.FillFile( fhandle,
  1779. ***** ^ not supported yet
  1780. ***** ^ not supported yet
  1781. ***** ^ not supported yet
  1782. ***** ^ not supported yet
  1783. 822 LeftMargin, ' ' ) );
  1784. ***** ^ not supported yet
  1785. 823 StringIO.WriteStr( fhandle, TmpStr );
  1786. ***** ^ not supported yet
  1787. ***** ^ not supported yet
  1788. ***** ^ not supported yet
  1789. 824 StringIO.WriteStr( fhandle, ': ' );
  1790. ***** ^ not supported yet
  1791. ***** ^ not supported yet
  1792. ***** ^ not supported yet
  1793. 825 StringIO.WriteStr( fhandle, 'Size = ' );
  1794. ***** ^ not supported yet
  1795. ***** ^ not supported yet
  1796. ***** ^ not supported yet
  1797. 826 StrConv.CardinalToStr( TmpSiz, 4, TmpStr );
  1798. ***** ^ not supported yet
  1799. ***** ^ not supported yet
  1800. ***** ^ not supported yet
  1801. 827 StringIO.WriteStr( fhandle, TmpStr );
  1802. ***** ^ not supported yet
  1803. ***** ^ not supported yet
  1804. ***** ^ not supported yet
  1805. 828 StringIO.WriteStr( fhandle, '; Type = ' );
  1806. ***** ^ not supported yet
  1807. ***** ^ not supported yet
  1808. ***** ^ not supported yet
  1809. 829 StrConv.CardinalToStr( TypeCode, 0, TmpStr );
  1810. ***** ^ not supported yet
  1811. ***** ^ not supported yet
  1812. ***** ^ not supported yet
  1813. 830 StringIO.WriteStr( fhandle, TmpStr );
  1814. ***** ^ not supported yet
  1815. ***** ^ not supported yet
  1816. ***** ^ not supported yet
  1817. 831 END;
  1818. 832 END;
  1819. 833 END;
  1820. 834 INC(spot);
  1821. ***** ^ undeclared identifier
  1822. ***** ^ not supported yet
  1823. 835 UNTIL spot>ListLen;
  1824. 836 IF InSubList THEN
  1825. 837 StringIO.WriteStr( fhandle, '}' );
  1826. ***** ^ not supported yet
  1827. ***** ^ not supported yet
  1828. ***** ^ not supported yet
  1829. 838 END;
  1830. 839 END PrintRecursive;
  1831. ***** ^ not supported yet
  1832. 840
  1833. 841 BEGIN (* PrintList *)
  1834. 842 PrintRecursive( fhandle, TheList, Separator, FALSE );
  1835. ***** ^ not supported yet
  1836. ***** ^ not supported yet
  1837. ***** ^ not supported yet
  1838. ***** ^ not supported yet
  1839. 843 (*We don't call PrintList itself recursively because we
  1840. 844 don't want the CrLf from the WriteEol below to follow
  1841. 845 embedded lists.*)
  1842. 846 StringIO.WriteEol( fhandle, '' );
  1843. ***** ^ not supported yet
  1844. ***** ^ not supported yet
  1845. ***** ^ not supported yet
  1846. 847 END PrintList;
  1847. ***** ^ not supported yet
  1848. 848
  1849. 849
  1850. 850 PROCEDURE TextFileToList( VAR TheFile: ARRAY OF CHAR;
  1851. ***** ^ not supported yet
  1852. 851 VAR TheList: GenLists.GenList): CARDINAL;
  1853. ***** ^ not supported yet
  1854. 852 (* finds the file, reads it into the list, closes the file *)
  1855. 853 VAR
  1856. 854 SizeLeft, SizeOK, DoSizeL : LONGINT;
  1857. 855 ResultErr: CARDINAL;
  1858. 856 NextList: GenLists.GenList;
  1859. ***** ^ not supported yet
  1860. 857 DoSizeC, TheHandl : CARDINAL;
  1861. 858 GoBack : INTEGER;
  1862. 859 buffer: SYSTEM.ADDRESS;
  1863. ***** ^ not supported yet
  1864. 860 BEGIN
  1865. 861 IF NOT GenLists.Initialized( TheList ) THEN
  1866. ***** ^ not supported yet
  1867. ***** ^ not supported yet
  1868. ***** ^ not supported yet
  1869. 862 InitResponse( 'TextFileToList' );
  1870. ***** ^ not supported yet
  1871. ***** ^ not supported yet
  1872. 863 END;
  1873. 864 ResultErr := HandleIO.FindFile( TheHandl, TheFile, 'PATH');
  1874. ***** ^ not supported yet
  1875. ***** ^ not supported yet
  1876. ***** ^ not supported yet
  1877. ***** ^ not supported yet
  1878. 865 IF StringIO.NoError # ResultErr THEN
  1879. ***** ^ not supported yet
  1880. ***** ^ not supported yet
  1881. 866 RETURN ResultErr;
  1882. 867 END;
  1883. 868 SizeLeft := HandleIO.FileLength( TheHandl);
  1884. ***** ^ not supported yet
  1885. ***** ^ not supported yet
  1886. ***** ^ not supported yet
  1887. 869 WHILE SizeLeft # Numbers.Lc( 0) DO
  1888. ***** ^ not supported yet
  1889. ***** ^ not supported yet
  1890. ***** ^ not supported yet
  1891. 870 (* first, get a mem block <= 65000 bytes *)
  1892. 871 DoSizeC := 65000;
  1893. 872 IF NOT VStorage.DosAvail( DoSizeC) THEN
  1894. ***** ^ not supported yet
  1895. ***** ^ not supported yet
  1896. ***** ^ not supported yet
  1897. 873 (* If there's not a 64K chunk available, get as much as there
  1898. 874 is.*)
  1899. 875 DoSizeC := EnvironUtils.MemAvail( 100);
  1900. ***** ^ not supported yet
  1901. ***** ^ not supported yet
  1902. ***** ^ not supported yet
  1903. 876 END;
  1904. 877 SizeOK := Numbers.Lc( DoSizeC);
  1905. ***** ^ not supported yet
  1906. ***** ^ not supported yet
  1907. ***** ^ not supported yet
  1908. 878 IF ( SizeLeft > SizeOK)
  1909. 879 AND ( Numbers.Lc( 64000) > SizeLeft) THEN
  1910. ***** ^ not supported yet
  1911. ***** ^ not supported yet
  1912. ***** ^ not supported yet
  1913. 880 GenLists.DisposeList( TheList );
  1914. ***** ^ not supported yet
  1915. ***** ^ not supported yet
  1916. ***** ^ not supported yet
  1917. 881 ResultErr := HandleIO.CloseHandle( TheHandl);
  1918. ***** ^ not supported yet
  1919. ***** ^ not supported yet
  1920. ***** ^ not supported yet
  1921. 882 RETURN StringIO.TooLittleMemory;
  1922. ***** ^ not supported yet
  1923. ***** ^ not supported yet
  1924. 883 END;
  1925. 884 IF SizeLeft > SizeOK THEN
  1926. 885 DoSizeL := SizeOK;
  1927. 886 ELSE
  1928. 887 DoSizeL := SizeLeft;
  1929. 888 END;
  1930. 889 SizeLeft := SizeLeft - DoSizeL;
  1931. 890 DoSizeC := Numbers.C( DoSizeL );
  1932. ***** ^ not supported yet
  1933. ***** ^ not supported yet
  1934. ***** ^ not supported yet
  1935. 891 IF NOT VStorage.DosAvail( DoSizeC ) THEN
  1936. ***** ^ not supported yet
  1937. ***** ^ not supported yet
  1938. ***** ^ not supported yet
  1939. 892 ResultErr := HandleIO.CloseHandle( TheHandl);
  1940. ***** ^ not supported yet
  1941. ***** ^ not supported yet
  1942. ***** ^ not supported yet
  1943. 893 RETURN StringIO.TooLittleMemory;
  1944. ***** ^ not supported yet
  1945. ***** ^ not supported yet
  1946. 894 END;
  1947. 895 VStorage.DosAlloc( buffer, DoSizeC );
  1948. ***** ^ not supported yet
  1949. ***** ^ not supported yet
  1950. ***** ^ not supported yet
  1951. ***** ^ not supported yet
  1952. 896 ResultErr := HandleIO.BlockRead( TheHandl, buffer, DoSizeC);
  1953. ***** ^ not supported yet
  1954. ***** ^ not supported yet
  1955. ***** ^ not supported yet
  1956. ***** ^ not supported yet
  1957. 897 IF StringIO.NoError # ResultErr THEN
  1958. ***** ^ not supported yet
  1959. ***** ^ not supported yet
  1960. 898 ResultErr := HandleIO.CloseHandle( TheHandl);
  1961. ***** ^ not supported yet
  1962. ***** ^ not supported yet
  1963. ***** ^ not supported yet
  1964. 899 RETURN ResultErr;
  1965. 900 END;
  1966. 901 IF SizeLeft # Numbers.Lc( 0) THEN
  1967. ***** ^ not supported yet
  1968. ***** ^ not supported yet
  1969. ***** ^ not supported yet
  1970. 902 GoBack := LowLevel.ScanEQ( -32000, 12C,
  1971. ***** ^ not supported yet
  1972. ***** ^ not supported yet
  1973. 903 LowLevel.AddAddr(buffer, DoSizeC - 1) );
  1974. ***** ^ not supported yet
  1975. ***** ^ not supported yet
  1976. ***** ^ not supported yet
  1977. ***** ^ not supported yet
  1978. 904 (* to locate a cut-ff line, look for the last
  1979. 905 line-feed character before the end of the block *)
  1980. 906 IF GoBack = -32000 THEN
  1981. 907 (* No LF found in last 32000 bytes of block *)
  1982. 908 ResultErr := HandleIO.CloseHandle( TheHandl);
  1983. ***** ^ not supported yet
  1984. ***** ^ not supported yet
  1985. ***** ^ not supported yet
  1986. 909 RETURN StringIO.BadData;
  1987. ***** ^ not supported yet
  1988. ***** ^ not supported yet
  1989. 910 END;
  1990. 911 DoSizeL := Numbers.Lc( -GoBack );
  1991. ***** ^ not supported yet
  1992. ***** ^ not supported yet
  1993. ***** ^ not supported yet
  1994. 912 SizeLeft := SizeLeft + DoSizeL;
  1995. 913 DoSizeL := -DoSizeL;
  1996. 914 HandleIO.SetFilePtr( TheHandl, HandleIO.FromCurrent, DoSizeL);
  1997. ***** ^ not supported yet
  1998. ***** ^ not supported yet
  1999. ***** ^ not supported yet
  2000. ***** ^ not supported yet
  2001. ***** ^ not supported yet
  2002. 915 (* change file position and counters to start from
  2003. 916 beginning of the line that was cut off *)
  2004. 917 END;
  2005. 918 GenLists.NewList( NextList );
  2006. ***** ^ not supported yet
  2007. ***** ^ not supported yet
  2008. ***** ^ not supported yet
  2009. 919 GenLists.BlockToList( buffer, DoSizeC, StringIO.CrLf,
  2010. ***** ^ not supported yet
  2011. ***** ^ not supported yet
  2012. ***** ^ not supported yet
  2013. ***** ^ not supported yet
  2014. ***** ^ not supported yet
  2015. 920 StringIO.CrLf, 0, GenLists.StrCode, NextList);
  2016. ***** ^ not supported yet
  2017. ***** ^ not supported yet
  2018. ***** ^ not supported yet
  2019. ***** ^ not supported yet
  2020. ***** ^ not supported yet
  2021. 921 GenLists.JoinLists( NextList, TheList, 65535);
  2022. ***** ^ not supported yet
  2023. ***** ^ not supported yet
  2024. ***** ^ not supported yet
  2025. ***** ^ not supported yet
  2026. ***** ^ not supported yet
  2027. 922 END;
  2028. 923 ResultErr := HandleIO.CloseHandle( TheHandl);
  2029. ***** ^ not supported yet
  2030. ***** ^ not supported yet
  2031. ***** ^ not supported yet
  2032. 924 RETURN ResultErr;
  2033. 925 END TextFileToList;
  2034. ***** ^ not supported yet
  2035. 926
  2036. 927
  2037. 928 PROCEDURE TextListToFile( VAR TheList: GenLists.GenList;
  2038. ***** ^ not supported yet
  2039. 929 TheFile: ARRAY OF CHAR): CARDINAL;
  2040. ***** ^ not supported yet
  2041. 930 (* creates the file; writes the list to it and closes file *)
  2042. 931 VAR
  2043. 932 StrAdr1, StrAdr2: SYSTEM.ADDRESS;
  2044. ***** ^ not supported yet
  2045. 933
  2046. 934 StrSize, DumType, SizeL, TheHandl, cnt: CARDINAL;
  2047. 935 ResultErr: CARDINAL;
  2048. 936 TmpCrLf: ARRAY [0..2] OF CHAR;
  2049. ***** ^ not supported yet
  2050. ***** ^ not supported yet
  2051. 937 BEGIN
  2052. 938 StrEdit.AssignStr( StringIO.CrLf, TmpCrLf );
  2053. ***** ^ not supported yet
  2054. ***** ^ not supported yet
  2055. ***** ^ not supported yet
  2056. ***** ^ not supported yet
  2057. ***** ^ not supported yet
  2058. 939 ResultErr := HandleIO.CreateFile( TheHandl, TheFile);
  2059. ***** ^ not supported yet
  2060. ***** ^ not supported yet
  2061. ***** ^ not supported yet
  2062. 940 IF StringIO.NoError # ResultErr THEN
  2063. ***** ^ not supported yet
  2064. ***** ^ not supported yet
  2065. 941 RETURN ResultErr;
  2066. 942 END;
  2067. 943 SizeL := GenLists.ListLength( TheList);
  2068. ***** ^ not supported yet
  2069. ***** ^ not supported yet
  2070. ***** ^ not supported yet
  2071. 944 FOR cnt := 1 TO SizeL DO
  2072. 945 GenLists.GetElmtAdr( TheList, cnt, StrAdr1, StrSize, DumType);
  2073. ***** ^ not supported yet
  2074. ***** ^ not supported yet
  2075. ***** ^ not supported yet
  2076. ***** ^ not supported yet
  2077. ***** ^ not supported yet
  2078. 946 StrSize := LowLevel.ScanEQ( StrSize, 0C, StrAdr1 );
  2079. ***** ^ not supported yet
  2080. ***** ^ not supported yet
  2081. ***** ^ not supported yet
  2082. 947 (* Reduce StrSize to number of bytes before the null. *)
  2083. 948 VStorage.DosAlloc( StrAdr2, StrSize + 2 );
  2084. ***** ^ not supported yet
  2085. ***** ^ not supported yet
  2086. ***** ^ not supported yet
  2087. ***** ^ not supported yet
  2088. 949 LowLevel.Move( StrAdr1, StrAdr2, StrSize );
  2089. ***** ^ not supported yet
  2090. ***** ^ not supported yet
  2091. ***** ^ not supported yet
  2092. ***** ^ not supported yet
  2093. ***** ^ not supported yet
  2094. 950 LowLevel.Move( SYSTEM.ADR(TmpCrLf),
  2095. ***** ^ not supported yet
  2096. ***** ^ not supported yet
  2097. ***** ^ not supported yet
  2098. ***** ^ not supported yet
  2099. ***** ^ not supported yet
  2100. 951 LowLevel.AddAddr(StrAdr2, StrSize), 2 );
  2101. ***** ^ not supported yet
  2102. ***** ^ not supported yet
  2103. ***** ^ not supported yet
  2104. ***** ^ not supported yet
  2105. ***** ^ not supported yet
  2106. 952 ResultErr := HandleIO.BlockWrite( TheHandl,
  2107. ***** ^ not supported yet
  2108. ***** ^ not supported yet
  2109. 953 StrAdr2, StrSize + 2 );
  2110. ***** ^ not supported yet
  2111. ***** ^ not supported yet
  2112. 954 VStorage.DosDealloc( StrAdr2, StrSize + 2 );
  2113. ***** ^ not supported yet
  2114. ***** ^ not supported yet
  2115. ***** ^ not supported yet
  2116. ***** ^ not supported yet
  2117. 955 IF StringIO.NoError # ResultErr THEN
  2118. ***** ^ not supported yet
  2119. ***** ^ not supported yet
  2120. 956 RETURN ResultErr;
  2121. 957 END;
  2122. 958 END;
  2123. 959 ResultErr := HandleIO.CloseHandle( TheHandl);
  2124. ***** ^ not supported yet
  2125. ***** ^ not supported yet
  2126. ***** ^ not supported yet
  2127. 960 RETURN ResultErr;
  2128. 961 END TextListToFile;
  2129. ***** ^ not supported yet
  2130. 962
  2131. 963
  2132. 964 PROCEDURE TypeCheck( TheList: GenLists.GenList; spot: CARDINAL ): CARDINAL;
  2133. ***** ^ not supported yet
  2134. 965 VAR
  2135. 966 DumAddr: SYSTEM.ADDRESS;
  2136. ***** ^ not supported yet
  2137. 967 TheSize, TypeCode: CARDINAL;
  2138. 968 BEGIN
  2139. 969 GenLists.GetElmtAdr( TheList, spot, DumAddr, TheSize, TypeCode );
  2140. ***** ^ not supported yet
  2141. ***** ^ not supported yet
  2142. ***** ^ not supported yet
  2143. ***** ^ not supported yet
  2144. ***** ^ not supported yet
  2145. 970 RETURN TypeCode;
  2146. 971 END TypeCheck;
  2147. ***** ^ not supported yet
  2148. 972
  2149. 973
  2150. 974 BEGIN
  2151. 975 Initialized := FALSE;
  2152. 976 Init();
  2153. ***** ^ not supported yet
  2154. ***** ^ not supported yet
  2155. 977 END ListUtils.
  2156. ***** ^ not supported yet
  2157. 1178 errors