| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161 |
- Listing:
- 1 IMPLEMENTATION MODULE ListUtils;
- 2 (*
- 3 * REPERTOIRE
- 4 * Release 1.6
- 5 * By Charles Bradford and Cole Brecheen
- 6 * (c) Copyright 1985-1992 PMI
- 7 * Green Bay, Wisconsin
- 8 * All rights reserved
- 9 * (414) 468-6040
- 10 *
- 11 * $Header: D:/logfiles/mods/listutil.mov 1.6 10 Mar 1991 15:35:08 coleb $
- 12 *
- 13 *
- 14 * For GenList manipulation routines that don't need access to
- 15 * the internal structure of a GenList.
- 16 *)
- 17
- 18
- 19 IMPORT ByteFiddler;
- 20 IMPORT EnvironUtils;
- 21 IMPORT ErrorManager;
- 22 IMPORT HandleIO;
- 23 IMPORT GenLists;
- 24 IMPORT LowLevel;
- 25 IMPORT M2Strings;
- 26 IMPORT Numbers;
- 27 IMPORT NumTypes;
- 28 IMPORT PosUtils;
- 29 IMPORT StrConv;
- 30 IMPORT StrEdit;
- 31 IMPORT StringIO;
- 32 IMPORT SYSTEM;
- 33 IMPORT VStorage;
- 34
- 35 VAR
- 36 Initialized : BOOLEAN;
- 37
- 38 PROCEDURE Init();
- 39 BEGIN
- 40 IF Initialized THEN
- 41 RETURN;
- 42 ELSE
- 43 Initialized := TRUE;
- 44 END;
- 45 ByteFiddler.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 46 EnvironUtils.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 47 ErrorManager.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 48 HandleIO.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 49 GenLists.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 50 LowLevel.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 51 M2Strings.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 52 Numbers.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 53 NumTypes.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 54 PosUtils.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 55 StrConv.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 56 StrEdit.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 57 StringIO.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 58 VStorage.Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 59 END Init;
- ***** ^ not supported yet
- 60
- 61
- 62 PROCEDURE InitResponse(msg : ARRAY OF CHAR);
- ***** ^ not supported yet
- 63 (*All calls to InitResponse are diagnostic. Remove them from
- 64 finished programs.*)
- 65 VAR
- 66 TmpStr : ARRAY [0..79] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 67 BEGIN
- 68 StrEdit.AssignStr('Uninit. list passed to ', TmpStr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 69 StrEdit.Append(TmpStr, msg);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 70 ErrorManager.WARN(TmpStr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 71 END InitResponse;
- ***** ^ not supported yet
- 72
- 73
- 74 (*$O-*)
- 75 PROCEDURE CharCount( TheList : GenLists.GenList;
- ***** ^ not supported yet
- 76 StartLine, EndLine: CARDINAL ): LONGINT;
- 77 VAR
- 78 tmp1, tmp2: LONGINT;
- 79 lngth, cnt: CARDINAL;
- 80 BEGIN
- 81 tmp2 := NumTypes.L0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 82 lngth := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 83 IF EndLine > lngth THEN
- 84 EndLine := lngth;
- 85 END;
- 86 FOR cnt := StartLine TO EndLine DO
- 87 tmp1 := Numbers.Lc( ElmtSize(TheList, cnt) );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 88 (*Workaround for Logitech LONGINT bug.*)
- 89 tmp2 := tmp2 + tmp1;
- 90 END;
- 91 RETURN tmp2;
- 92 END CharCount;
- ***** ^ not supported yet
- 93 (*$O=*)
- 94
- 95
- 96 PROCEDURE CheckLength(VAR TheList : GenLists.GenList;
- ***** ^ not supported yet
- 97 LeftMargin, LngthLimit : CARDINAL);
- 98 VAR
- 99 delimiters : ARRAY [0..15] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 100 tmpsize, cnt, DumType, BreakSpot : CARDINAL;
- 101 tmpadr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 102 BEGIN
- 103 delimiters := ' -,)]?+';
- ***** ^ not supported yet
- ***** ^ not supported yet
- 104 cnt := 1;
- 105 WHILE cnt <= GenLists.ListLength( TheList) DO
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 106 tmpsize := ElmtSize( TheList, cnt );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 107 (* we assign this out here to make it easier to see in
- 108 the RTD *)
- 109 IF tmpsize > LngthLimit THEN
- 110 GenLists.GetElmtAdr( TheList, cnt, tmpadr, tmpsize, DumType );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 111 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 112 (*reduce size to real string length*)
- 113 BreakSpot := PosUtils.BreakPtAdr( tmpadr, tmpsize, LngthLimit,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 114 delimiters) + 1;
- ***** ^ not supported yet
- 115 GenLists.ListInsertAdr( LowLevel.AddAddr(tmpadr,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 116 BreakSpot), (tmpsize -BreakSpot) + LeftMargin + 1,
- ***** ^ not supported yet
- 117 0, TheList, cnt + 1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 118 (* We can't use StrCode as the type in this
- 119 ListInsertAdr because we need to reserve room in
- 120 the list element beyond the null. *)
- 121 GenLists.ChangeTypeCode( TheList, cnt + 1, GenLists.StrCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 122 LowLevel.Fill( LowLevel.AddAddr(tmpadr, BreakSpot), 1, 0C );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 123 (*Make sure there's a null terminator at end of old
- 124 string.*)
- 125 IF LeftMargin > 0 THEN
- 126 GenLists.GetElmtAdr( TheList, cnt + 1, tmpadr, tmpsize, DumType );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 127 LowLevel.ShiftArrayRight( tmpadr, tmpsize, LeftMargin );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 128 LowLevel.Fill( tmpadr, LeftMargin, ' ' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 129 END;
- 130 END;
- 131 INC( cnt );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 132 END;
- 133 END CheckLength;
- ***** ^ not supported yet
- 134
- 135
- 136 PROCEDURE IndentationAt( TheList : GenLists.GenList;
- ***** ^ not supported yet
- 137 Line : CARDINAL ): CARDINAL;
- 138 VAR
- 139 tmpsize, indent, DumType: CARDINAL;
- 140 tmpadr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 141 BEGIN
- 142 GenLists.GetElmtAdr( TheList, Line, tmpadr, tmpsize, DumType );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 143 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 144 IF tmpsize = 0 THEN
- 145 RETURN 65535;
- 146 END;
- 147 indent := LowLevel.ScanNE(tmpsize, ' ', tmpadr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 148 RETURN indent;
- 149 END IndentationAt;
- ***** ^ not supported yet
- 150
- 151
- 152 PROCEDURE ReformPara( VAR TheList : GenLists.GenList;
- ***** ^ not supported yet
- 153 LeftMargin, RightMargin : CARDINAL; VAR
- 154 StartLine, CursorLine, CursorCol: CARDINAL;
- 155 VAR LinesAdded, BytesAdded: INTEGER; VAR
- 156 CursorBytePos: LONGINT );
- 157
- 158 VAR
- 159 blank : ARRAY [0..0] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 160 delimiters : ARRAY [0..15] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 161 tmpsize, cnt, indent, DumType, BreakSpot : CARDINAL;
- 162 tmpadr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 163 done : BOOLEAN;
- 164 BEGIN
- 165 blank[0] := ' ';
- ***** ^ not supported yet
- ***** ^ not supported yet
- 166 delimiters := ' -,)]?+';
- ***** ^ not supported yet
- ***** ^ not supported yet
- 167 cnt := StartLine;
- 168 LinesAdded := 0;
- 169 BytesAdded := 0;
- 170 done := FALSE;
- 171 WHILE (NOT done) AND (cnt <= GenLists.ListLength( TheList)) DO
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 172 IF cnt = GenLists.ListLength( TheList ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 173 StartLine := cnt;
- 174 done := TRUE;
- 175 ELSE
- 176 indent := IndentationAt( TheList, cnt + 1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 177 END;
- 178 IF (NOT done) AND (indent = LeftMargin) THEN
- 179 (* We bring the next line up and append it to this one. Means the
- 180 reformat stops when we reach a line where indentation <>
- 181 LeftMargin. *)
- 182 GenLists.GetElmtAdr( TheList, cnt, tmpadr, tmpsize, DumType );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 183 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 184 (*reduce size to real string length*)
- 185 IF (tmpsize > 0) AND (ByteFiddler.PeekChar(
- ***** ^ not supported yet
- ***** ^ not supported yet
- 186 LowLevel.AddAddr( tmpadr, tmpsize - 1 )) # ' ') THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 187 (* If this line doesn't end with a blank. *)
- 188 InsertIntoElmt( TheList, cnt, SYSTEM.ADR(blank), 1, 65535 );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 189 (*Append a blank to this line because we're not going to
- 190 insert leading blanks from the line below.*)
- 191 INC( BytesAdded );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 192 END;
- 193 IF CursorLine > (cnt + 1) THEN
- 194 DEC( CursorLine );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 195 ELSIF (CursorLine = (cnt + 1)) THEN
- 196 DEC( CursorLine );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 197 CursorCol := CursorCol + ElmtSize(TheList, cnt);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 198 END;
- 199 GenLists.GetElmtAdr( TheList, cnt + 1, tmpadr, tmpsize, DumType );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 200 InsertIntoElmt( TheList, cnt, LowLevel.AddAddr(tmpadr, indent),
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 201 ElmtSize(TheList, cnt + 1) - indent, 65535 );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 202 BytesAdded := BytesAdded - INTEGER(indent) - 2;
- ***** ^ not supported yet
- 203 (* We've deleted leading spaces and separating CR/LF. *)
- 204 GenLists.ListDelete( TheList, cnt + 1, 1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 205 DEC( LinesAdded );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 206 ELSE
- 207 done := TRUE;
- 208 END;
- 209
- 210 GenLists.GetElmtAdr( TheList, cnt, tmpadr, tmpsize, DumType );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 211 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 212 (*reduce size to real string length*)
- 213 IF (tmpsize > RightMargin) THEN
- 214 done := FALSE;
- 215 BreakSpot := PosUtils.BreakPtAdr( tmpadr, tmpsize, RightMargin,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 216 delimiters) + 1;
- ***** ^ not supported yet
- 217 IF CursorLine > cnt THEN
- 218 INC( CursorLine );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 219 ELSIF (CursorLine = cnt) AND (CursorCol >= BreakSpot) THEN
- 220 INC( CursorLine );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 221 CursorCol := CursorCol - BreakSpot;
- 222 END;
- 223 GenLists.ListInsertAdr( LowLevel.AddAddr(tmpadr,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 224 BreakSpot), (tmpsize -BreakSpot) + LeftMargin + 1,
- ***** ^ not supported yet
- 225 0, TheList, cnt + 1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 226 (* We can't use StrCode as the type in this
- 227 ListInsertAdr because we need to reserve room in
- 228 the list element beyond the null. *)
- 229 INC( LinesAdded );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 230 GenLists.ChangeTypeCode( TheList, cnt + 1, GenLists.StrCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 231 LowLevel.Fill( LowLevel.AddAddr(tmpadr, BreakSpot), 1, 0C );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 232 (*Make sure there's a null terminator at end of old
- 233 string.*)
- 234 IF LeftMargin > 0 THEN
- 235 GenLists.GetElmtAdr( TheList, cnt + 1, tmpadr, tmpsize, DumType );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 236 LowLevel.ShiftArrayRight( tmpadr, tmpsize, LeftMargin );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 237 LowLevel.Fill( tmpadr, LeftMargin, ' ' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 238 IF CursorLine = (cnt + 1) THEN
- 239 CursorCol := CursorCol + LeftMargin;
- 240 END;
- 241 BytesAdded := BytesAdded + INTEGER(LeftMargin) + 2 ;
- ***** ^ not supported yet
- 242 (* We've added leading spaces on new line plus CR/LF
- 243 on this one. *)
- 244 ELSE
- 245 BytesAdded := BytesAdded + 2;
- 246 (* We've added only the CR/LF. *)
- 247 END;
- 248 END;
- 249 INC( cnt );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 250 END;
- 251 IF (CursorBytePos > NumTypes.L0) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 252 (* They want us to compute new byte position. *)
- 253 IF CursorLine > 1 THEN
- 254 CursorBytePos := CharCount( TheList, 1, CursorLine - 1 ) +
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 255 Numbers.Lc( CursorCol );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 256 ELSE
- 257 CursorBytePos := Numbers.Lc( CursorCol );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 258 END;
- 259 END;
- 260 StartLine := cnt;
- 261 END ReformPara;
- ***** ^ not supported yet
- 262
- 263
- 264 PROCEDURE DeTabList( VAR TheList: GenLists.GenList; VAR
- ***** ^ not supported yet
- 265 ListChanged: BOOLEAN );
- 266 VAR
- 267 TmpStr: ARRAY [0..255] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 268 ListEnd, StartingSpot, StrSpot: CARDINAL;
- 269 TabStr: ARRAY [0..0] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 270 BEGIN
- 271 TabStr[0] := 11C;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 272 ListEnd := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 273 StartingSpot := 1;
- 274 ListChanged := FALSE;
- 275 WHILE (StartingSpot <= ListEnd) AND (StartingSpot # 0) DO
- 276 StartingSpot := GenLists.ScanList( TabStr, TheList, StartingSpot,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 277 ListEnd, StrSpot );
- ***** ^ not supported yet
- 278 IF StartingSpot > 0 THEN
- 279 ListChanged := TRUE;
- 280 GetStr( TheList, StartingSpot, TmpStr );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 281 StrEdit.CutTrailingChars( ' ', TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 282 StrEdit.ReplaceTabs( TmpStr, 8 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 283 GenLists.ListReplace( TmpStr, GenLists.StrCode, TheList,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 284 StartingSpot );
- ***** ^ not supported yet
- 285 END;
- 286 END;
- 287 END DeTabList;
- ***** ^ not supported yet
- 288
- 289
- 290 PROCEDURE EnTabList( VAR TheList: GenLists.GenList; LeadingOnly: BOOLEAN; VAR
- ***** ^ not supported yet
- 291 ListChanged: BOOLEAN );
- 292 VAR
- 293 TmpStr: ARRAY [0..255] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 294 ListEnd, StartingSpot, StrSpot: CARDINAL;
- 295 BlankStr: ARRAY [0..8] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 296 BEGIN
- 297 BlankStr := ' ';
- ***** ^ not supported yet
- ***** ^ not supported yet
- 298 ListEnd := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 299 StartingSpot := 1;
- 300 ListChanged := FALSE;
- 301 WHILE (StartingSpot <= ListEnd) AND (StartingSpot # 0) DO
- 302 StartingSpot := GenLists.ScanList( BlankStr, TheList, StartingSpot,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 303 ListEnd, StrSpot );
- ***** ^ not supported yet
- 304 IF StartingSpot > 0 THEN
- 305 ListChanged := TRUE;
- 306 GetStr( TheList, StartingSpot, TmpStr );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 307 StrEdit.CutTrailingChars( ' ', TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 308 StrEdit.InsertTabs( TmpStr, 8, LeadingOnly );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 309 GenLists.ListReplace( TmpStr, GenLists.StrCode, TheList,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 310 StartingSpot );
- ***** ^ not supported yet
- 311 END;
- 312 END;
- 313 END EnTabList;
- ***** ^ not supported yet
- 314
- 315
- 316 PROCEDURE ElmtSize( TheList: GenLists.GenList; spot: CARDINAL ): CARDINAL;
- ***** ^ not supported yet
- 317 VAR
- 318 TheAddr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 319 TheSize, TypeCode: CARDINAL;
- 320 BEGIN
- 321 GenLists.GetElmtAdr( TheList, spot, TheAddr, TheSize, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 322 IF TypeCode = GenLists.StrCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 323 TheSize := LowLevel.ScanEQ( TheSize, 0C, TheAddr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 324 END;
- 325 RETURN TheSize;
- 326 END ElmtSize;
- ***** ^ not supported yet
- 327
- 328
- 329 PROCEDURE GetStr( TheList: GenLists.GenList; spot: CARDINAL; VAR
- ***** ^ not supported yet
- 330 TheStr: ARRAY OF CHAR );
- ***** ^ not supported yet
- 331 VAR
- 332 TypeCode: CARDINAL;
- 333 BEGIN
- 334 GenLists.GetElmt( TheList, spot, TheStr, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 335 IF TypeCode # GenLists.StrCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 336 ErrorManager.WARN('Not a string');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 337 END;
- 338 END GetStr;
- ***** ^ not supported yet
- 339
- 340 PROCEDURE HandleToList( TheHandle : VStorage.MemHandle;
- ***** ^ not supported yet
- 341 BlockSize : CARDINAL; delimiter1, delimiter2 : ARRAY OF
- 342 CHAR; RecSize, TypeCode : CARDINAL; VAR TheList : GenLists.GenList);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 343 VAR
- 344 BytesDone, Delim1Len, Delim2Len : CARDINAL;
- 345 TwoDelimiters, FixedLengthRecs : BOOLEAN;
- 346
- 347 PROCEDURE AnElmtStartsHere( OffSet: CARDINAL ): BOOLEAN;
- 348 VAR
- 349 TmpAdr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 350 BEGIN
- 351 IF FixedLengthRecs OR (NOT TwoDelimiters) THEN
- 352 RETURN FALSE;
- 353 END;
- 354 TmpAdr := VStorage.LockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 355 VStorage.UnLockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 356 LowLevel.IncAddr( TmpAdr, OffSet );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 357 IF (BytesDone >= BlockSize) OR (0 = PosUtils.PosAdr(
- ***** ^ not supported yet
- ***** ^ not supported yet
- 358 delimiter1, TmpAdr, BlockSize - BytesDone)) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 359 RETURN TRUE;
- 360 END;
- 361 RETURN FALSE;
- 362 END AnElmtStartsHere;
- ***** ^ not supported yet
- 363
- 364 PROCEDURE AnElmtEndsHere( OffSet: CARDINAL ): BOOLEAN;
- 365 VAR
- 366 TmpAdr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 367 BEGIN
- 368 IF FixedLengthRecs OR (NOT TwoDelimiters) THEN
- 369 RETURN FALSE;
- 370 END;
- 371 TmpAdr := VStorage.LockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 372 VStorage.UnLockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 373 LowLevel.IncAddr( TmpAdr, OffSet );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 374 IF (BytesDone >= BlockSize) OR (0 = PosUtils.PosAdr(
- ***** ^ not supported yet
- ***** ^ not supported yet
- 375 delimiter2, TmpAdr, BlockSize - BytesDone)) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 376 RETURN TRUE;
- 377 END;
- 378 RETURN FALSE;
- 379 END AnElmtEndsHere;
- ***** ^ not supported yet
- 380
- 381 PROCEDURE SizeOfElement( OldAdr: SYSTEM.ADDRESS ): CARDINAL;
- ***** ^ not supported yet
- 382 (*Returns the address of the first byte following delimiter2,
- 383 but dist includes only the bytes preceding delimiter2.*)
- 384 BEGIN
- 385 IF FixedLengthRecs THEN
- 386 RETURN RecSize;
- 387 ELSE
- 388 RETURN PosUtils.PosAdr( delimiter2, OldAdr, BlockSize-BytesDone);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 389 END;
- 390 END SizeOfElement;
- ***** ^ not supported yet
- 391
- 392 PROCEDURE MakeOneList( TheList : GenLists.GenList );
- ***** ^ not supported yet
- 393 VAR
- 394 TmpTypeCode, TmpSize: CARDINAL;
- 395 TmpAdr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 396 SubList : GenLists.GenList;
- ***** ^ not supported yet
- 397 BEGIN
- 398 LOOP
- 399 IF TwoDelimiters THEN
- 400 LOOP
- 401 (*Skip the leading delim1, if there is one, and
- 402 move at least to the byte just beyond the next
- 403 delim1.*)
- 404 IF AnElmtStartsHere(BytesDone) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 405 INC( BytesDone, Delim1Len );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 406 EXIT;
- 407 ELSE
- 408 INC( BytesDone, Delim1Len );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 409 END;
- 410 END;
- 411 END;
- 412 IF (BytesDone >= BlockSize) THEN
- 413 EXIT;
- 414 END;
- 415 IF (TypeCode < 65000)
- 416 AND (NOT FixedLengthRecs)
- 417 AND TwoDelimiters THEN
- 418 TmpAdr := VStorage.LockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 419 LowLevel.IncAddr( TmpAdr, BytesDone );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 420 LowLevel.Move( TmpAdr, SYSTEM.ADR(TmpTypeCode), 2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 421 VStorage.UnLockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 422 INC( BytesDone, 2 );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 423 ELSE
- 424 TmpTypeCode := TypeCode;
- 425 END;
- 426 IF (TmpTypeCode = GenLists.ListCode) OR AnElmtStartsHere(
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 427 BytesDone ) THEN
- ***** ^ not supported yet
- 428 GenLists.NewList( SubList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 429 IF AnElmtEndsHere( BytesDone ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 430 (*Null list.*)
- 431 INC( BytesDone, Delim2Len );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 432 ELSE
- 433 MakeOneList( SubList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 434 END;
- 435 GenLists.ListInsert( SubList, GenLists.ListCode, TheList, 65535 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 436 ELSE
- 437 TmpAdr := VStorage.LockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 438 VStorage.UnLockMem( TheHandle );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 439 LowLevel.IncAddr( TmpAdr, BytesDone );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 440 TmpSize := SizeOfElement( TmpAdr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 441 GenLists.ListInsertAdr( TmpAdr, TmpSize, TmpTypeCode,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 442 TheList, 65535 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 443 INC( BytesDone, TmpSize + Delim2Len );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 444 END;
- 445 IF (BytesDone >= BlockSize) OR (AnElmtEndsHere(BytesDone)) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 446 (*Increment past the delimiter2 that ends the whole list.*)
- 447 INC( BytesDone, Delim2Len );
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 448 EXIT;
- 449 END;
- 450 END;
- 451 END MakeOneList;
- ***** ^ not supported yet
- 452
- 453 BEGIN
- 454 (*HandleToList*)
- 455 IF NOT GenLists.Initialized( TheList ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 456 InitResponse( 'HandleToList' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 457 END;
- 458 Delim1Len := M2Strings.Length(delimiter1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 459 Delim2Len := M2Strings.Length(delimiter2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 460 TwoDelimiters := FALSE;
- 461 IF ((Delim1Len>0) OR (Delim2Len>0)) AND (RecSize>0) THEN
- 462 ErrorManager.WARN("Delim-RecSize conflict");
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 463 RETURN;
- 464 END;
- 465 FixedLengthRecs := RecSize>0;
- 466 IF FixedLengthRecs THEN
- 467 IF ((BlockSize MOD RecSize) # 0) THEN
- 468 ErrorManager.WARN('Bad Recsize');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 469 RETURN;
- 470 END;
- 471 ELSE
- 472 IF NOT PosUtils.Equal(delimiter1,delimiter2) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 473 TwoDelimiters := TRUE;
- 474 END;
- 475 END;
- 476
- 477 BytesDone := 0;
- 478
- 479 MakeOneList( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 480
- 481 VStorage.DeallocMem( TheHandle, BlockSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 482 END HandleToList;
- ***** ^ not supported yet
- 483
- 484
- 485 (*$O-*)
- 486 (*We turn off optimization for this procedure because of a bug in
- 487 Logitech's v3.0.*)
- 488
- 489 PROCEDURE ListToFileHandle( TheList: GenLists.GenList; TheHandle:
- ***** ^ not supported yet
- 490 CARDINAL; delim1, delim2: ARRAY OF CHAR;
- ***** ^ not supported yet
- 491 InitialNestingLevel: CARDINAL; VAR BytesWritten:
- 492 LONGINT ): CARDINAL;
- 493 VAR
- 494 TmpAdr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 495 LstCount, LstLngth, TypeCode, TmpSize, DumRecSz,
- 496 Delim1Lngth, Delim2Lngth, tmpc: CARDINAL;
- 497 SubList: GenLists.GenList;
- ***** ^ not supported yet
- 498 NilList, TwoDelimiters: BOOLEAN;
- 499 SavedMessage: CARDINAL;
- 500 TmpL, TmpBytesWritten: LONGINT;
- 501
- 502 BEGIN
- 503 BytesWritten := NumTypes.L0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 504 Delim1Lngth := M2Strings.Length( delim1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 505 Delim2Lngth := M2Strings.Length( delim2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 506 TwoDelimiters := (Delim1Lngth > 0) AND (Delim2Lngth > 0);
- 507 (*We begin and end the procedure by bracketing the
- 508 entire block with a StartSep and EndSep, if the
- 509 parameter list indicates that they're in use. That's
- 510 the convention NdxFiles uses to indicate that the block
- 511 as a whole represents a list.*)
- 512 IF (Delim1Lngth > 0) AND (InitialNestingLevel = 0) THEN
- 513 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 514 SYSTEM.ADR(delim1), Delim1Lngth );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 515 TmpL := Numbers.Lc(Delim1Lngth);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 516 (*Necessary because of a bug in Logitech's LONGINT
- 517 addition.*)
- 518 BytesWritten := BytesWritten + TmpL;
- 519 END;
- 520 IF TwoDelimiters AND (InitialNestingLevel = 0) THEN
- 521 tmpc := GenLists.ListCode;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 522 (*We have to do this because some implementations won't
- 523 give us the address of a constant.*)
- 524 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 525 SYSTEM.ADR(tmpc), SYSTEM.TSIZE(CARDINAL) );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 526 BytesWritten := BytesWritten + Numbers.Lc(SYSTEM.TSIZE(CARDINAL));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 527 END;
- 528 IF GenLists.Initialized( TheList ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 529 NilList := FALSE;
- 530 ELSE
- 531 GenLists.NewList( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 532 NilList := TRUE;
- 533 END;
- 534 GenLists.ListToBlock( TheList, delim1, delim2,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 535 TmpAdr, TmpSize, DumRecSz);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 536 IF (GenLists.ErrorFlag = GenLists.NoListError) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 537 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 538 TmpAdr, TmpSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 539 (*Write the Ndx as a single block.*)
- 540 VStorage.DosDealloc( TmpAdr, TmpSize);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 541 (*Get rid of temporary buffer space used.*)
- 542 BytesWritten := BytesWritten + Numbers.Lc(TmpSize);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 543 IF (Delim2Lngth > 0) AND (InitialNestingLevel = 0) THEN
- 544 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 545 SYSTEM.ADR(delim2), Delim2Lngth );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 546 BytesWritten := BytesWritten + Numbers.Lc(Delim2Lngth);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 547 END;
- 548 IF NilList THEN
- 549 GenLists.DisposeList( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 550 END;
- 551 RETURN SavedMessage;
- 552 END;
- 553 (*Write the NdxElements one by one if there isn't
- 554 enough memory to write them as a block.*)
- 555 LstLngth := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 556 LstCount := 1;
- 557 WHILE LstCount <= LstLngth DO
- 558 GenLists.GetElmtAdr( TheList, LstCount, TmpAdr,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 559 TmpSize, TypeCode );
- ***** ^ not supported yet
- 560 IF Delim1Lngth > 0 THEN
- 561 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 562 SYSTEM.ADR(delim1), Delim1Lngth );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 563 BytesWritten := BytesWritten + Numbers.Lc(Delim1Lngth);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 564 END;
- 565 IF TwoDelimiters THEN
- 566 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 567 SYSTEM.ADR(TypeCode), SYSTEM.TSIZE(CARDINAL) );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 568 BytesWritten := BytesWritten + Numbers.Lc(SYSTEM.TSIZE(CARDINAL));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 569 END;
- 570 IF TypeCode = GenLists.ListCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 571 GenLists.GetChildList( TheList, LstCount, SubList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 572 SavedMessage := ListToFileHandle( SubList, TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 573 delim1, delim2, InitialNestingLevel + 1,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 574 TmpBytesWritten );
- ***** ^ not supported yet
- 575 BytesWritten := BytesWritten + TmpBytesWritten;
- 576 IF SavedMessage # StringIO.NoError THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 577 IF NilList THEN
- 578 GenLists.DisposeList( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 579 END;
- 580 RETURN SavedMessage;
- 581 END;
- 582 ELSE
- 583 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 584 TmpAdr, TmpSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 585 BytesWritten := BytesWritten + Numbers.Lc( TmpSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 586 END;
- 587 IF Delim2Lngth > 0 THEN
- 588 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 589 SYSTEM.ADR(delim2), Delim2Lngth );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 590 BytesWritten := BytesWritten + Numbers.Lc(Delim2Lngth);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 591 END;
- 592 INC(LstCount);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 593 END;
- 594 IF (Delim2Lngth > 0) AND (InitialNestingLevel = 0) THEN
- 595 SavedMessage := HandleIO.BlockWrite( TheHandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 596 SYSTEM.ADR(delim2), Delim2Lngth );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 597 BytesWritten := BytesWritten + Numbers.Lc(Delim2Lngth);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 598 END;
- 599 IF NilList THEN
- 600 GenLists.DisposeList( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 601 END;
- 602 RETURN SavedMessage;
- 603 END ListToFileHandle;
- ***** ^ not supported yet
- 604 (*$O=*)
- 605
- 606
- 607 PROCEDURE InsertElmtsOf( List1: GenLists.GenList; StartingAt,
- ***** ^ not supported yet
- 608 NumberOfLines: CARDINAL; VAR List2: GenLists.GenList;
- ***** ^ not supported yet
- 609 InsertionPoint: CARDINAL );
- 610 VAR
- 611 cnt, tmpsize, TypeCode, List2Lngth : CARDINAL;
- 612 tmpadr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 613 BEGIN
- 614 NumberOfLines := Numbers.Min( NumberOfLines,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 615 GenLists.ListLength( List1 ) );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 616 List2Lngth := GenLists.ListLength( List2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 617 IF Numbers.Lc(InsertionPoint) +
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 618 Numbers.Lc( NumberOfLines ) > NumTypes.L65535 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 619 InsertionPoint := List2Lngth + 1;
- 620 END;
- 621 FOR cnt := 1 TO NumberOfLines DO
- 622 GenLists.GetElmtAdr( List1, StartingAt + cnt - 1, tmpadr,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 623 tmpsize, TypeCode );
- ***** ^ not supported yet
- 624 GenLists.ListInsertAdr( tmpadr, tmpsize, TypeCode, List2,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 625 InsertionPoint + (cnt - 1) );
- ***** ^ not supported yet
- 626 END;
- 627 END InsertElmtsOf;
- ***** ^ not supported yet
- 628
- 629
- 630 PROCEDURE InsertIntoElmt( VAR TheList: GenLists.GenList;
- ***** ^ not supported yet
- 631 ListSpot: CARDINAL; StrAdr: SYSTEM.ADDRESS; StrSize:
- ***** ^ not supported yet
- 632 CARDINAL; ElmtSpot: CARDINAL );
- 633 VAR
- 634 tmpadr1, tmpadr2: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 635 TypeCode, tmpsize: CARDINAL;
- 636 BEGIN
- 637 GenLists.GetElmtAdr( TheList, ListSpot, tmpadr1, tmpsize, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 638 (* Make sure we're inserting into a string. *)
- 639 IF TypeCode # GenLists.StrCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 640 ErrorManager.WARN('Not a string');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 641 END;
- 642 tmpsize := LowLevel.ScanEQ( tmpsize, 0C, tmpadr1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 643 (* This means you can insert your string at ElmtSpot 65535 and
- 644 have it neatly appended. *)
- 645 IF ElmtSpot > tmpsize THEN
- 646 ElmtSpot := tmpsize;
- 647 END;
- 648 VStorage.DosAlloc( tmpadr2, tmpsize + StrSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 649 LowLevel.Move( tmpadr1, tmpadr2, ElmtSpot );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 650 LowLevel.Move( StrAdr, LowLevel.AddAddr(tmpadr2, ElmtSpot), StrSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 651 LowLevel.Move( LowLevel.AddAddr(tmpadr1, ElmtSpot),
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 652 LowLevel.AddAddr(tmpadr2, ElmtSpot + StrSize), tmpsize - ElmtSpot );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 653 GenLists.ListReplaceAdr( tmpadr2, tmpsize + StrSize, GenLists.StrCode,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 654 TheList, ListSpot );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 655 VStorage.DosDealloc( tmpadr2, tmpsize + StrSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 656 END InsertIntoElmt;
- ***** ^ not supported yet
- 657
- 658
- 659 PROCEDURE IsBlankList( TheList: GenLists.GenList ): BOOLEAN;
- ***** ^ not supported yet
- 660 (*We use this procedure to test Editor fields that have been
- 661 marked "required."*)
- 662 VAR
- 663 SomethingFound: BOOLEAN;
- 664 lngth, cnt, TypeCode: CARDINAL;
- 665 LocalStr: ARRAY [0..127] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 666 BEGIN
- 667 IF NOT GenLists.Initialized(TheList) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 668 RETURN TRUE;
- 669 END;
- 670 SomethingFound := FALSE;
- 671 lngth := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 672 cnt := 1;
- 673 WHILE (cnt <= lngth) AND (NOT SomethingFound) DO
- 674 GenLists.GetElmt( TheList, cnt, LocalStr, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 675 SomethingFound := (TypeCode # GenLists.StrCode) OR (NOT
- ***** ^ not supported yet
- ***** ^ not supported yet
- 676 PosUtils.IsBlank( LocalStr ));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 677 INC(cnt);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 678 END;
- 679 RETURN NOT SomethingFound;
- 680 END IsBlankList;
- ***** ^ not supported yet
- 681
- 682
- 683 PROCEDURE ListToString( TheList: GenLists.GenList; VAR TheStr: ARRAY OF CHAR);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 684 VAR
- 685 tmpstr: ARRAY [0..255] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 686 lngth, TypeCode, cnt: CARDINAL;
- 687 BEGIN
- 688 lngth := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 689 StrEdit.SetLength( TheStr, 0 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 690 FOR cnt := 1 TO lngth DO
- 691 GenLists.GetElmt( TheList, cnt, tmpstr, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 692 IF TypeCode = GenLists.StrCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 693 StrEdit.Append( TheStr, tmpstr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 694 END;
- 695 END;
- 696 END ListToString;
- ***** ^ not supported yet
- 697
- 698
- 699
- 700 PROCEDURE LongestLine( TheList: GenLists.GenList ): CARDINAL;
- ***** ^ not supported yet
- 701 VAR
- 702 LstLngth, lngth, cnt, longest: CARDINAL;
- 703 BEGIN
- 704 LstLngth := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 705 longest := 0;
- 706 FOR cnt := 1 TO LstLngth DO
- 707 lngth := ElmtSize( TheList, cnt );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 708 IF lngth > longest THEN
- 709 longest := lngth;
- 710 END;
- 711 END;
- 712 RETURN longest;
- 713 END LongestLine;
- ***** ^ not supported yet
- 714
- 715
- 716 PROCEDURE OverwriteElmt( VAR TheList: GenLists.GenList;
- ***** ^ not supported yet
- 717 ListSpot: CARDINAL; StrAdr: SYSTEM.ADDRESS; StrSize:
- ***** ^ not supported yet
- 718 CARDINAL; ElmtSpot: CARDINAL );
- 719 VAR
- 720 tmpadr1, tmpadr2: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 721 excess, TypeCode, tmpsize: CARDINAL;
- 722 BEGIN
- 723 GenLists.GetElmtAdr( TheList, ListSpot, tmpadr1, tmpsize, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 724 IF TypeCode # GenLists.StrCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 725 ErrorManager.WARN('Not a string');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 726 END;
- 727 IF tmpsize >= (ElmtSpot + StrSize) THEN
- 728 LowLevel.Move( StrAdr, LowLevel.AddAddr(tmpadr1, ElmtSpot), StrSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 729 ELSE
- 730 excess := (ElmtSpot + StrSize) - tmpsize;
- 731 VStorage.DosAlloc( tmpadr2, tmpsize + excess );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 732 LowLevel.Move( tmpadr1, tmpadr2, ElmtSpot );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 733 LowLevel.Move( StrAdr, LowLevel.AddAddr(tmpadr2, ElmtSpot), StrSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 734 GenLists.ListReplaceAdr( tmpadr2, tmpsize + excess,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 735 GenLists.StrCode, TheList, ListSpot );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 736 VStorage.DosDealloc( tmpadr2, tmpsize + excess );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 737 END;
- 738 END OverwriteElmt;
- ***** ^ not supported yet
- 739
- 740
- 741 PROCEDURE ObjectSpot( BinaryObject : ARRAY OF SYSTEM.BYTE;
- ***** ^ not supported yet
- 742 TheList : GenLists.GenList; StartingAt, EndingAt :
- ***** ^ not supported yet
- 743 CARDINAL) : CARDINAL;
- 744 VAR
- 745 cnt, ListEnd, ObjSize, TmpSize, TypeCode : CARDINAL;
- 746 TmpAdr : SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 747 BEGIN
- 748 (*ObjectSpot*)
- 749 ListEnd := GenLists.ListLength( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 750 IF ListEnd < EndingAt THEN
- 751 EndingAt := ListEnd;
- 752 END;
- 753 IF StartingAt > EndingAt THEN
- 754 RETURN 0;
- 755 END;
- 756 ObjSize := HIGH( BinaryObject ) + 1;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 757 FOR cnt := StartingAt TO EndingAt DO
- 758 GenLists.GetElmtAdr( TheList, cnt, TmpAdr, TmpSize, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 759 IF TmpSize = ObjSize THEN
- 760 IF PosUtils.PatternScan( SYSTEM.ADR(BinaryObject), ObjSize,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 761 TmpAdr, TmpSize ) = 0 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 762 RETURN cnt;
- 763 END;
- 764 END;
- 765 END;
- 766 RETURN 0;
- 767 (*BinaryObject not found between StartingAt and EndingAt.*)
- 768 END ObjectSpot;
- ***** ^ not supported yet
- 769
- 770
- 771 PROCEDURE PrintList( fhandle: CARDINAL; TheList : GenLists.GenList;
- ***** ^ not supported yet
- 772 LeftMargin: CARDINAL; Separator: ARRAY OF CHAR );
- ***** ^ not supported yet
- 773
- 774 PROCEDURE PrintRecursive( fhandle: CARDINAL; TheList :
- 775 GenLists.GenList; Separator: ARRAY OF CHAR; InSubList:
- ***** ^ not supported yet
- ***** ^ not supported yet
- 776 BOOLEAN );
- 777 VAR
- 778 SubLeader, TmpStr : ARRAY [0..80] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 779 SubList : GenLists.GenList;
- ***** ^ not supported yet
- 780 TmpSiz, cnt, ListLen, TypeCode, spot : CARDINAL;
- 781 FirstTime: BOOLEAN;
- 782 TmpAdr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 783
- 784 BEGIN
- 785 IF InSubList THEN
- 786 StringIO.PrintMessage( HandleIO.FillFile( fhandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 787 LeftMargin, ' ' ) );
- ***** ^ not supported yet
- 788 StringIO.WriteStr( fhandle, '{' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 789 END;
- 790 FirstTime := TRUE;
- 791 spot := 1;
- 792 ListLen := GenLists.ListLength(TheList);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 793 IF GenLists.ErrorFlag # GenLists.NoListError THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 794 ErrorManager.WARN('Uninitialized list?');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 795 END;
- 796 REPEAT
- 797 IF spot<=ListLen THEN
- 798 GenLists.GetElmtAdr( TheList, spot, TmpAdr, TmpSiz, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 799 IF TypeCode=GenLists.ListCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 800 GenLists.GetChildList(TheList, spot, SubList);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 801 PrintRecursive( fhandle, SubList, Separator, TRUE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 802 ELSE
- 803 IF FirstTime THEN
- 804 FirstTime := FALSE;
- 805 ELSE
- 806 StringIO.WriteStr( fhandle, Separator );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 807 END;
- 808 IF TypeCode = GenLists.StrCode THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 809 GetStr( TheList, spot, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 810 IF PosUtils.Present( Separator, TmpStr ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 811 StringIO.WriteStr( fhandle, '"' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 812 StringIO.WriteStr( fhandle, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 813 StringIO.WriteStr( fhandle, '"' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 814 ELSE
- 815 StringIO.PrintMessage( HandleIO.FillFile( fhandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 816 LeftMargin, ' ' ) );
- ***** ^ not supported yet
- 817 StringIO.WriteStr( fhandle, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 818 END;
- 819 ELSE
- 820 StrConv.CardinalToStr( spot, 2, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 821 StringIO.PrintMessage( HandleIO.FillFile( fhandle,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 822 LeftMargin, ' ' ) );
- ***** ^ not supported yet
- 823 StringIO.WriteStr( fhandle, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 824 StringIO.WriteStr( fhandle, ': ' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 825 StringIO.WriteStr( fhandle, 'Size = ' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 826 StrConv.CardinalToStr( TmpSiz, 4, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 827 StringIO.WriteStr( fhandle, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 828 StringIO.WriteStr( fhandle, '; Type = ' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 829 StrConv.CardinalToStr( TypeCode, 0, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 830 StringIO.WriteStr( fhandle, TmpStr );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 831 END;
- 832 END;
- 833 END;
- 834 INC(spot);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 835 UNTIL spot>ListLen;
- 836 IF InSubList THEN
- 837 StringIO.WriteStr( fhandle, '}' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 838 END;
- 839 END PrintRecursive;
- ***** ^ not supported yet
- 840
- 841 BEGIN (* PrintList *)
- 842 PrintRecursive( fhandle, TheList, Separator, FALSE );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 843 (*We don't call PrintList itself recursively because we
- 844 don't want the CrLf from the WriteEol below to follow
- 845 embedded lists.*)
- 846 StringIO.WriteEol( fhandle, '' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 847 END PrintList;
- ***** ^ not supported yet
- 848
- 849
- 850 PROCEDURE TextFileToList( VAR TheFile: ARRAY OF CHAR;
- ***** ^ not supported yet
- 851 VAR TheList: GenLists.GenList): CARDINAL;
- ***** ^ not supported yet
- 852 (* finds the file, reads it into the list, closes the file *)
- 853 VAR
- 854 SizeLeft, SizeOK, DoSizeL : LONGINT;
- 855 ResultErr: CARDINAL;
- 856 NextList: GenLists.GenList;
- ***** ^ not supported yet
- 857 DoSizeC, TheHandl : CARDINAL;
- 858 GoBack : INTEGER;
- 859 buffer: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 860 BEGIN
- 861 IF NOT GenLists.Initialized( TheList ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 862 InitResponse( 'TextFileToList' );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 863 END;
- 864 ResultErr := HandleIO.FindFile( TheHandl, TheFile, 'PATH');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 865 IF StringIO.NoError # ResultErr THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 866 RETURN ResultErr;
- 867 END;
- 868 SizeLeft := HandleIO.FileLength( TheHandl);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 869 WHILE SizeLeft # Numbers.Lc( 0) DO
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 870 (* first, get a mem block <= 65000 bytes *)
- 871 DoSizeC := 65000;
- 872 IF NOT VStorage.DosAvail( DoSizeC) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 873 (* If there's not a 64K chunk available, get as much as there
- 874 is.*)
- 875 DoSizeC := EnvironUtils.MemAvail( 100);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 876 END;
- 877 SizeOK := Numbers.Lc( DoSizeC);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 878 IF ( SizeLeft > SizeOK)
- 879 AND ( Numbers.Lc( 64000) > SizeLeft) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 880 GenLists.DisposeList( TheList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 881 ResultErr := HandleIO.CloseHandle( TheHandl);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 882 RETURN StringIO.TooLittleMemory;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 883 END;
- 884 IF SizeLeft > SizeOK THEN
- 885 DoSizeL := SizeOK;
- 886 ELSE
- 887 DoSizeL := SizeLeft;
- 888 END;
- 889 SizeLeft := SizeLeft - DoSizeL;
- 890 DoSizeC := Numbers.C( DoSizeL );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 891 IF NOT VStorage.DosAvail( DoSizeC ) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 892 ResultErr := HandleIO.CloseHandle( TheHandl);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 893 RETURN StringIO.TooLittleMemory;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 894 END;
- 895 VStorage.DosAlloc( buffer, DoSizeC );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 896 ResultErr := HandleIO.BlockRead( TheHandl, buffer, DoSizeC);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 897 IF StringIO.NoError # ResultErr THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 898 ResultErr := HandleIO.CloseHandle( TheHandl);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 899 RETURN ResultErr;
- 900 END;
- 901 IF SizeLeft # Numbers.Lc( 0) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 902 GoBack := LowLevel.ScanEQ( -32000, 12C,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 903 LowLevel.AddAddr(buffer, DoSizeC - 1) );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 904 (* to locate a cut-ff line, look for the last
- 905 line-feed character before the end of the block *)
- 906 IF GoBack = -32000 THEN
- 907 (* No LF found in last 32000 bytes of block *)
- 908 ResultErr := HandleIO.CloseHandle( TheHandl);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 909 RETURN StringIO.BadData;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 910 END;
- 911 DoSizeL := Numbers.Lc( -GoBack );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 912 SizeLeft := SizeLeft + DoSizeL;
- 913 DoSizeL := -DoSizeL;
- 914 HandleIO.SetFilePtr( TheHandl, HandleIO.FromCurrent, DoSizeL);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 915 (* change file position and counters to start from
- 916 beginning of the line that was cut off *)
- 917 END;
- 918 GenLists.NewList( NextList );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 919 GenLists.BlockToList( buffer, DoSizeC, StringIO.CrLf,
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 920 StringIO.CrLf, 0, GenLists.StrCode, NextList);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 921 GenLists.JoinLists( NextList, TheList, 65535);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 922 END;
- 923 ResultErr := HandleIO.CloseHandle( TheHandl);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 924 RETURN ResultErr;
- 925 END TextFileToList;
- ***** ^ not supported yet
- 926
- 927
- 928 PROCEDURE TextListToFile( VAR TheList: GenLists.GenList;
- ***** ^ not supported yet
- 929 TheFile: ARRAY OF CHAR): CARDINAL;
- ***** ^ not supported yet
- 930 (* creates the file; writes the list to it and closes file *)
- 931 VAR
- 932 StrAdr1, StrAdr2: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 933
- 934 StrSize, DumType, SizeL, TheHandl, cnt: CARDINAL;
- 935 ResultErr: CARDINAL;
- 936 TmpCrLf: ARRAY [0..2] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 937 BEGIN
- 938 StrEdit.AssignStr( StringIO.CrLf, TmpCrLf );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 939 ResultErr := HandleIO.CreateFile( TheHandl, TheFile);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 940 IF StringIO.NoError # ResultErr THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 941 RETURN ResultErr;
- 942 END;
- 943 SizeL := GenLists.ListLength( TheList);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 944 FOR cnt := 1 TO SizeL DO
- 945 GenLists.GetElmtAdr( TheList, cnt, StrAdr1, StrSize, DumType);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 946 StrSize := LowLevel.ScanEQ( StrSize, 0C, StrAdr1 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 947 (* Reduce StrSize to number of bytes before the null. *)
- 948 VStorage.DosAlloc( StrAdr2, StrSize + 2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 949 LowLevel.Move( StrAdr1, StrAdr2, StrSize );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 950 LowLevel.Move( SYSTEM.ADR(TmpCrLf),
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 951 LowLevel.AddAddr(StrAdr2, StrSize), 2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 952 ResultErr := HandleIO.BlockWrite( TheHandl,
- ***** ^ not supported yet
- ***** ^ not supported yet
- 953 StrAdr2, StrSize + 2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- 954 VStorage.DosDealloc( StrAdr2, StrSize + 2 );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 955 IF StringIO.NoError # ResultErr THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 956 RETURN ResultErr;
- 957 END;
- 958 END;
- 959 ResultErr := HandleIO.CloseHandle( TheHandl);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 960 RETURN ResultErr;
- 961 END TextListToFile;
- ***** ^ not supported yet
- 962
- 963
- 964 PROCEDURE TypeCheck( TheList: GenLists.GenList; spot: CARDINAL ): CARDINAL;
- ***** ^ not supported yet
- 965 VAR
- 966 DumAddr: SYSTEM.ADDRESS;
- ***** ^ not supported yet
- 967 TheSize, TypeCode: CARDINAL;
- 968 BEGIN
- 969 GenLists.GetElmtAdr( TheList, spot, DumAddr, TheSize, TypeCode );
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 970 RETURN TypeCode;
- 971 END TypeCheck;
- ***** ^ not supported yet
- 972
- 973
- 974 BEGIN
- 975 Initialized := FALSE;
- 976 Init();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 977 END ListUtils.
- ***** ^ not supported yet
- 1178 errors
|