STREDIT.LST 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. Listing:
  2. 1 IMPLEMENTATION MODULE StrEdit;
  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/stredit.mov 1.7 17 Mar 1991 17:58:52 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15 IMPORT LowLevel;
  17. 16 IMPORT M2Strings;
  18. 17 IMPORT Numbers;
  19. 18 IMPORT ScanUtils;
  20. 19 IMPORT SYSTEM;
  21. 20
  22. 21 VAR
  23. 22 Initialized : BOOLEAN;
  24. 23
  25. 24 PROCEDURE Init();
  26. 25 BEGIN
  27. 26 IF Initialized THEN
  28. 27 RETURN;
  29. 28 ELSE
  30. 29 Initialized := TRUE;
  31. 30 END;
  32. 31 LowLevel.Init();
  33. ***** ^ not supported yet
  34. ***** ^ not supported yet
  35. ***** ^ not supported yet
  36. 32 M2Strings.Init();
  37. ***** ^ not supported yet
  38. ***** ^ not supported yet
  39. ***** ^ not supported yet
  40. 33 Numbers.Init();
  41. ***** ^ not supported yet
  42. ***** ^ not supported yet
  43. ***** ^ not supported yet
  44. 34 ScanUtils.Init();
  45. ***** ^ not supported yet
  46. ***** ^ not supported yet
  47. ***** ^ not supported yet
  48. 35 END Init;
  49. ***** ^ not supported yet
  50. 36
  51. 37
  52. 38 CONST
  53. 39 BLANK = ' ';
  54. 40 TAB = 11C;
  55. 41
  56. 42 PROCEDURE AssignStr(instr : ARRAY OF CHAR; VAR outstr : ARRAY OF CHAR);
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. 43 (*Allows assignment of constants to strings; Logitech's Assign has
  60. 44 two VAR parameters. Changed 24 May 87 to use HIGH instead
  61. 45 of SYSTEM.SIZE because M2SDS's SIZE returns incorrect results.*)
  62. 46 VAR
  63. 47 insize, outsize : CARDINAL;
  64. 48 BEGIN
  65. 49 insize := 1+HIGH(instr);
  66. ***** ^ undeclared identifier
  67. ***** ^ not supported yet
  68. 50 outsize := 1+HIGH(outstr);
  69. ***** ^ undeclared identifier
  70. ***** ^ not supported yet
  71. 51 IF insize>outsize THEN
  72. 52 LowLevel.Move(SYSTEM.ADR(instr), SYSTEM.ADR(outstr), outsize);
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. ***** ^ not supported yet
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. 53 ELSE
  83. 54 LowLevel.Move(SYSTEM.ADR(instr), SYSTEM.ADR(outstr), insize);
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. 55 SetLength(outstr, M2Strings.Length(instr));
  94. ***** ^ undeclared identifier
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. 56 END;
  100. 57 END AssignStr;
  101. ***** ^ not supported yet
  102. 58
  103. 59 PROCEDURE Append( VAR TheStr: ARRAY OF CHAR; AppStr: ARRAY OF CHAR);
  104. ***** ^ not supported yet
  105. ***** ^ not supported yet
  106. 60 VAR
  107. 61 HighAppStr, leng, leng2: CARDINAL;
  108. 62 BEGIN
  109. 63 HighAppStr := HIGH(AppStr);
  110. ***** ^ undeclared identifier
  111. ***** ^ not supported yet
  112. 64 (* Exposes a nasty bug in Stony Brook M2. *)
  113. 65 leng := M2Strings.Length(TheStr);
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. 66 leng2 := Numbers.Min(M2Strings.Length(AppStr), (HIGH(TheStr)+1-leng));
  118. ***** ^ not supported yet
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. ***** ^ undeclared identifier
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. 67 IF leng2 > 0 THEN
  127. 68 LowLevel.Move(SYSTEM.ADR(AppStr), SYSTEM.ADR(TheStr[leng]), leng2);
  128. ***** ^ not supported yet
  129. ***** ^ not supported yet
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. ***** ^ not supported yet
  134. ***** ^ not supported yet
  135. ***** ^ not supported yet
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. 69 INC(leng, leng2);
  139. ***** ^ undeclared identifier
  140. ***** ^ not supported yet
  141. 70 IF leng <= HIGH(TheStr) THEN
  142. ***** ^ undeclared identifier
  143. ***** ^ not supported yet
  144. 71 TheStr[leng] := 0C;
  145. ***** ^ not supported yet
  146. ***** ^ not supported yet
  147. 72 END;
  148. 73 END;
  149. 74 END Append;
  150. ***** ^ not supported yet
  151. 75
  152. 76 PROCEDURE ReplaceTabs(VAR TheStr : ARRAY OF CHAR; tabInterval: CARDINAL);
  153. ***** ^ not supported yet
  154. 77 VAR
  155. 78 cnt, tabspot, offsetToNextTabStop : CARDINAL;
  156. 79 tabstr : ARRAY [0..15] OF CHAR;
  157. ***** ^ not supported yet
  158. ***** ^ not supported yet
  159. 80 BEGIN
  160. 81 tabspot := M2Strings.Pos(TAB, TheStr);
  161. ***** ^ not supported yet
  162. ***** ^ not supported yet
  163. ***** ^ not supported yet
  164. 82 WHILE (tabspot<=HIGH(TheStr)) DO
  165. ***** ^ undeclared identifier
  166. ***** ^ not supported yet
  167. 83 M2Strings.Delete(TheStr, tabspot, 1);
  168. ***** ^ not supported yet
  169. ***** ^ not supported yet
  170. ***** ^ not supported yet
  171. ***** ^ not supported yet
  172. 84 LowLevel.Fill( SYSTEM.ADR(tabstr), 16, BLANK );
  173. ***** ^ not supported yet
  174. ***** ^ not supported yet
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. 85 offsetToNextTabStop := tabInterval - (tabspot MOD tabInterval);
  180. 86 tabstr[offsetToNextTabStop] := 0C;
  181. ***** ^ not supported yet
  182. ***** ^ not supported yet
  183. 87 M2Strings.Insert(tabstr, TheStr, tabspot);
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. ***** ^ not supported yet
  188. ***** ^ not supported yet
  189. 88 tabspot := M2Strings.Pos(TAB, TheStr);
  190. ***** ^ not supported yet
  191. ***** ^ not supported yet
  192. ***** ^ not supported yet
  193. 89 END;
  194. 90 END ReplaceTabs;
  195. ***** ^ not supported yet
  196. 91
  197. 92 PROCEDURE tabStop(thespot : CARDINAL; tabInterval: CARDINAL) : BOOLEAN;
  198. 93 BEGIN
  199. 94 RETURN (((thespot MOD tabInterval) = 0) AND (thespot # 0));
  200. 95 END tabStop;
  201. ***** ^ not supported yet
  202. 96
  203. 97 PROCEDURE InsertTabs(VAR TheStr : ARRAY OF CHAR; tabInterval: CARDINAL;
  204. ***** ^ not supported yet
  205. 98 leadingOnly: BOOLEAN);
  206. 99 VAR
  207. 100 index, leng, spaceStrLngth, tabStrLngth : CARDINAL;
  208. 101 spacestr : ARRAY [0..79] OF CHAR;
  209. ***** ^ not supported yet
  210. ***** ^ not supported yet
  211. 102 tabstr : ARRAY [0..15] OF CHAR;
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 103 newstr : ARRAY [0..255] OF CHAR;
  215. ***** ^ not supported yet
  216. ***** ^ not supported yet
  217. 104 nonBlankFound: BOOLEAN;
  218. 105
  219. 106 BEGIN
  220. 107 (*InsertTabs*)
  221. 108 ReplaceTabs(TheStr, tabInterval);
  222. ***** ^ not supported yet
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. 109 (* We don't want to have to deal with the complication of tabs
  226. 110 * already in TheStr, so we start by expanding them to blanks.
  227. 111 *)
  228. 112 leng := M2Strings.Length(TheStr);
  229. ***** ^ not supported yet
  230. ***** ^ not supported yet
  231. ***** ^ not supported yet
  232. 113 IF leng = 0 THEN
  233. 114 RETURN;
  234. 115 END;
  235. 116 DEC(leng);
  236. ***** ^ undeclared identifier
  237. ***** ^ not supported yet
  238. 117 spacestr := '';
  239. ***** ^ not supported yet
  240. ***** ^ incompatible assignment
  241. 118 spaceStrLngth := 0;
  242. 119 tabstr := '';
  243. ***** ^ not supported yet
  244. ***** ^ incompatible assignment
  245. 120 tabStrLngth := 0;
  246. 121 newstr := '';
  247. ***** ^ not supported yet
  248. ***** ^ incompatible assignment
  249. 122 nonBlankFound := FALSE;
  250. 123
  251. 124 FOR index := 0 TO leng DO
  252. 125 IF NOT (leadingOnly AND nonBlankFound) THEN
  253. 126 IF tabStop(index, tabInterval) AND (spaceStrLngth > 1) THEN
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. 127 Append(tabstr, TAB);
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. 128 INC(tabStrLngth);
  261. ***** ^ undeclared identifier
  262. ***** ^ not supported yet
  263. 129 IF (spaceStrLngth > tabInterval) THEN
  264. 130 (* What's happened here is that we had a single space
  265. 131 * immediately preceding a tab stop before this last
  266. 132 * run of spaces. We refused to replace it with a
  267. 133 * tab because we had only one space to replace it
  268. 134 * with. Now, however, we see that something has to
  269. 135 * go there -- could either be a space or a tab. We
  270. 136 * choose a tab.
  271. 137 *)
  272. 138 Append(tabstr, TAB);
  273. ***** ^ not supported yet
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. 139 INC(tabStrLngth);
  277. ***** ^ undeclared identifier
  278. ***** ^ not supported yet
  279. 140 END;
  280. 141 spacestr := '';
  281. ***** ^ not supported yet
  282. ***** ^ incompatible assignment
  283. 142 spaceStrLngth := 0;
  284. 143 END;
  285. 144 IF TheStr[index]=BLANK THEN
  286. ***** ^ not supported yet
  287. ***** ^ not supported yet
  288. 145 Append(spacestr, BLANK);
  289. ***** ^ not supported yet
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. 146 INC(spaceStrLngth);
  293. ***** ^ undeclared identifier
  294. ***** ^ not supported yet
  295. 147 END;
  296. 148 IF tabStrLngth > 0 THEN
  297. 149 Append(newstr, tabstr);
  298. ***** ^ not supported yet
  299. ***** ^ not supported yet
  300. ***** ^ not supported yet
  301. 150 tabstr := '';
  302. ***** ^ not supported yet
  303. ***** ^ incompatible assignment
  304. 151 tabStrLngth := 0;
  305. 152 END;
  306. 153 IF (spaceStrLngth > 0) AND (TheStr[index] # BLANK) THEN
  307. ***** ^ not supported yet
  308. ***** ^ not supported yet
  309. 154 (* We've hit a nonblank and we're not at a tabstop, so we're
  310. 155 * not going to get to replace this last sequence of blanks
  311. 156 * with a tab.
  312. 157 *)
  313. 158 Append(newstr, spacestr);
  314. ***** ^ not supported yet
  315. ***** ^ not supported yet
  316. ***** ^ not supported yet
  317. 159 spacestr := '';
  318. ***** ^ not supported yet
  319. ***** ^ incompatible assignment
  320. 160 spaceStrLngth := 0;
  321. 161 END;
  322. 162 END;
  323. 163 IF (TheStr[index] # BLANK) OR (leadingOnly AND nonBlankFound) THEN
  324. ***** ^ not supported yet
  325. ***** ^ not supported yet
  326. 164 Append(newstr, TheStr[index]);
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. ***** ^ not supported yet
  331. 165 nonBlankFound := TRUE;
  332. 166 END;
  333. 167 END;
  334. 168 AssignStr(newstr, TheStr);
  335. ***** ^ not supported yet
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. 169 END InsertTabs;
  339. ***** ^ not supported yet
  340. 170
  341. 171 PROCEDURE InsertTimes(Ch : CHAR; VAR TheStr : ARRAY OF CHAR; indx,
  342. ***** ^ not supported yet
  343. 172 times : CARDINAL);
  344. 173 VAR
  345. 174 cnt : CARDINAL;
  346. 175 BEGIN
  347. 176 IF times = 0 THEN RETURN END;
  348. 177 LowLevel.ShiftArrayRight( SYSTEM.ADR(TheStr[indx]), (HIGH(TheStr) + 1) -
  349. ***** ^ not supported yet
  350. ***** ^ not supported yet
  351. ***** ^ not supported yet
  352. ***** ^ not supported yet
  353. ***** ^ not supported yet
  354. ***** ^ not supported yet
  355. ***** ^ undeclared identifier
  356. ***** ^ not supported yet
  357. 178 indx, times );
  358. ***** ^ not supported yet
  359. 179 FOR cnt := 1 TO times DO
  360. 180 TheStr[ indx + cnt - 1 ] := Ch;
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. 181 END;
  364. 182 END InsertTimes;
  365. ***** ^ not supported yet
  366. 183
  367. 184
  368. 185 PROCEDURE InsertSubstr(str1 : ARRAY OF CHAR; start, lnth :
  369. ***** ^ not supported yet
  370. 186 CARDINAL; VAR str2 : ARRAY OF CHAR; ndx : CARDINAL);
  371. ***** ^ not supported yet
  372. 187 VAR
  373. 188 tmpstr : ARRAY [0..255] OF CHAR;
  374. ***** ^ not supported yet
  375. ***** ^ not supported yet
  376. 189 BEGIN
  377. 190 M2Strings.Copy(str1, start, lnth, tmpstr);
  378. ***** ^ not supported yet
  379. ***** ^ not supported yet
  380. ***** ^ not supported yet
  381. ***** ^ not supported yet
  382. 191 M2Strings.Insert(tmpstr, str2, ndx);
  383. ***** ^ not supported yet
  384. ***** ^ not supported yet
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. ***** ^ not supported yet
  388. 192 END InsertSubstr;
  389. ***** ^ not supported yet
  390. 193
  391. 194 PROCEDURE OverWrite(obj : ARRAY OF CHAR; VAR targ : ARRAY OF
  392. ***** ^ not supported yet
  393. 195 CHAR; pos : CARDINAL);
  394. ***** ^ not supported yet
  395. 196 (*Unconditionally writes obj into targ beginning at pos, and for the length of
  396. 197 obj, wipes out anything that may have been in targ at that position.*)
  397. 198 VAR
  398. 199 max, i : CARDINAL;
  399. 200 BEGIN
  400. 201 max := M2Strings.Length(obj);
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. ***** ^ not supported yet
  404. 202 IF max = 0 THEN RETURN END;
  405. 203 (* bug fix submitted by Henk Hofmans, 8 Feb 87 *)
  406. 204 IF (max>15) OR ((max+pos) > M2Strings.Length(targ)) THEN
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. ***** ^ not supported yet
  410. 205 (*This test is only for optimization purposes.*)
  411. 206 M2Strings.Delete(targ, pos, M2Strings.Length(obj));
  412. ***** ^ not supported yet
  413. ***** ^ not supported yet
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. ***** ^ not supported yet
  417. ***** ^ not supported yet
  418. 207 M2Strings.Insert(obj, targ, pos);
  419. ***** ^ not supported yet
  420. ***** ^ not supported yet
  421. ***** ^ not supported yet
  422. ***** ^ not supported yet
  423. ***** ^ not supported yet
  424. 208 ELSE
  425. 209 FOR i := 0 TO (max-1) DO
  426. 210 targ[pos+i] := obj[i];
  427. ***** ^ not supported yet
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. 211 END;
  432. 212 END;
  433. 213 END OverWrite;
  434. ***** ^ not supported yet
  435. 214
  436. 215
  437. 216 PROCEDURE ReplaceStr(
  438. 217 searchstr, replacstr : ARRAY OF CHAR;
  439. ***** ^ not supported yet
  440. 218 VAR TheStr : ARRAY OF CHAR);
  441. ***** ^ not supported yet
  442. 219 VAR
  443. 220 spot, lngth1, lngth2 : CARDINAL;
  444. 221 repeating: BOOLEAN;
  445. 222 BEGIN
  446. 223 lngth1 := M2Strings.Length( searchstr );
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. ***** ^ not supported yet
  450. 224 lngth2 := M2Strings.Length( replacstr );
  451. ***** ^ not supported yet
  452. ***** ^ not supported yet
  453. ***** ^ not supported yet
  454. 225 spot := ScanUtils.Positn( searchstr, replacstr, 0, ScanUtils.CaseSens );
  455. ***** ^ not supported yet
  456. ***** ^ not supported yet
  457. ***** ^ not supported yet
  458. ***** ^ not supported yet
  459. ***** ^ not supported yet
  460. ***** ^ not supported yet
  461. 226 repeating := spot > HIGH(replacstr);
  462. ***** ^ undeclared identifier
  463. ***** ^ not supported yet
  464. 227 (* If repeating = FALSE, then the old string is embedded
  465. 228 in the new string, and we'll get hung in an infinite
  466. 229 loop if we try to replace all instances of the old
  467. 230 string. *)
  468. 231 spot := ScanUtils.Positn( searchstr, TheStr, 0, ScanUtils.CaseSens );
  469. ***** ^ not supported yet
  470. ***** ^ not supported yet
  471. ***** ^ not supported yet
  472. ***** ^ not supported yet
  473. ***** ^ not supported yet
  474. ***** ^ not supported yet
  475. 232 WHILE spot<=HIGH(TheStr) DO
  476. ***** ^ undeclared identifier
  477. ***** ^ not supported yet
  478. 233 M2Strings.Delete(TheStr, spot, lngth1);
  479. ***** ^ not supported yet
  480. ***** ^ not supported yet
  481. ***** ^ not supported yet
  482. ***** ^ not supported yet
  483. 234 M2Strings.Insert(replacstr, TheStr, spot);
  484. ***** ^ not supported yet
  485. ***** ^ not supported yet
  486. ***** ^ not supported yet
  487. ***** ^ not supported yet
  488. ***** ^ not supported yet
  489. 235 IF repeating THEN
  490. 236 spot := ScanUtils.Positn( searchstr, TheStr, 0,
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. ***** ^ not supported yet
  494. ***** ^ not supported yet
  495. 237 ScanUtils.CaseSens );
  496. ***** ^ not supported yet
  497. ***** ^ not supported yet
  498. 238 ELSE
  499. 239 spot := ScanUtils.Positn( searchstr, TheStr, spot + lngth2,
  500. ***** ^ not supported yet
  501. ***** ^ not supported yet
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. 240 ScanUtils.CaseSens );
  505. ***** ^ not supported yet
  506. ***** ^ not supported yet
  507. 241 END;
  508. 242 END;
  509. 243 END ReplaceStr;
  510. ***** ^ not supported yet
  511. 244
  512. 245
  513. 246 PROCEDURE ReplaceStrInsens(
  514. 247 searchstr, replacstr : ARRAY OF CHAR;
  515. ***** ^ not supported yet
  516. 248 VAR TheStr : ARRAY OF CHAR);
  517. ***** ^ not supported yet
  518. 249 VAR
  519. 250 spot, lngth1, lngth2 : CARDINAL;
  520. 251 repeating: BOOLEAN;
  521. 252 BEGIN
  522. 253 lngth1 := M2Strings.Length( searchstr );
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. ***** ^ not supported yet
  526. 254 lngth2 := M2Strings.Length( replacstr );
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. ***** ^ not supported yet
  530. 255 spot := ScanUtils.Positn( searchstr, replacstr, 0,
  531. ***** ^ not supported yet
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. ***** ^ not supported yet
  535. 256 ScanUtils.CaseInsens );
  536. ***** ^ not supported yet
  537. ***** ^ not supported yet
  538. 257 repeating := spot > HIGH(replacstr);
  539. ***** ^ undeclared identifier
  540. ***** ^ not supported yet
  541. 258 (* If repeating = FALSE, then the old string is embedded
  542. 259 in the new string, and we'll get hung in an infinite
  543. 260 loop if we try to replace all instances of the old
  544. 261 string. *)
  545. 262 spot := ScanUtils.Positn( searchstr, TheStr, 0,
  546. ***** ^ not supported yet
  547. ***** ^ not supported yet
  548. ***** ^ not supported yet
  549. ***** ^ not supported yet
  550. 263 ScanUtils.CaseInsens );
  551. ***** ^ not supported yet
  552. ***** ^ not supported yet
  553. 264 WHILE spot<=HIGH(TheStr) DO
  554. ***** ^ undeclared identifier
  555. ***** ^ not supported yet
  556. 265 M2Strings.Delete(TheStr, spot, lngth1);
  557. ***** ^ not supported yet
  558. ***** ^ not supported yet
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. 266 M2Strings.Insert(replacstr, TheStr, spot);
  562. ***** ^ not supported yet
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. ***** ^ not supported yet
  566. ***** ^ not supported yet
  567. 267 IF repeating THEN
  568. 268 spot := ScanUtils.Positn( searchstr, TheStr, 0,
  569. ***** ^ not supported yet
  570. ***** ^ not supported yet
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. 269 ScanUtils.CaseInsens );
  574. ***** ^ not supported yet
  575. ***** ^ not supported yet
  576. 270 ELSE
  577. 271 spot := ScanUtils.Positn( searchstr, TheStr, spot + lngth2,
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. ***** ^ not supported yet
  581. ***** ^ not supported yet
  582. 272 ScanUtils.CaseInsens );
  583. ***** ^ not supported yet
  584. ***** ^ not supported yet
  585. 273 END;
  586. 274 END;
  587. 275 END ReplaceStrInsens;
  588. ***** ^ not supported yet
  589. 276
  590. 277
  591. 278 PROCEDURE CrunchBlanks(VAR line : ARRAY OF CHAR);
  592. ***** ^ not supported yet
  593. 279 VAR
  594. 280 LastNotBlank : BOOLEAN;
  595. 281 LengthOfLine, ResultIndex, index, LeftOvers : CARDINAL;
  596. 282 BEGIN
  597. 283 ReplaceTabs(line, 8);
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. 284 LastNotBlank := FALSE;
  602. 285 LengthOfLine := M2Strings.Length(line);
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. ***** ^ not supported yet
  606. 286 IF LengthOfLine = 0 THEN
  607. 287 RETURN;
  608. 288 END;
  609. 289 ResultIndex := 0;
  610. 290 FOR index := 0 TO (LengthOfLine-1) DO
  611. 291 IF line[index]<>BLANK THEN
  612. ***** ^ not supported yet
  613. ***** ^ not supported yet
  614. 292 LastNotBlank := TRUE;
  615. 293 line[ResultIndex] := line[index];
  616. ***** ^ not supported yet
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. 294 INC(ResultIndex);
  621. ***** ^ undeclared identifier
  622. ***** ^ not supported yet
  623. 295 ELSIF LastNotBlank THEN
  624. 296 LastNotBlank := FALSE;
  625. 297 line[ResultIndex] := line[index];
  626. ***** ^ not supported yet
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. ***** ^ not supported yet
  630. 298 INC(ResultIndex);
  631. ***** ^ undeclared identifier
  632. ***** ^ not supported yet
  633. 299 END;
  634. 300 END;
  635. 301 IF (ResultIndex>0) AND (line[ResultIndex-1]=BLANK) THEN
  636. ***** ^ not supported yet
  637. ***** ^ not supported yet
  638. 302 DEC(ResultIndex);
  639. ***** ^ undeclared identifier
  640. ***** ^ not supported yet
  641. 303 END;
  642. 304 LeftOvers := LengthOfLine-ResultIndex;
  643. 305 IF LeftOvers>0 THEN
  644. 306 M2Strings.Delete(line, ResultIndex, LeftOvers);
  645. ***** ^ not supported yet
  646. ***** ^ not supported yet
  647. ***** ^ not supported yet
  648. ***** ^ not supported yet
  649. 307 END;
  650. 308 END CrunchBlanks;
  651. ***** ^ not supported yet
  652. 309
  653. 310 PROCEDURE CutLeadingChars(TheChar : CHAR; VAR TheStr : ARRAY OF
  654. 311 CHAR);
  655. ***** ^ not supported yet
  656. 312 (*deletes any TheChar's at the start of TheStr*)
  657. 313 VAR
  658. 314 NonMatchFound : BOOLEAN;
  659. 315 ndx, StrLen : CARDINAL;
  660. 316 BEGIN
  661. 317 StrLen := M2Strings.Length(TheStr);
  662. ***** ^ not supported yet
  663. ***** ^ not supported yet
  664. ***** ^ not supported yet
  665. 318 IF StrLen=0 THEN
  666. 319 RETURN;
  667. 320 END;
  668. 321 ndx := 0;
  669. 322 IF (TheStr[ndx]=TheChar) THEN
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. 323 NonMatchFound := FALSE;
  673. 324 WHILE ((ndx + 1) < StrLen) AND (NOT NonMatchFound) DO
  674. 325 INC(ndx);
  675. ***** ^ undeclared identifier
  676. ***** ^ not supported yet
  677. 326 NonMatchFound := TheStr[ndx]#TheChar;
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. 327 END;
  681. 328 IF NOT NonMatchFound THEN
  682. 329 INC(ndx);
  683. ***** ^ undeclared identifier
  684. ***** ^ not supported yet
  685. 330 END;
  686. 331 M2Strings.Delete(TheStr, 0, ndx);
  687. ***** ^ not supported yet
  688. ***** ^ not supported yet
  689. ***** ^ not supported yet
  690. ***** ^ not supported yet
  691. 332 END;
  692. 333 END CutLeadingChars;
  693. ***** ^ not supported yet
  694. 334
  695. 335 PROCEDURE CutTrailingChars(TheChar : CHAR; VAR TheStr : ARRAY
  696. 336 OF CHAR);
  697. ***** ^ not supported yet
  698. 337 (*deletes any TheChar's at the end of TheStr*)
  699. 338 VAR
  700. 339 index : CARDINAL;
  701. 340 BEGIN
  702. 341 index := M2Strings.Length(TheStr);
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. 342 IF index > 0 THEN
  707. 343 LOOP
  708. 344 IF TheStr[ index - 1] = TheChar THEN
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. 345 DEC(index);
  712. ***** ^ undeclared identifier
  713. ***** ^ not supported yet
  714. 346 IF index = 0 THEN
  715. 347 TheStr[0] := 0C;
  716. ***** ^ not supported yet
  717. ***** ^ not supported yet
  718. 348 RETURN;
  719. 349 END;
  720. 350 ELSIF index <= HIGH(TheStr) THEN
  721. ***** ^ undeclared identifier
  722. ***** ^ not supported yet
  723. 351 TheStr[index] := 0C;
  724. ***** ^ not supported yet
  725. ***** ^ not supported yet
  726. 352 RETURN;
  727. 353 ELSE
  728. 354 RETURN;
  729. 355 END;
  730. 356 END;
  731. 357 END;
  732. 358 END CutTrailingChars;
  733. ***** ^ not supported yet
  734. 359
  735. 360 PROCEDURE LowerStr(VAR TheStr : ARRAY OF CHAR);
  736. ***** ^ not supported yet
  737. 361 VAR
  738. 362 pointer, leng : CARDINAL;
  739. 363 CONST
  740. 364 shiftdown = 32;
  741. 365 BEGIN
  742. 366 leng := M2Strings.Length(TheStr);
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 367 IF leng = 0 THEN
  747. 368 RETURN;
  748. 369 END;
  749. 370 DEC( leng);
  750. ***** ^ undeclared identifier
  751. ***** ^ not supported yet
  752. 371 FOR pointer := 0 TO leng DO
  753. 372 IF (TheStr[pointer]>='A') AND (TheStr[pointer]<='Z') THEN
  754. ***** ^ not supported yet
  755. ***** ^ not supported yet
  756. ***** ^ not supported yet
  757. ***** ^ not supported yet
  758. 373 TheStr[pointer] := CHR( ORD(TheStr[pointer]) + shiftdown);
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. ***** ^ undeclared identifier
  762. ***** ^ undeclared identifier
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. ***** ^ not supported yet
  766. 374 END;
  767. 375 END;
  768. 376 END LowerStr;
  769. ***** ^ not supported yet
  770. 377
  771. 378 PROCEDURE CAPstr(VAR TheStr : ARRAY OF CHAR);
  772. ***** ^ not supported yet
  773. 379 VAR
  774. 380 pointer, leng : CARDINAL;
  775. 381 CONST
  776. 382 shiftdown = 32;
  777. 383 BEGIN
  778. 384 leng := M2Strings.Length(TheStr);
  779. ***** ^ not supported yet
  780. ***** ^ not supported yet
  781. ***** ^ not supported yet
  782. 385 IF leng = 0 THEN
  783. 386 RETURN;
  784. 387 END;
  785. 388 DEC( leng);
  786. ***** ^ undeclared identifier
  787. ***** ^ not supported yet
  788. 389 FOR pointer := 0 TO leng DO
  789. 390 TheStr[pointer] := CAP(TheStr[pointer]);
  790. ***** ^ not supported yet
  791. ***** ^ not supported yet
  792. ***** ^ undeclared identifier
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. 391 END;
  796. 392 END CAPstr;
  797. ***** ^ not supported yet
  798. 393
  799. 394 PROCEDURE DeleteChar(TheChar : CHAR; VAR x : ARRAY OF CHAR);
  800. ***** ^ not supported yet
  801. 395 VAR
  802. 396 spot : CARDINAL;
  803. 397 BEGIN
  804. 398 spot := M2Strings.Pos(TheChar, x);
  805. ***** ^ not supported yet
  806. ***** ^ not supported yet
  807. ***** ^ not supported yet
  808. 399 WHILE spot<=HIGH(x) DO
  809. ***** ^ undeclared identifier
  810. ***** ^ not supported yet
  811. 400 M2Strings.Delete(x, spot, 1);
  812. ***** ^ not supported yet
  813. ***** ^ not supported yet
  814. ***** ^ not supported yet
  815. ***** ^ not supported yet
  816. 401 spot := M2Strings.Pos(TheChar, x);
  817. ***** ^ not supported yet
  818. ***** ^ not supported yet
  819. ***** ^ not supported yet
  820. 402 END;
  821. 403 END DeleteChar;
  822. ***** ^ not supported yet
  823. 404
  824. 405 PROCEDURE SetLength( VAR TheStr : ARRAY OF CHAR; NewLength :
  825. ***** ^ not supported yet
  826. 406 CARDINAL);
  827. 407 VAR
  828. 408 OldLength, MaxLength: CARDINAL;
  829. 409 BEGIN
  830. 410 OldLength := M2Strings.Length( TheStr);
  831. ***** ^ not supported yet
  832. ***** ^ not supported yet
  833. ***** ^ not supported yet
  834. 411 IF NewLength # OldLength THEN
  835. 412 MaxLength := HIGH(TheStr) + 1;
  836. ***** ^ undeclared identifier
  837. ***** ^ not supported yet
  838. 413 IF OldLength < MaxLength THEN
  839. 414 (* if a null exists that must be filled *)
  840. 415 IF OldLength > 0 THEN
  841. 416 TheStr[ OldLength] := TheStr[ OldLength - 1 ];
  842. ***** ^ not supported yet
  843. ***** ^ not supported yet
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. 417 (* the current last character in the string *)
  847. 418 ELSIF MaxLength > 1 THEN
  848. 419 TheStr[ OldLength] := TheStr[ 1 ];
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. ***** ^ not supported yet
  853. 420 ELSE
  854. 421 TheStr[ OldLength] := BLANK;
  855. ***** ^ not supported yet
  856. ***** ^ not supported yet
  857. 422 END;
  858. 423 END;
  859. 424 IF NewLength < MaxLength THEN
  860. 425 (* set the new length *)
  861. 426 TheStr[ NewLength] := 0C;
  862. ***** ^ not supported yet
  863. ***** ^ not supported yet
  864. 427 END;
  865. 428 END;
  866. 429 END SetLength;
  867. ***** ^ not supported yet
  868. 430
  869. 431 PROCEDURE RightJustify( VAR TheStr: ARRAY OF CHAR;
  870. ***** ^ not supported yet
  871. 432 RequiredLength: CARDINAL );
  872. 433 VAR strlength: CARDINAL;
  873. 434 BEGIN
  874. 435 IF NOT ScanUtils.IsBlank( TheStr ) THEN
  875. ***** ^ not supported yet
  876. ***** ^ not supported yet
  877. ***** ^ not supported yet
  878. 436 CutTrailingChars( BLANK, TheStr );
  879. ***** ^ not supported yet
  880. ***** ^ not supported yet
  881. 437 END;
  882. 438 strlength := M2Strings.Length( TheStr );
  883. ***** ^ not supported yet
  884. ***** ^ not supported yet
  885. ***** ^ not supported yet
  886. 439 WHILE strlength > RequiredLength DO
  887. 440 M2Strings.Delete( TheStr, 0, 1 );
  888. ***** ^ not supported yet
  889. ***** ^ not supported yet
  890. ***** ^ not supported yet
  891. ***** ^ not supported yet
  892. 441 DEC( strlength );
  893. ***** ^ undeclared identifier
  894. ***** ^ not supported yet
  895. 442 END;
  896. 443 WHILE strlength < RequiredLength DO
  897. 444 M2Strings.Insert( BLANK, TheStr, 0 );
  898. ***** ^ not supported yet
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. ***** ^ not supported yet
  902. 445 INC( strlength );
  903. ***** ^ undeclared identifier
  904. ***** ^ not supported yet
  905. 446 END;
  906. 447 END RightJustify;
  907. ***** ^ not supported yet
  908. 448
  909. 449 PROCEDURE LeftJustify( VAR TheStr: ARRAY OF CHAR;
  910. ***** ^ not supported yet
  911. 450 RequiredLength: CARDINAL );
  912. 451 VAR strlength: CARDINAL;
  913. 452 BEGIN
  914. 453 IF NOT ScanUtils.IsBlank( TheStr ) THEN
  915. ***** ^ not supported yet
  916. ***** ^ not supported yet
  917. ***** ^ not supported yet
  918. 454 CutLeadingChars( BLANK, TheStr );
  919. ***** ^ not supported yet
  920. ***** ^ not supported yet
  921. 455 END;
  922. 456 strlength := M2Strings.Length( TheStr );
  923. ***** ^ not supported yet
  924. ***** ^ not supported yet
  925. ***** ^ not supported yet
  926. 457 IF strlength > RequiredLength THEN
  927. 458 SetLength( TheStr, RequiredLength );
  928. ***** ^ not supported yet
  929. ***** ^ not supported yet
  930. ***** ^ not supported yet
  931. 459 ELSE
  932. 460 WHILE strlength < RequiredLength DO
  933. 461 Append( TheStr, BLANK );
  934. ***** ^ not supported yet
  935. ***** ^ not supported yet
  936. ***** ^ not supported yet
  937. 462 INC( strlength );
  938. ***** ^ undeclared identifier
  939. ***** ^ not supported yet
  940. 463 END;
  941. 464 END;
  942. 465 END LeftJustify;
  943. ***** ^ not supported yet
  944. 466
  945. 467
  946. 468 PROCEDURE MakeCurrency( CurrencySymbol: ARRAY OF CHAR;
  947. ***** ^ not supported yet
  948. 469 VAR TheStr: ARRAY OF CHAR );
  949. ***** ^ not supported yet
  950. 470 VAR
  951. 471 spot, lngth: CARDINAL;
  952. 472 BEGIN
  953. 473 DeleteChar( ' ', TheStr );
  954. ***** ^ not supported yet
  955. ***** ^ not supported yet
  956. 474 IF NOT ScanUtils.Present( CurrencySymbol, TheStr,
  957. ***** ^ not supported yet
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. ***** ^ not supported yet
  961. 475 ScanUtils.CaseSens ) THEN
  962. ***** ^ not supported yet
  963. ***** ^ not supported yet
  964. 476 M2Strings.Insert( CurrencySymbol, TheStr, 0 );
  965. ***** ^ not supported yet
  966. ***** ^ not supported yet
  967. ***** ^ not supported yet
  968. ***** ^ not supported yet
  969. ***** ^ not supported yet
  970. 477 END;
  971. 478 lngth := M2Strings.Length(TheStr);
  972. ***** ^ not supported yet
  973. ***** ^ not supported yet
  974. ***** ^ not supported yet
  975. 479 IF lngth < 3 THEN
  976. 480 RightJustify( TheStr, 3 );
  977. ***** ^ not supported yet
  978. ***** ^ not supported yet
  979. ***** ^ not supported yet
  980. 481 lngth := 3;
  981. 482 END;
  982. 483 IF NOT ScanUtils.PresentPos( '.', TheStr, spot,
  983. ***** ^ not supported yet
  984. ***** ^ not supported yet
  985. ***** ^ not supported yet
  986. 484 ScanUtils.CaseSens ) THEN
  987. ***** ^ not supported yet
  988. ***** ^ not supported yet
  989. 485 Append( TheStr, '.' );
  990. ***** ^ not supported yet
  991. ***** ^ not supported yet
  992. ***** ^ not supported yet
  993. 486 INC( lngth );
  994. ***** ^ undeclared identifier
  995. ***** ^ not supported yet
  996. 487 ELSIF spot < (lngth - 3) THEN
  997. 488 M2Strings.Delete( TheStr, spot + 3, lngth - (spot + 3) );
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. ***** ^ not supported yet
  1001. ***** ^ not supported yet
  1002. 489 RETURN;
  1003. 490 END;
  1004. 491 WHILE (TheStr[ lngth - 3 ] # '.') AND (lngth < (HIGH(TheStr) + 1)) DO
  1005. ***** ^ not supported yet
  1006. ***** ^ not supported yet
  1007. ***** ^ undeclared identifier
  1008. ***** ^ not supported yet
  1009. 492 Append( TheStr, '0' );
  1010. ***** ^ not supported yet
  1011. ***** ^ not supported yet
  1012. ***** ^ not supported yet
  1013. 493 INC( lngth );
  1014. ***** ^ undeclared identifier
  1015. ***** ^ not supported yet
  1016. 494 END;
  1017. 495 END MakeCurrency;
  1018. ***** ^ not supported yet
  1019. 496
  1020. 497
  1021. 498 PROCEDURE Center( VAR TheStr: ARRAY OF CHAR;
  1022. ***** ^ not supported yet
  1023. 499 RequiredLength: CARDINAL );
  1024. 500 VAR
  1025. 501 PadLength, strlength: CARDINAL;
  1026. 502 BEGIN
  1027. 503 IF NOT ScanUtils.IsBlank( TheStr ) THEN
  1028. ***** ^ not supported yet
  1029. ***** ^ not supported yet
  1030. ***** ^ not supported yet
  1031. 504 CutLeadingChars( BLANK, TheStr );
  1032. ***** ^ not supported yet
  1033. ***** ^ not supported yet
  1034. 505 CutTrailingChars( BLANK, TheStr );
  1035. ***** ^ not supported yet
  1036. ***** ^ not supported yet
  1037. 506 END;
  1038. 507 strlength := M2Strings.Length( TheStr );
  1039. ***** ^ not supported yet
  1040. ***** ^ not supported yet
  1041. ***** ^ not supported yet
  1042. 508 IF strlength > RequiredLength THEN
  1043. 509 SetLength( TheStr, RequiredLength );
  1044. ***** ^ not supported yet
  1045. ***** ^ not supported yet
  1046. ***** ^ not supported yet
  1047. 510 ELSIF strlength < RequiredLength THEN
  1048. 511 PadLength := (RequiredLength - strlength) DIV 2;
  1049. 512 InsertTimes( ' ', TheStr, 0, PadLength );
  1050. ***** ^ not supported yet
  1051. ***** ^ not supported yet
  1052. ***** ^ not supported yet
  1053. 513 strlength := strlength + PadLength;
  1054. 514 PadLength := RequiredLength - strlength;
  1055. 515 InsertTimes( ' ', TheStr, strlength, PadLength );
  1056. ***** ^ not supported yet
  1057. ***** ^ not supported yet
  1058. ***** ^ not supported yet
  1059. 516 END;
  1060. 517 END Center;
  1061. ***** ^ not supported yet
  1062. 518
  1063. 519
  1064. 520 PROCEDURE InsertRightJustified( str1: ARRAY OF CHAR; VAR
  1065. ***** ^ not supported yet
  1066. 521 str2: ARRAY OF CHAR; spot: CARDINAL );
  1067. ***** ^ not supported yet
  1068. 522
  1069. 523 (* Inserts str1 into str2 without changing the length of
  1070. 524 str2. Deletes characters from the beginning of str2 to
  1071. 525 make room for str1. Truncates str1 if necessary. *)
  1072. 526
  1073. 527 VAR
  1074. 528 str1length, str2length: CARDINAL;
  1075. 529 tmpstr: ARRAY [0..255] OF CHAR;
  1076. ***** ^ not supported yet
  1077. ***** ^ not supported yet
  1078. 530 BEGIN
  1079. 531 str1length := M2Strings.Length( str1 );
  1080. ***** ^ not supported yet
  1081. ***** ^ not supported yet
  1082. ***** ^ not supported yet
  1083. 532 str2length := M2Strings.Length( str2 );
  1084. ***** ^ not supported yet
  1085. ***** ^ not supported yet
  1086. ***** ^ not supported yet
  1087. 533 IF str1length > str2length THEN
  1088. 534 SetLength( str1, str2length );
  1089. ***** ^ not supported yet
  1090. ***** ^ not supported yet
  1091. ***** ^ not supported yet
  1092. 535 str1length := str2length;
  1093. 536 END;
  1094. 537 LowLevel.Move( SYSTEM.ADR(str2), SYSTEM.ADR(tmpstr), Numbers.Min( HIGH(str2), HIGH(tmpstr)) + 1 );
  1095. ***** ^ not supported yet
  1096. ***** ^ not supported yet
  1097. ***** ^ not supported yet
  1098. ***** ^ not supported yet
  1099. ***** ^ not supported yet
  1100. ***** ^ not supported yet
  1101. ***** ^ not supported yet
  1102. ***** ^ not supported yet
  1103. ***** ^ not supported yet
  1104. ***** ^ not supported yet
  1105. ***** ^ undeclared identifier
  1106. ***** ^ not supported yet
  1107. ***** ^ undeclared identifier
  1108. ***** ^ not supported yet
  1109. ***** ^ not supported yet
  1110. 538 (* We assign str2 to a tmpstr to avoid complications
  1111. 539 associated with possible overflow of str2, and we do
  1112. 540 it with a Move to avoid overhead of an AssignStr. *)
  1113. 541 SetLength( tmpstr, str2length );
  1114. ***** ^ not supported yet
  1115. ***** ^ not supported yet
  1116. ***** ^ not supported yet
  1117. 542 IF spot >= str2length THEN
  1118. 543 (* Means insertions beyond length of str2 will be
  1119. 544 appended. *)
  1120. 545 Append( str2, str1 );
  1121. ***** ^ not supported yet
  1122. ***** ^ not supported yet
  1123. ***** ^ not supported yet
  1124. 546 ELSE
  1125. 547 M2Strings.Insert( str1, str2, spot );
  1126. ***** ^ not supported yet
  1127. ***** ^ not supported yet
  1128. ***** ^ not supported yet
  1129. ***** ^ not supported yet
  1130. ***** ^ not supported yet
  1131. 548 END;
  1132. 549 M2Strings.Delete( str2, 0, str1length );
  1133. ***** ^ not supported yet
  1134. ***** ^ not supported yet
  1135. ***** ^ not supported yet
  1136. ***** ^ not supported yet
  1137. 550 END InsertRightJustified;
  1138. ***** ^ not supported yet
  1139. 551
  1140. 552 PROCEDURE DeleteRightJustified( VAR TheStr: ARRAY OF CHAR;
  1141. ***** ^ not supported yet
  1142. 553 spot, HowMany: CARDINAL );
  1143. 554 (* Deletes HowMany characters from TheStr beginning with
  1144. 555 spot, and fills in with blanks at the beginning of
  1145. 556 TheStr to preserve its former length. *)
  1146. 557 VAR
  1147. 558 cnt: CARDINAL;
  1148. 559 BEGIN
  1149. 560 M2Strings.Delete( TheStr, spot, HowMany );
  1150. ***** ^ not supported yet
  1151. ***** ^ not supported yet
  1152. ***** ^ not supported yet
  1153. ***** ^ not supported yet
  1154. 561 FOR cnt := 1 TO HowMany DO
  1155. 562 M2Strings.Insert( BLANK, TheStr, 0 );
  1156. ***** ^ not supported yet
  1157. ***** ^ not supported yet
  1158. ***** ^ not supported yet
  1159. ***** ^ not supported yet
  1160. 563 END;
  1161. 564 END DeleteRightJustified;
  1162. ***** ^ not supported yet
  1163. 565
  1164. 566
  1165. 567 BEGIN
  1166. 568 Initialized := FALSE;
  1167. 569 Init();
  1168. ***** ^ not supported yet
  1169. ***** ^ not supported yet
  1170. 570 END StrEdit.
  1171. ***** ^ not supported yet
  1172. 600 errors