SNR.LST 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019
  1. Listing:
  2. 1 MODULE snr;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1990 PMI
  8. 7 * Green Bay WI
  9. 8 * All rights reserved
  10. 9 * (414) 468-6040
  11. 10 *
  12. 11 *)
  13. 12
  14. 13 (*
  15. 14 IMPORT EMS;
  16. 15 *)
  17. 16
  18. 17 FROM BigSets IMPORT AppendSet, ExclSet, InitSet, ChSetArray;
  19. 18 FROM Drectory IMPORT FileInfoRec, FindFirstFile, FindNextFile,
  20. 19 GetDrivePathAndName, GetFileDateAndTime, SetFileDateAndTime;
  21. 20 FROM Editor IMPORT DoCounting, EntryBox, ExitBox, ScrnEdit;
  22. 21 FROM EnvironUtils IMPORT ParsedParam;
  23. 22 FROM ErrorManager IMPORT StraightToDOS;
  24. 23 FROM HandleIO IMPORT OpenFile, CloseHandle;
  25. 24 FROM GenLists IMPORT DisposeList, GenList, GetElmt, ListInsert, ListLength,
  26. 25 ListDelete, ListReplace, NewList, ScanList, StrCode;
  27. 26 FROM KbdInput IMPORT KeyNumSet, CAPkey, KeyHit, YorN;
  28. 27 FROM ListUtils IMPORT TextFileToList, TextListToFile;
  29. 28 FROM M2Strings IMPORT CompareStr, Copy, Delete, Insert, Length;
  30. 29 FROM PosUtils IMPORT Equal, Present, PresentPos;
  31. 30 FROM ScrnTypes IMPORT DisplayFrame;
  32. 31 FROM SmartScreen IMPORT ClearScreen;
  33. 32 FROM StrConv IMPORT AppendDecoded, StrToCardinal;
  34. 33 FROM StrEdit IMPORT Append, AssignStr, CrunchBlanks, CutTrailingChars,
  35. 34 DeleteChar, ReplaceStr, SetLength, InsertTabs, ReplaceTabs;
  36. 35 FROM StringIO IMPORT NoError, inp, outp, PrintMessage, ReadStr,
  37. 36 WriteEol, WriteStr;
  38. 37 FROM UserOps IMPORT FieldExitKeySet;
  39. 38 (*
  40. 39 IMPORT InitJPI;
  41. 40 *)
  42. 41
  43. 42 CONST
  44. 43 TAB = 11C;
  45. 44
  46. 45 VAR
  47. 46 DirHandle, SavedMessage: CARDINAL;
  48. 47 fname, FileSpec, CodeStr, PathName, PromptStr: ARRAY [0..80] OF CHAR;
  49. ***** ^ not supported yet
  50. ***** ^ not supported yet
  51. 48 MeansDelete, EOFmark, Dumstr: ARRAY [0..0] OF CHAR;
  52. ***** ^ not supported yet
  53. ***** ^ not supported yet
  54. 49 SearchFor, x, ReplaceWith: ARRAY [0..255] OF CHAR;
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. 50 FileInfo: FileInfoRec;
  58. 51 PatternList, ReplaceList, TheList: GenList;
  59. 52 PatternCount, spot, ExitCode, CursorRow, LstLngth, StrLngth, LineNum,
  60. 53 StartingAt, FoundSpot, TypeCode, month, day, year, hours,
  61. 54 minutes, seconds, ParamCount: CARDINAL;
  62. 55 DriveLetter, CodeChar: CHAR;
  63. 56 editing, EditsMade, stripping, preserving, confirming, ChangesMade:
  64. 57 BOOLEAN;
  65. 58 DummyFrame: DisplayFrame;
  66. 59 entabbing, detabbing: BOOLEAN;
  67. 60 tabInterval: CARDINAL;
  68. 61
  69. 62
  70. 63 PROCEDURE GetStamp( fname: ARRAY OF CHAR );
  71. ***** ^ not supported yet
  72. 64 VAR
  73. 65 tmphandle: CARDINAL;
  74. 66 BEGIN
  75. 67 PrintMessage( OpenFile( tmphandle, fname ) );
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. ***** ^ not supported yet
  79. 68 GetFileDateAndTime( tmphandle, month, day, year, hours,
  80. ***** ^ not supported yet
  81. 69 minutes, seconds );
  82. ***** ^ not supported yet
  83. 70 PrintMessage( CloseHandle( tmphandle ) );
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. 71 END GetStamp;
  88. ***** ^ not supported yet
  89. 72
  90. 73
  91. 74 PROCEDURE SetStamp( fname: ARRAY OF CHAR );
  92. ***** ^ not supported yet
  93. 75 VAR
  94. 76 tmphandle: CARDINAL;
  95. 77 BEGIN
  96. 78 PrintMessage( OpenFile( tmphandle, fname ) );
  97. ***** ^ not supported yet
  98. ***** ^ not supported yet
  99. ***** ^ not supported yet
  100. 79 SetFileDateAndTime( tmphandle, month, day, year, hours,
  101. ***** ^ not supported yet
  102. 80 minutes, seconds );
  103. ***** ^ not supported yet
  104. 81 PrintMessage( CloseHandle( tmphandle ) );
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. ***** ^ not supported yet
  108. 82 END SetStamp;
  109. ***** ^ not supported yet
  110. 83
  111. 84
  112. 85 PROCEDURE GetTabInfo(VAR entabbing, detabbing: BOOLEAN;
  113. 86 VAR tabInterval: CARDINAL);
  114. 87 VAR
  115. 88 DigitKeySet: KeyNumSet;
  116. 89 EDNQ : KeyNumSet;
  117. 90 tmpkey: CARDINAL;
  118. 91 BEGIN
  119. 92 InitSet(DigitKeySet);
  120. ***** ^ not supported yet
  121. ***** ^ not supported yet
  122. 93 AppendSet(DigitKeySet, "{'0'..'9'}");
  123. ***** ^ not supported yet
  124. ***** ^ not supported yet
  125. ***** ^ not supported yet
  126. 94 InitSet( EDNQ );
  127. ***** ^ not supported yet
  128. ***** ^ not supported yet
  129. 95 AppendSet( EDNQ, "{'e', 'E', 'd', 'D', 'n', 'N', 'q', 'Q'}" );
  130. ***** ^ not supported yet
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. 96
  134. 97 WriteEol( outp, '' );
  135. ***** ^ not supported yet
  136. ***** ^ not supported yet
  137. ***** ^ not supported yet
  138. 98 WriteStr( outp, 'Entab, Detab or Neither? ' );
  139. ***** ^ not supported yet
  140. ***** ^ not supported yet
  141. ***** ^ not supported yet
  142. 99 tmpkey := CAPkey( KeyHit( EDNQ ) );
  143. ***** ^ not supported yet
  144. ***** ^ not supported yet
  145. ***** ^ not supported yet
  146. 100 entabbing := tmpkey = ORD('E');
  147. ***** ^ undeclared identifier
  148. ***** ^ not supported yet
  149. 101 detabbing := tmpkey = ORD('D');
  150. ***** ^ undeclared identifier
  151. ***** ^ not supported yet
  152. 102 IF entabbing THEN
  153. 103 WriteStr( outp, 'entab' );
  154. ***** ^ not supported yet
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. 104 ELSIF detabbing THEN
  158. 105 WriteStr( outp, 'detab' );
  159. ***** ^ not supported yet
  160. ***** ^ not supported yet
  161. ***** ^ not supported yet
  162. 106 ELSIF ORD('Q') = tmpkey THEN
  163. ***** ^ undeclared identifier
  164. ***** ^ not supported yet
  165. 107 StraightToDOS('');
  166. ***** ^ not supported yet
  167. ***** ^ not supported yet
  168. 108 END;
  169. 109 IF entabbing OR detabbing THEN
  170. 110 WriteEol( outp, '' );
  171. ***** ^ not supported yet
  172. ***** ^ not supported yet
  173. ***** ^ not supported yet
  174. 111 WriteStr( outp, 'Tab interval [0-9]? ' );
  175. ***** ^ not supported yet
  176. ***** ^ not supported yet
  177. ***** ^ not supported yet
  178. 112 tmpkey := KeyHit( DigitKeySet );
  179. ***** ^ not supported yet
  180. ***** ^ not supported yet
  181. 113 tabInterval := tmpkey - ORD('0');
  182. ***** ^ undeclared identifier
  183. ***** ^ not supported yet
  184. 114 ELSE
  185. 115 tabInterval := 0;
  186. 116 END;
  187. 117 END GetTabInfo;
  188. ***** ^ not supported yet
  189. 118
  190. 119 PROCEDURE yes( TheQuestion: ARRAY OF CHAR ): BOOLEAN;
  191. ***** ^ not supported yet
  192. 120 VAR
  193. 121 tmpkey: CARDINAL;
  194. 122 BEGIN
  195. 123 WriteEol( outp, '' );
  196. ***** ^ not supported yet
  197. ***** ^ not supported yet
  198. ***** ^ not supported yet
  199. 124 WriteStr( outp, TheQuestion );
  200. ***** ^ not supported yet
  201. ***** ^ not supported yet
  202. ***** ^ not supported yet
  203. 125 tmpkey := CAPkey( KeyHit( YorN ) );
  204. ***** ^ not supported yet
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. 126 IF ORD('Y') = tmpkey THEN
  208. ***** ^ undeclared identifier
  209. ***** ^ not supported yet
  210. 127 WriteStr( outp, 'yes' );
  211. ***** ^ not supported yet
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 128 RETURN TRUE;
  215. 129 ELSIF ORD('Q') = tmpkey THEN
  216. ***** ^ undeclared identifier
  217. ***** ^ not supported yet
  218. 130 StraightToDOS('');
  219. ***** ^ not supported yet
  220. ***** ^ not supported yet
  221. 131 END;
  222. 132 WriteStr( outp, 'no' );
  223. ***** ^ not supported yet
  224. ***** ^ not supported yet
  225. ***** ^ not supported yet
  226. 133 RETURN FALSE;
  227. 134 END yes;
  228. ***** ^ not supported yet
  229. 135
  230. 136 PROCEDURE NextParam(): CARDINAL;
  231. 137 BEGIN
  232. 138 INC(ParamCount);
  233. ***** ^ undeclared identifier
  234. ***** ^ not supported yet
  235. 139 RETURN ParamCount;
  236. 140 END NextParam;
  237. ***** ^ not supported yet
  238. 141
  239. 142 BEGIN
  240. 143 ParamCount := 0;
  241. 144 EOFmark[0] := CHR(26);
  242. ***** ^ not supported yet
  243. ***** ^ not supported yet
  244. ***** ^ undeclared identifier
  245. ***** ^ not supported yet
  246. 145 MeansDelete[0] := CHR(255);
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. ***** ^ undeclared identifier
  250. ***** ^ not supported yet
  251. 146 AppendSet( YorN, "{'q', 'Q'}" );
  252. ***** ^ not supported yet
  253. ***** ^ not supported yet
  254. ***** ^ not supported yet
  255. 147 IF NOT ParsedParam( NextParam(), FileSpec ) THEN
  256. ***** ^ not supported yet
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. 148 WriteStr( outp, "FileSpec: " );
  261. ***** ^ not supported yet
  262. ***** ^ not supported yet
  263. ***** ^ not supported yet
  264. 149 ReadStr( inp, FileSpec );
  265. ***** ^ not supported yet
  266. ***** ^ not supported yet
  267. ***** ^ not supported yet
  268. 150 IF Length( FileSpec ) = 0 THEN
  269. ***** ^ not supported yet
  270. ***** ^ not supported yet
  271. 151 RETURN;
  272. ***** ^ bad RETURN
  273. 152 END;
  274. 153 END;
  275. 154 IF ParsedParam( NextParam(), CodeStr ) THEN
  276. ***** ^ not supported yet
  277. ***** ^ not supported yet
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. 155 CodeChar := CodeStr[0];
  281. ***** ^ not supported yet
  282. ***** ^ not supported yet
  283. 156 ELSE
  284. 157 WriteStr( outp, 'CodeChar: ' );
  285. ***** ^ not supported yet
  286. ***** ^ not supported yet
  287. ***** ^ not supported yet
  288. 158 ReadStr( inp, CodeStr );
  289. ***** ^ not supported yet
  290. ***** ^ not supported yet
  291. ***** ^ not supported yet
  292. 159 CrunchBlanks( CodeStr );
  293. ***** ^ not supported yet
  294. ***** ^ not supported yet
  295. 160 IF Length( CodeStr ) = 0 THEN
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. 161 CodeChar := '#';
  299. 162 WriteEol( outp, 'Assumed #' );
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. 163 ELSE
  304. 164 CodeChar := CodeStr[0];
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. 165 END;
  308. 166 END;
  309. 167
  310. 168 NewList(PatternList);
  311. ***** ^ not supported yet
  312. ***** ^ not supported yet
  313. 169 NewList(ReplaceList);
  314. ***** ^ not supported yet
  315. ***** ^ not supported yet
  316. 170 SetLength( SearchFor, 0 );
  317. ***** ^ not supported yet
  318. ***** ^ not supported yet
  319. ***** ^ not supported yet
  320. 171 IF ParsedParam( NextParam(), x ) THEN
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. ***** ^ not supported yet
  325. 172 AppendDecoded( SearchFor, CodeChar, x );
  326. ***** ^ not supported yet
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. 173 ELSE
  330. 174 WriteStr( outp, 'SearchFor: ' );
  331. ***** ^ not supported yet
  332. ***** ^ not supported yet
  333. ***** ^ not supported yet
  334. 175 ReadStr( inp, x );
  335. ***** ^ not supported yet
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. 176 IF Length( x ) = 0 THEN
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. 177 RETURN;
  342. ***** ^ bad RETURN
  343. 178 ELSE
  344. 179 AppendDecoded( SearchFor, CodeChar, x );
  345. ***** ^ not supported yet
  346. ***** ^ not supported yet
  347. ***** ^ not supported yet
  348. 180 END;
  349. 181 END;
  350. 182
  351. 183 IF SearchFor[0] = '@' THEN
  352. ***** ^ not supported yet
  353. ***** ^ not supported yet
  354. 184 (*They've given us a file name.*)
  355. 185 Delete( SearchFor, 0, 1 );
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. ***** ^ not supported yet
  359. 186 NewList( PatternList );
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. 187 PrintMessage( TextFileToList( SearchFor, PatternList ) );
  363. ***** ^ not supported yet
  364. ***** ^ not supported yet
  365. ***** ^ not supported yet
  366. ***** ^ not supported yet
  367. 188 PatternCount := 1;
  368. 189 WHILE PatternCount <= ListLength(PatternList) DO
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. 190 SetLength( ReplaceWith, 0 );
  372. ***** ^ not supported yet
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. 191 GetElmt( PatternList, PatternCount, SearchFor, TypeCode );
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. ***** ^ not supported yet
  379. ***** ^ not supported yet
  380. 192 IF PresentPos( '=', SearchFor, spot ) THEN
  381. ***** ^ not supported yet
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. 193 Copy( SearchFor, spot + 1, Length(SearchFor) - spot - 1, x );
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. ***** ^ not supported yet
  390. 194 AppendDecoded( ReplaceWith, CodeChar, x );
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. ***** ^ not supported yet
  394. 195 Delete( SearchFor, spot, Length(SearchFor) - spot );
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. ***** ^ not supported yet
  399. ***** ^ not supported yet
  400. 196 ListReplace( SearchFor, StrCode, PatternList,
  401. ***** ^ not supported yet
  402. ***** ^ not supported yet
  403. ***** ^ not supported yet
  404. ***** ^ not supported yet
  405. 197 PatternCount );
  406. ***** ^ not supported yet
  407. 198 ListInsert( ReplaceWith, StrCode, ReplaceList,
  408. ***** ^ not supported yet
  409. ***** ^ not supported yet
  410. ***** ^ not supported yet
  411. ***** ^ not supported yet
  412. 199 ListLength(ReplaceList) + 1 );
  413. ***** ^ not supported yet
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. 200 INC( PatternCount );
  417. ***** ^ undeclared identifier
  418. ***** ^ not supported yet
  419. 201 ELSE
  420. 202 ListDelete( PatternList, PatternCount, 1 );
  421. ***** ^ not supported yet
  422. ***** ^ not supported yet
  423. ***** ^ not supported yet
  424. 203 END;
  425. 204 END;
  426. 205 ELSE
  427. 206 SetLength( ReplaceWith, 0 );
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. ***** ^ not supported yet
  431. 207 IF ParsedParam( NextParam(), x ) THEN
  432. ***** ^ not supported yet
  433. ***** ^ not supported yet
  434. ***** ^ not supported yet
  435. ***** ^ not supported yet
  436. 208 AppendDecoded( ReplaceWith, CodeChar, x );
  437. ***** ^ not supported yet
  438. ***** ^ not supported yet
  439. ***** ^ not supported yet
  440. 209 ELSE
  441. 210 WriteStr( outp, 'ReplaceWith: ' );
  442. ***** ^ not supported yet
  443. ***** ^ not supported yet
  444. ***** ^ not supported yet
  445. 211 ReadStr( inp, x );
  446. ***** ^ not supported yet
  447. ***** ^ not supported yet
  448. ***** ^ not supported yet
  449. 212 IF Length( x ) = 0 THEN
  450. ***** ^ not supported yet
  451. ***** ^ not supported yet
  452. 213 RETURN;
  453. ***** ^ bad RETURN
  454. 214 ELSE
  455. 215 AppendDecoded( ReplaceWith, CodeChar, x );
  456. ***** ^ not supported yet
  457. ***** ^ not supported yet
  458. ***** ^ not supported yet
  459. 216 END;
  460. 217 END;
  461. 218 ListInsert( SearchFor, StrCode, PatternList, 1 );
  462. ***** ^ not supported yet
  463. ***** ^ not supported yet
  464. ***** ^ not supported yet
  465. ***** ^ not supported yet
  466. ***** ^ not supported yet
  467. 219 ListInsert( ReplaceWith, StrCode, ReplaceList, 1 );
  468. ***** ^ not supported yet
  469. ***** ^ not supported yet
  470. ***** ^ not supported yet
  471. ***** ^ not supported yet
  472. ***** ^ not supported yet
  473. 220 END;
  474. 221 IF NOT ParsedParam( NextParam(), Dumstr ) THEN
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. ***** ^ not supported yet
  478. ***** ^ not supported yet
  479. 222 confirming := yes( 'Confirm replacements? ');
  480. ***** ^ not supported yet
  481. ***** ^ not supported yet
  482. 223 ELSE
  483. 224 confirming := Dumstr[0] = 'Y';
  484. ***** ^ not supported yet
  485. ***** ^ not supported yet
  486. 225 END;
  487. 226
  488. 227 IF NOT ParsedParam( NextParam(), Dumstr ) THEN
  489. ***** ^ not supported yet
  490. ***** ^ not supported yet
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. 228
  494. 229 EntryBox := 0;
  495. ***** ^ not supported yet
  496. 230 ExitBox := 0;
  497. ***** ^ not supported yet
  498. 231 DoCounting := FALSE;
  499. ***** ^ not supported yet
  500. 232
  501. 233 editing := yes( 'Invoke editor? ');
  502. ***** ^ not supported yet
  503. ***** ^ not supported yet
  504. 234 ELSE
  505. 235 editing := Dumstr[0] = 'Y';
  506. ***** ^ not supported yet
  507. ***** ^ not supported yet
  508. 236 END;
  509. 237
  510. 238 IF NOT ParsedParam( NextParam(), Dumstr ) THEN
  511. ***** ^ not supported yet
  512. ***** ^ not supported yet
  513. ***** ^ not supported yet
  514. ***** ^ not supported yet
  515. 239 stripping := yes( 'Strip trailing blanks and EOFs? ');
  516. ***** ^ not supported yet
  517. ***** ^ not supported yet
  518. 240 ELSE
  519. 241 stripping := Dumstr[0] = 'Y';
  520. ***** ^ not supported yet
  521. ***** ^ not supported yet
  522. 242 END;
  523. 243
  524. 244 IF NOT ParsedParam( NextParam(), Dumstr ) THEN
  525. ***** ^ not supported yet
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. ***** ^ not supported yet
  529. 245 preserving := yes( 'Preserve file date/time stamps? ');
  530. ***** ^ not supported yet
  531. ***** ^ not supported yet
  532. 246 ELSE
  533. 247 preserving := Dumstr[0] = 'Y';
  534. ***** ^ not supported yet
  535. ***** ^ not supported yet
  536. 248 END;
  537. 249
  538. 250 IF NOT ParsedParam( NextParam(), Dumstr ) THEN
  539. ***** ^ not supported yet
  540. ***** ^ not supported yet
  541. ***** ^ not supported yet
  542. ***** ^ not supported yet
  543. 251 GetTabInfo(entabbing, detabbing, tabInterval);
  544. ***** ^ not supported yet
  545. ***** ^ not supported yet
  546. 252 ELSE
  547. 253 entabbing := Dumstr[0] = 'E';
  548. ***** ^ not supported yet
  549. ***** ^ not supported yet
  550. 254 detabbing := Dumstr[0] = 'D';
  551. ***** ^ not supported yet
  552. ***** ^ not supported yet
  553. 255 IF entabbing OR detabbing THEN
  554. 256 IF NOT StrToCardinal(Dumstr, 1, tabInterval) THEN
  555. ***** ^ not supported yet
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. 257 tabInterval := 8;
  559. 258 END;
  560. 259 ELSE
  561. 260 tabInterval := 0;
  562. 261 END;
  563. 262 END;
  564. 263
  565. 264 IF (NOT Present( EOFmark, SearchFor )) AND (NOT Present(
  566. ***** ^ not supported yet
  567. ***** ^ not supported yet
  568. ***** ^ not supported yet
  569. ***** ^ not supported yet
  570. 265 EOFmark, ReplaceWith )) THEN
  571. ***** ^ not supported yet
  572. ***** ^ not supported yet
  573. 266 WriteEol( outp, '' );
  574. ***** ^ not supported yet
  575. ***** ^ not supported yet
  576. ***** ^ not supported yet
  577. 267 WriteStr( outp, 'Searching for "');
  578. ***** ^ not supported yet
  579. ***** ^ not supported yet
  580. ***** ^ not supported yet
  581. 268 WriteStr( outp, SearchFor );
  582. ***** ^ not supported yet
  583. ***** ^ not supported yet
  584. ***** ^ not supported yet
  585. 269 WriteStr( outp, '" and replacing it with "' );
  586. ***** ^ not supported yet
  587. ***** ^ not supported yet
  588. ***** ^ not supported yet
  589. 270 WriteStr( outp, ReplaceWith );
  590. ***** ^ not supported yet
  591. ***** ^ not supported yet
  592. ***** ^ not supported yet
  593. 271 WriteStr( outp, '" in "');
  594. ***** ^ not supported yet
  595. ***** ^ not supported yet
  596. ***** ^ not supported yet
  597. 272 WriteStr( outp, FileSpec );
  598. ***** ^ not supported yet
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. 273 WriteEol( outp, '".' );
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. 274 END;
  606. 275
  607. 276 DirHandle := 0FFFFH;
  608. 277 SavedMessage := FindFirstFile( FileSpec, DirHandle, FileInfo );
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. ***** ^ not supported yet
  612. 278 PrintMessage( SavedMessage );
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. 279 GetDrivePathAndName( FileSpec, DriveLetter, PathName, fname );
  616. ***** ^ not supported yet
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. ***** ^ not supported yet
  620. 280
  621. 281 ExclSet( FieldExitKeySet, 328 );
  622. ***** ^ not supported yet
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. 282 ExclSet( FieldExitKeySet, 331 );
  626. ***** ^ not supported yet
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. 283 ExclSet( FieldExitKeySet, 333 );
  630. ***** ^ not supported yet
  631. ***** ^ not supported yet
  632. ***** ^ not supported yet
  633. 284 ExclSet( FieldExitKeySet, 336 );
  634. ***** ^ not supported yet
  635. ***** ^ not supported yet
  636. ***** ^ not supported yet
  637. 285 (*Arrow keys are now removed from FieldExitKeySet.*)
  638. 286
  639. 287 WHILE SavedMessage = NoError DO
  640. ***** ^ not supported yet
  641. 288 AssignStr( FileInfo.name, fname );
  642. ***** ^ not supported yet
  643. ***** ^ not supported yet
  644. ***** ^ not supported yet
  645. ***** ^ not supported yet
  646. 289 IF (CompareStr( '.', fname ) # 0)
  647. ***** ^ not supported yet
  648. ***** ^ not supported yet
  649. 290 AND (CompareStr('..', fname )#0) THEN
  650. ***** ^ not supported yet
  651. ***** ^ not supported yet
  652. ***** ^ not supported yet
  653. 291 ChangesMade := FALSE;
  654. 292 IF Length(PathName) > 0 THEN
  655. ***** ^ not supported yet
  656. ***** ^ not supported yet
  657. 293 Insert( PathName, fname, 0 );
  658. ***** ^ not supported yet
  659. ***** ^ not supported yet
  660. ***** ^ not supported yet
  661. ***** ^ not supported yet
  662. 294 END;
  663. 295 Insert( ':', fname, 0 );
  664. ***** ^ not supported yet
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. 296 Insert( DriveLetter, fname, 0 );
  668. ***** ^ not supported yet
  669. ***** ^ not supported yet
  670. ***** ^ not supported yet
  671. 297 NewList( TheList );
  672. ***** ^ not supported yet
  673. ***** ^ not supported yet
  674. 298
  675. 299 IF TextFileToList( fname, TheList ) # NoError THEN
  676. ***** ^ not supported yet
  677. ***** ^ not supported yet
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. 300 WriteStr( outp, 'Could not open ' );
  681. ***** ^ not supported yet
  682. ***** ^ not supported yet
  683. ***** ^ not supported yet
  684. 301 WriteEol( outp, fname );
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. ***** ^ not supported yet
  688. 302 ELSE
  689. 303 IF preserving THEN
  690. 304 GetStamp( fname );
  691. ***** ^ not supported yet
  692. ***** ^ not supported yet
  693. 305 END;
  694. 306 LstLngth := ListLength( TheList );
  695. ***** ^ not supported yet
  696. ***** ^ not supported yet
  697. 307 WriteEol( outp, '' );
  698. ***** ^ not supported yet
  699. ***** ^ not supported yet
  700. ***** ^ not supported yet
  701. 308 WriteEol( outp,
  702. ***** ^ not supported yet
  703. ***** ^ not supported yet
  704. 309 '===============================================================================');
  705. ***** ^ not supported yet
  706. 310 WriteEol( outp, fname );
  707. ***** ^ not supported yet
  708. ***** ^ not supported yet
  709. ***** ^ not supported yet
  710. 311
  711. 312 PatternCount := 1;
  712. 313 WHILE PatternCount <= ListLength(PatternList) DO
  713. ***** ^ not supported yet
  714. ***** ^ not supported yet
  715. 314 GetElmt( PatternList, PatternCount, SearchFor, TypeCode );
  716. ***** ^ not supported yet
  717. ***** ^ not supported yet
  718. ***** ^ not supported yet
  719. ***** ^ not supported yet
  720. 315 GetElmt( ReplaceList, PatternCount, ReplaceWith, TypeCode );
  721. ***** ^ not supported yet
  722. ***** ^ not supported yet
  723. ***** ^ not supported yet
  724. ***** ^ not supported yet
  725. 316 StartingAt := 1;
  726. 317 LOOP
  727. 318 LineNum := ScanList( SearchFor, TheList, StartingAt,
  728. ***** ^ not supported yet
  729. ***** ^ not supported yet
  730. ***** ^ not supported yet
  731. 319 LstLngth, FoundSpot );
  732. ***** ^ not supported yet
  733. 320 IF LineNum = 0 THEN
  734. 321 EXIT;
  735. 322 ELSE
  736. 323 GetElmt( TheList, LineNum, x, TypeCode );
  737. ***** ^ not supported yet
  738. ***** ^ not supported yet
  739. ***** ^ not supported yet
  740. ***** ^ not supported yet
  741. 324 IF confirming THEN
  742. 325 WriteEol( outp, '' );
  743. ***** ^ not supported yet
  744. ***** ^ not supported yet
  745. ***** ^ not supported yet
  746. 326 WriteEol( outp, '-------------------------------------------' );
  747. ***** ^ not supported yet
  748. ***** ^ not supported yet
  749. ***** ^ not supported yet
  750. 327 WriteEol( outp, x );
  751. ***** ^ not supported yet
  752. ***** ^ not supported yet
  753. ***** ^ not supported yet
  754. 328 WriteStr( outp, 'Replace "' );
  755. ***** ^ not supported yet
  756. ***** ^ not supported yet
  757. ***** ^ not supported yet
  758. 329 WriteStr( outp, SearchFor );
  759. ***** ^ not supported yet
  760. ***** ^ not supported yet
  761. ***** ^ not supported yet
  762. 330 WriteStr( outp, '" ' );
  763. ***** ^ not supported yet
  764. ***** ^ not supported yet
  765. ***** ^ not supported yet
  766. 331 AssignStr( ' with "', PromptStr );
  767. ***** ^ not supported yet
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. 332 Append( PromptStr, ReplaceWith );
  771. ***** ^ not supported yet
  772. ***** ^ not supported yet
  773. ***** ^ not supported yet
  774. 333 Append( PromptStr, '"? ' );
  775. ***** ^ not supported yet
  776. ***** ^ not supported yet
  777. ***** ^ not supported yet
  778. 334 IF yes(PromptStr) THEN
  779. ***** ^ not supported yet
  780. ***** ^ not supported yet
  781. 335 IF Equal( ReplaceWith, MeansDelete ) THEN
  782. ***** ^ not supported yet
  783. ***** ^ not supported yet
  784. ***** ^ not supported yet
  785. 336 ListDelete( TheList, LineNum, 1 );
  786. ***** ^ not supported yet
  787. ***** ^ not supported yet
  788. ***** ^ not supported yet
  789. 337 DEC( LineNum );
  790. ***** ^ undeclared identifier
  791. ***** ^ not supported yet
  792. 338 ELSE
  793. 339 ReplaceStr( SearchFor, ReplaceWith, x );
  794. ***** ^ not supported yet
  795. ***** ^ not supported yet
  796. ***** ^ not supported yet
  797. ***** ^ not supported yet
  798. 340 ListReplace( x, StrCode, TheList, LineNum );
  799. ***** ^ not supported yet
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. ***** ^ not supported yet
  803. ***** ^ not supported yet
  804. 341 END;
  805. 342 ChangesMade := TRUE;
  806. 343 ELSIF editing AND yes('Edit? ') THEN
  807. ***** ^ not supported yet
  808. ***** ^ not supported yet
  809. 344 CursorRow := 1;
  810. 345 INC( FoundSpot );
  811. ***** ^ undeclared identifier
  812. ***** ^ not supported yet
  813. 346
  814. 347 IF 0 # ScrnEdit( 1,1, 80,25, TheList, LineNum,
  815. ***** ^ not supported yet
  816. ***** ^ not supported yet
  817. 348 FoundSpot, CursorRow, EditsMade, FALSE,
  818. 349 DummyFrame ) THEN
  819. ***** ^ not supported yet
  820. 350 END;
  821. 351
  822. 352 ClearScreen();
  823. ***** ^ not supported yet
  824. ***** ^ not supported yet
  825. 353 ChangesMade := EditsMade AND yes('Save? ');
  826. ***** ^ not supported yet
  827. ***** ^ not supported yet
  828. 354 END;
  829. 355 ELSE
  830. 356 IF Equal( ReplaceWith, MeansDelete ) THEN
  831. ***** ^ not supported yet
  832. ***** ^ not supported yet
  833. ***** ^ not supported yet
  834. 357 ListDelete( TheList, LineNum, 1 );
  835. ***** ^ not supported yet
  836. ***** ^ not supported yet
  837. ***** ^ not supported yet
  838. 358 DEC( LineNum );
  839. ***** ^ undeclared identifier
  840. ***** ^ not supported yet
  841. 359 ELSE
  842. 360 ReplaceStr( SearchFor, ReplaceWith, x );
  843. ***** ^ not supported yet
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. ***** ^ not supported yet
  847. 361 ListReplace( x, StrCode, TheList, LineNum );
  848. ***** ^ not supported yet
  849. ***** ^ not supported yet
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. ***** ^ not supported yet
  853. 362 END;
  854. 363 WriteStr( outp, "|");
  855. ***** ^ not supported yet
  856. ***** ^ not supported yet
  857. ***** ^ not supported yet
  858. 364 ChangesMade := TRUE;
  859. 365 END;
  860. 366 IF LineNum = LstLngth THEN
  861. 367 EXIT;
  862. 368 ELSE
  863. 369 StartingAt := LineNum + 1;
  864. 370 END;
  865. 371 END;
  866. 372 END;
  867. 373 INC( PatternCount );
  868. ***** ^ undeclared identifier
  869. ***** ^ not supported yet
  870. 374 END;
  871. 375
  872. 376 IF stripping OR entabbing OR detabbing THEN
  873. 377 LineNum := 1;
  874. 378 WHILE LineNum <= LstLngth DO
  875. 379 GetElmt( TheList, LineNum, x, TypeCode );
  876. ***** ^ not supported yet
  877. ***** ^ not supported yet
  878. ***** ^ not supported yet
  879. ***** ^ not supported yet
  880. 380 IF entabbing THEN
  881. 381 IF Present(' ', x) THEN
  882. ***** ^ not supported yet
  883. ***** ^ not supported yet
  884. 382 ChangesMade := TRUE;
  885. 383 InsertTabs(x, tabInterval, TRUE); (* TRUE for LeadingOnly *)
  886. ***** ^ not supported yet
  887. ***** ^ not supported yet
  888. ***** ^ not supported yet
  889. 384 ListReplace( x, StrCode, TheList, LineNum );
  890. ***** ^ not supported yet
  891. ***** ^ not supported yet
  892. ***** ^ not supported yet
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. 385 END;
  896. 386 END;
  897. 387 IF detabbing THEN
  898. 388 IF Present(TAB, x) THEN
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. 389 ChangesMade := TRUE;
  902. 390 ReplaceTabs(x, tabInterval);
  903. ***** ^ not supported yet
  904. ***** ^ not supported yet
  905. ***** ^ not supported yet
  906. 391 ListReplace( x, StrCode, TheList, LineNum );
  907. ***** ^ not supported yet
  908. ***** ^ not supported yet
  909. ***** ^ not supported yet
  910. ***** ^ not supported yet
  911. ***** ^ not supported yet
  912. 392 END;
  913. 393 END;
  914. 394 StrLngth := Length(x);
  915. ***** ^ not supported yet
  916. ***** ^ not supported yet
  917. 395 IF stripping AND (StrLngth > 0) AND (x[ StrLngth - 1 ] = ' ') THEN
  918. ***** ^ not supported yet
  919. ***** ^ not supported yet
  920. 396 ChangesMade := TRUE;
  921. 397 WriteStr( outp, ".");
  922. ***** ^ not supported yet
  923. ***** ^ not supported yet
  924. ***** ^ not supported yet
  925. 398 CutTrailingChars( ' ', x );
  926. ***** ^ not supported yet
  927. ***** ^ not supported yet
  928. 399 ListReplace( x, StrCode, TheList, LineNum );
  929. ***** ^ not supported yet
  930. ***** ^ not supported yet
  931. ***** ^ not supported yet
  932. ***** ^ not supported yet
  933. ***** ^ not supported yet
  934. 400 INC( LineNum );
  935. ***** ^ undeclared identifier
  936. ***** ^ not supported yet
  937. 401 ELSIF stripping AND Present( EOFmark, x ) THEN
  938. ***** ^ not supported yet
  939. ***** ^ not supported yet
  940. ***** ^ not supported yet
  941. 402 ChangesMade := TRUE;
  942. 403 WriteStr( outp, ",");
  943. ***** ^ not supported yet
  944. ***** ^ not supported yet
  945. ***** ^ not supported yet
  946. 404 DeleteChar( EOFmark[0], x );
  947. ***** ^ not supported yet
  948. ***** ^ not supported yet
  949. ***** ^ not supported yet
  950. ***** ^ not supported yet
  951. 405 IF x[0] # 0C THEN
  952. ***** ^ not supported yet
  953. ***** ^ not supported yet
  954. 406 ListReplace( x, StrCode, TheList, LineNum );
  955. ***** ^ not supported yet
  956. ***** ^ not supported yet
  957. ***** ^ not supported yet
  958. ***** ^ not supported yet
  959. ***** ^ not supported yet
  960. 407 INC( LineNum );
  961. ***** ^ undeclared identifier
  962. ***** ^ not supported yet
  963. 408 ELSE
  964. 409 ListDelete( TheList, LineNum, 1 );
  965. ***** ^ not supported yet
  966. ***** ^ not supported yet
  967. ***** ^ not supported yet
  968. 410 DEC( LstLngth );
  969. ***** ^ undeclared identifier
  970. ***** ^ not supported yet
  971. 411 END;
  972. 412 ELSE
  973. 413 INC( LineNum );
  974. ***** ^ undeclared identifier
  975. ***** ^ not supported yet
  976. 414 END;
  977. 415 END;
  978. 416 END;
  979. 417
  980. 418 IF ChangesMade THEN
  981. 419 PrintMessage( TextListToFile( TheList, fname ) );
  982. ***** ^ not supported yet
  983. ***** ^ not supported yet
  984. ***** ^ not supported yet
  985. ***** ^ not supported yet
  986. 420 IF preserving THEN
  987. 421 SetStamp( fname );
  988. ***** ^ not supported yet
  989. ***** ^ not supported yet
  990. 422 END;
  991. 423 END;
  992. 424 END;
  993. 425 DisposeList( TheList );
  994. ***** ^ not supported yet
  995. ***** ^ not supported yet
  996. 426 END;
  997. 427 SavedMessage := FindNextFile( DirHandle, FileInfo );
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. 428 END;
  1001. 429 WriteEol( outp, '' );
  1002. ***** ^ not supported yet
  1003. ***** ^ not supported yet
  1004. ***** ^ not supported yet
  1005. 430 WriteStr( outp, 'Done.' );
  1006. ***** ^ not supported yet
  1007. ***** ^ not supported yet
  1008. ***** ^ not supported yet
  1009. 431 WriteStr( outp, CHR(7) );
  1010. ***** ^ not supported yet
  1011. ***** ^ not supported yet
  1012. ***** ^ undeclared identifier
  1013. ***** ^ not supported yet
  1014. 432 END snr.
  1015. 581 errors