IMD 1.16: 29/05/2007 12:23:32 FOGCPM.028 ååååååååååååååå--FOGCPM028SLIST PAS^ SLIST1 INC4SLIST2 INC+SLIST3 INC, !SYSCONSTCON"SYSTYPE TYP#SYSVAR VAR$CENTER FNC %&CPM PRC"'()*+CRT PRC,-DISKFILEFNC.HEXTOCHRFNC /0LCRJUST FNC 12LST PRC3MANYCHARFNC4REPLACE FNC 56SAYBOOL FNC7SQUEEZE FNC 89SYSINIT PRC :;TRIM FNC <=WAIT PRC>FOGSTORECOM]?@ABCDEFGHIJFOGSTOREDOC0KLMNOPFOGSTOREPAS+QRSTUVMONEY2 COMvWXYZ[\]^_`abcdeMONEY2 DOCfghMONEY2 PAS\ijklmnopqrstSORTS COM`uvwxyz{|}~€SORTS DOC�‚ƒSORTS PASq„…†‡ˆ‰Š‹Œ�Ž��‘’PICTURE DOC0“”•–—˜PICTURE PAS ™šGETPIC FNCE›œ�žŸ ¡¢£SAYPIC FNCE¤¥¦§¨©ª«¬-02-00 86 ­-CPM028 DOC®¯°±ååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååThis is the disk name. åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå{.L+ } program SList; (*************************************************) (* SLIST Version 1.00A - CP/M, Z80 *) (* *) (* (C) Copyright 1985, Herb Bowie. *) (* All commercial rights reserved. This *) (* program is licensed for non-commercial use. *) (* *) (* Have you payed for this program yet? If not, *) (* and you find it useful, then may I suggest *) (* that you make a small donation to its author? *) (* Something like $10 would be wonderful. You *) (* may send it to: *) (* *) (* Herb Bowie *) (* P.O. Box 4724 *) (* Culver City, CA 90231-4724 *) (* *) (*************************************************) (* NAME Slist.Pas AUTHOR Herb Bowie. FUNCTION Prints Turbo Pascal source code, and/or documentation. *) type {$I A:SysType.Typ } const {$I A:SysConst.Con } PIi = 1; PTi = 2; HEi = 3; FOi = 4; SXi = 5; FFi = 6; BEi = 7; CMi = 8; CCi = 9; SQi = 10; ICi = 11; PLi = 12; LLi = 13; POi = 14; MTi = 15; HMi = 16; MBi = 17; FMi = 18; MaxCodes = 24; ReservedWords = 148; CRTRows : integer = 24; CRTColumns : integer = 52; First : boolean = true; FilePic : string [14] = 'F:FFFFFFFF.FFF'; InName : string [14] = 'A:.PAS'; ErrorMsg : string [80] = ''; IdStartChars : set of char = ['A'..'Z', '_']; IdChars : set of char = ['0'..'9', 'A'..'Z', '_']; type String2 = string [2]; String10 = string [10]; String14 = string [14]; String23 = string [23]; String128 = string [128]; CodeIndexType = 1..MaxCodes; RsvWordIndexType = 1..ReservedWords; var {$I A:SysVar.Var } CtrlFile : text; ListFile : text; InFile : text; IncFile : text; SXFile : text; RsvFile : text; InRec : string [135]; WorkLine : string [192]; Word : string [128]; OutLine : string [192]; TempLine : string [192]; LastName : string [14]; IncName : string [14]; SXName : string [14]; SXString : string [133]; PageStr : string [5]; CommentValue : string [128]; NextChar : char; CurrChar : char; LastChar : char; WorkBool : char; SXDrive : char; SXOption : char; LastLine : integer; BCount : integer; KCount : integer; PageCt : integer; LineCt : integer; NextSeqCt : integer; SeqCt : integer; SeqCtWritten : integer; InLng : integer; DataLng : integer; PrefixLng : integer; CI : integer; LastCI : integer; CurrCI : integer; NextCI : integer; I, J : integer; IncStart : integer; RsvIndex : integer; CRTLine : integer; AnotherFile : boolean; SXOpen : boolean; LineToPrint : boolean; PrintingLines : boolean; FormatOnLine : boolean; OldLineDone : boolean; IncOn : boolean; PageBegun : boolean; RsvLoaded : boolean; CodeWork : String [2]; CodeNumber : integer; CodeNum : CodeIndexType; CodeIndex : CodeIndexType; Code : array [CodeIndexType] of String2; CodeType : array [CodeIndexType] of char; CodeDesc : array [CodeIndexType] of String23; CodeMaxLng : array [CodeIndexType] of integer; CodeInt : array [CodeIndexType] of integer; CodeStr : array [1..4] of String128; CodeBool : array [CodeIndexType] of boolean; RsvPtr : array [1..26] of integer; ReservedWord : array [RsvWordIndexType] of String10; {$I A:Center.Fnc } {$I A:CPM.Prc } {$I A:CRT.Prc } {$I A:DiskFile.Fnc } {$I A:HexToChr.Fnc } {$I A:LCRJust.Fnc } {$I A:LST.Prc } {$I A:ManyChar.Fnc } {$I A:Replace.Fnc } {$I A:Squeeze.Fnc } {$I A:SysInit.Prc } {$I A:SayBool.Fnc } {$I A:Trim.Fnc } {$I A:Wait.Prc } {$I A:GetPic.Fnc } {$I A:SayPic.Fnc } procedure WriteMsg; (* Writes message at bottom of screen *) begin gotoxy (1, CRTRows); clreol; if ErrorMsg <> '' then begin CRTBeep; write (Center (ErrorMsg, CRTColumns)); end; end; procedure Clean; (* Clears screen and positions cursor *) begin clrscr; writeln ('SLIST Turbo Pascal Source Lister ', InName); WriteMsg; gotoxy (1, 3); end; procedure WriteSeqCt; begin gotoxy (3, CRTLine); write (NextSeqCt:5); SeqCtWritten := NextSeqCt; end; procedure WriteFileLine (FileName: String14); begin if CRTLine > 5 then WriteSeqCt; if (CRTLine < (CRTRows - 2)) then CRTLine := CRTLine + 1 else begin gotoxy (1, 5); delline; end; WriteSeqCt; write (' ', FileName); end; {$I B:SLIST1.INC } {$I B:SLIST2.INC } {$I B:SLIST3.INC } procedure SXRef; type DataItemType = record Seq : integer; Word : string [64]; end; var DataItem : DataItemType; SortResult: integer; ItemSize : integer; SortInCt : integer; SortOutCt : integer; LastSortCt: integer; ValCode : integer; WordLength: integer; {$I B:Sort.Box } procedure Inp; begin reset (SXFile); SortInCt := 0; LastSortCt := 0; gotoxy (1, 8); write (' Records released to Sort'); while not eof (SXFile) do begin readln (SXFile, SXString); val (squeeze (copy (SXString, 1, 5), Blank),  DataItem.Seq, ValCode); if ValCode > 0 then DataItem.Seq := 0; WordLength := length (SXString) - 6; if WordLength > 64 then WordLength := 64; DataItem.Word := copy (SXString, 7, WordLength); SortRelease (DataItem); SortInCt := succ (SortInCt); if SortInCt > (LastSortCt + 9) then begin gotoxy (1, 8); write (SortInCt: 5); LastSortCt := SortInCt; end; end; gotoxy (1, 8); write (SortInCt:5); close (SXFile); gotoxy (1, 10); writeln ('Sorting file now...'); end; function Less; var Rec1 : DataItemType absolute X; Rec2 : DataItemType absolute Y; begin Less := ((Rec1.Word < Rec2.Word) or ((Rec1.Word = Rec2.Word) and (Rec1.Seq < Rec2.Seq))); end; procedure OutP; var SaveCodeBoolCMi : boolean; SaveCodeBoolBEi : boolean; SaveCodeBoolSQi : boolean; LastWord : string [64]; SeqStr : string [6]; procedure PutSXLine; begin if length (OutLine) > 0 then begin OutLine := ManyChar (blank, CodeInt [POi]) + OutLine; PutLine; end; end; begin EndPage; SaveCodeBoolCMi := CodeBool [CMi]; SaveCodeBoolBEi := CodeBool [BEi]; SaveCodeBoolSQi := CodeBool [SQi]; CodeBool [CMi] := false; CodeBool [BEi] := false; CodeBool [SQi] := false; Compute; LineCt := 99; LastWord := ''; OutLine := ''; SortOutCt := 0; LastSortCt := 0; gotoxy (1, 12); write (' Records returned from Sort'); while not SortEOS do begin SortReturn (DataItem); if DataItem.Word <> LastWord then begin PutSXLine; OutLine := DataItem.Word; while ((length (OutLine) < 32) or (((length (OutLine) - 32) mod 6) > 0)) do OutLine := OutLine + '.'; LastWord := DataItem.Word; end; if length (OutLine) = 0 then OutLine := ManyChar (Blank, 32); str (DataItem.Seq:6, SeqStr); OutLine := OutLine + SeqStr; if (length (OutLine) + 6) > DataLng then begin PutSXLine; OutLine := ''; end; SortOutCt := succ (SortOutCt); if SortOutCt > (LastSortCt + 9) then begin gotoxy (1, 12); write (SortOutCt:5); LastSortCt := SortOutCt; end; end; gotoxy (1, 12); write (SortOutCt:5); PutSXLine; CodeBool [CMi] := SaveCodeBoolCMi; CodeBool [BEi] := SaveCodeBoolBEi; CodeBool [SQi] := SaveCodeBoolSQi; end; begin Clean; writeln ('Insert a sort work disk in the SLIST drive,'); writeln ('if extra sort work space is needed.'); writeln; Wait; writeln; NewDisks;  ItemSize := SizeOf (DataItem); SortResult := TurboSort (ItemSize); writeln; writeln; if SortResult = 0 then erase (SXFile) else begin writeln ('*** Unsuccessful Sort: ', SortResult, ' ***'); Wait; writeln; end; writeln ('Remove sort work disk now, and replace SLIST disk,'); writeln ('if sort work disk inserted earlier.'); writeln; Wait; NewDisks; end; begin SysInit; LoadCodes; RsvLoaded := false; repeat GetInFile; if AnotherFile then begin GetOptions; Compute; assign (ListFile, 'LST:'); reset (ListFile); assign (SXFile, SXName); SXOpen := false; LineCt := 99; PageCt := 0; SeqCt := 0; NextSeqCt := 0; KCount := 0; BCount := 0; PrintingLines := true; LineToPrint := false; PageBegun := false; Clean; writeln ('Make Sure Printer Is Ready.'); Wait; CsrUp (2);  clreol; writeln; clreol; gotoxy (1, 3); writeln ('Printing...'); write (ListFile, HexToChr (CodeStr [PIi])); LSTLngth (CodeInt [LLi]); if SXOption <> 'R' then begin assign (InFile, InName); if SXOption in ['A', 'U'] then begin rewrite (SXFile); SXOpen := true; if ((SXOption = 'U') and (not RsvLoaded)) then begin assign (RsvFile, 'A:SLISTRSV.DAT'); reset (RsvFile); for RsvIndex := 1 to ReservedWords do begin readln (RsvFile, ReservedWord [RsvIndex]); if ((RsvIndex = 1) or (ReservedWord [RsvIndex] [1] <> ReservedWord [RsvIndex - 1] [1])) then RsvPtr [ord (ReservedWord [RsvIndex] [1]) - 64] := RsvIndex; end; close (RsvFile); RsvLoaded := true; end; end; reset (InFile); IncOn := false; CRTLine := 4; WriteFileLine (InName); CurrChar := Blank; NextChar := Blank; OldLineDone := true; GetChar; GetChar; while CurrChar <> EndFile do ProcWord; PrintLine; WriteSeqCt; end; if SXOpen then begin close (SXFile); SXOpen := false; end; if SXOption in ['A', 'R', 'U'] then SXRef; EndPage; write (ListFile, HexToChr (CodeStr [PTi])); end; (* if AnotherFile *) until not AnotherFile; clrscr; writeln ('Thanks for using Singular Software!'); end. rvedWord [RsvIndex - 1] [1])) then RsvPtr [ord (ReservedWord [RsvIndex] [1]) - 64] := RsvIndex; end; close (RsvFile); RsvLoaded := true; end; end; reprocedure WriteCode; begin CRTLine := CodeIndex + 2; gotoxy (1, CRTLine); clreol; write (Code [CodeIndex]); gotoxy (3, CRTLine); write (' - ', CodeDesc [CodeIndex]); gotoxy (29, CRTLine); write (' = '); case CodeType [CodeIndex] of 'B': writeln (SayBool (CodeBool [CodeIndex])); 'I': writeln (CodeInt [CodeIndex]:3); 'S': writeln (CodeStr [CodeIndex]); end; end; procedure LoadCodes; begin assign (CtrlFile, 'SLISTCTL.DAT'); reset (CtrlFile); CodeIndex := 0; while not eof(CtrlFile) do begin CodeIndex := succ (CodeIndex); readln (CtrlFile, Code [CodeIndex]); readln (CtrlFile, CodeDesc [CodeIndex]); readln (CtrlFile, CodeType [CodeIndex]); readln (CtrlFile, CodeMaxLng [CodeIndex]); case CodeType [CodeIndex] of 'B': begin readln (CtrlFile, WorkBool); if WorkBool = 'Y' then CodeBool [CodeIndex] := true else CodeBool [CodeIndex] := false; end; 'I': begin readln (CtrlFile, CodeInt [CodeIndex]); CodeStr [CodeIndex] := ''; end; 'S': begin CodeInt [CodeIndex] := 0; readln (CtrlFile, CodeStr [CodeIndex]); end; end; (* Case *) end; (* While *) close (CtrlFile); CodeNum := CodeIndex; end; (* Procedure *) procedure CopyRight; begin writeln ('*************************************************'); writeln ('* SLIST Version 1.00A - CP/M, Z80 *'); writeln ('* *'); writeln ('* (C) Copyright 1985, Herb Bowie. *'); writeln ('* All commercial rights reserved. This *'); writeln ('* program is licensed for non-commercial use. *'); writeln ('* *'); writeln ('* Have you payed for this program yet? If not, *'); writeln ('* and you find it useful, then may I suggest *'); writeln ('* that you make a small donation to its author? *'); writeln ('* Something like $10 would be wonderful. You *'); writeln ('* may send it to: *'); writeln ('* Herb Bowie *'); writeln ('* P.O. Box 4724 *'); writeln ('* Culver City, CA 90231-4724 *'); writeln ('*************************************************'); end; (* GET-IN-FILE Proc: When program is first run will check for a file name passed by CP/M, and will try to open that file. If no name is passed, will ask operator for a file name to open. Proc will tell operator if file doesn't exist, and will allow multiple retrys. On 2nd and later executions, proc will not check for CP/M passed file name. In all cases, proc will assume a file type of .PAS if file type is not specified. PROGRAM EXIT from this proc when a null string is entered in response to a file name request. *) procedure GetInFile; (* Gets input file name *) var Parm : string[14] absolute $81; (* Passed file name, if any *) ParmLth : byte absolute $80; (* CP/M passed length of parm *) Existing: boolean; procedure GetInName; begin LastName := InName; if (ParmLth in [1..14]) and First then begin InName := Copy (Parm,1,ParmLth - 1); if pos (':', InName) = 0 then InName := 'A:' + InName; if pos ('.', InName) = 0 then InName := InName + '.PAS'; end else begin Clean; writeln; writeln; CopyRight; CsrUp (18); write ('Enter File Name or RETURN to Exit: '); InName := SayPic (InName, FilePic); write (InName); CsrLeft (14); InName := Squeeze (GetPic (InName, FilePic), Blank); end; First := false; AnotherFile := not (LastName = InName); end; begin repeat GetInName; if AnotherFile then begin Existing := DiskFile (InName); if Existing then ErrorMsg := '' else ErrorMsg := '*** FILE DOES NOT EXIST ***'; end; until (not AnotherFile) or Existing; end; (* GetOptions procedure gives user a chance to modify the default run options. *) procedure GetOptions; var C : char; WorkValue: string [80]; WorkPic : string [80]; MaxLng : integer; R : integer; begin Clean; for CodeIndex := 1 to CodeNum do WriteCode; writeln; repeat WriteMsg; gotoxy (1, CodeNum + 4); clreol; gotoxy (1, CodeNum + 5); clreol; gotoxy (1, CodeNum + 4); write ('Enter Code to modify, or blank to end: '); CodeWork := GetPic (' ', '!!'); writeln; ErrorMsg := ''; if CodeWork <> ' ' then begin CodeIndex := 1; while (CodeIndex <= CodeNum) and (Code [CodeIndex] <> CodeWork) do CodeIndex := succ (CodeIndex); if CodeIndex > CodeNum then ErrorMsg := '*** INVALID SELECTION ***' else begin MaxLng := CodeMaxLng [CodeIndex]; case CodeType [CodeIndex] of 'B': CodeBool [CodeIndex] := not CodeBool [CodeIndex]; 'I': begin str (CodeInt [CodeIndex]:5, WorkValue); WorkPic := ManyChar ('9', MaxLng); WorkValue := SayPic (WorkValue, WorkPic); write ('Enter new value: ', WorkValue); CsrLeft (MaxLng); WorkValue := GetPic (WorkValue, WorkPic); val (WorkValue, CodeInt [CodeIndex], R); end; 'S': begin if MaxLng > 5 then WorkPic := ManyChar ('X', MaxLng)  else WorkPic := ManyChar ('!', MaxLng); WorkValue := SayPic (CodeStr [CodeIndex], WorkPic); write ('Enter new value: ', WorkValue); CsrLeft (MaxLng); CodeStr [CodeIndex] := GetPic (WorkValue, WorkPic); end; end; (* of case *) WriteCode; end; (* valid work code *) end; (*non-blank work code *) until CodeWork = ' '; end;  str (CodeInt [CodeIndex]:5, WorkValue); WorkPic := ManyChar ('9', MaxLng); WorkValue := SayPic (WorkValue, WorkPic); write ('Enter new value: ', WorkValue); CsrLeft (MaxLng); WorkValue := GetPic (WorkValue, WorkPic); val (WorkValue, CodeInt [CodeIndex], R); end; 'S': begin if MaxLng > 5 then WorkPic := ManyChar ('X', MaxLng)  procedure Compute; begin LastLine := CodeInt [PLi] - CodeInt [MBi]; if CodeInt [PLi] = 0 then LastLine := 0; DataLng := CodeInt [LLi] - CodeInt [POi]; if CodeBool [CMi] then DataLng := DataLng - 2; if CodeBool [BEi] then DataLng := DataLng - 3; if CodeBool [SQi] then DataLng := DataLng - 6; PrefixLng := CodeInt [LLi] - DataLng; if length (CodeStr [SXi]) < 1 then SXOption := 'N' else SXOption := CodeStr [SXi] [1]; if length (CodeStr [SXi]) < 2 then SXDrive := 'A' else SXDrive := CodeStr [SXi] [2]; SXName := SXDrive + ':SXREF.DAT'; end; procedure SkipLine (X: integer); (* Puts X blank lines to output file *) begin while X > 0 do begin writeln (ListFile); X := pred (X); end; end; procedure StartPage; begin PageCt := succ (PageCt); LineCt := 1; SkipLine (CodeInt [MTi] - 1 - CodeInt [HMi]); WorkLine := Replace (CodeStr [HEi], '@', InName); str (PageCt, PageStr); WorkLine := Replace (WorkLine, '#', PageStr); WorkLine := Trim (WorkLine); WorkLine := LCRJust (WorkLine, DataLng); write (ListFile, ManyChar (Blank, CodeInt [POi])); if CodeBool [CMi] then write (ListFile, 'C '); if CodeBool [BEi] then write (ListFile, 'BE '); if CodeBool [SQi] then write (ListFile, ' SEQ '); writeln (ListFile, WorkLine); SkipLine (CodeInt [HMi]); LineCt := CodeInt [MTi]; PageBegun := true; end; procedure EndPage; begin if PageBegun then begin SkipLine (CodeInt [PLi] - LineCt - CodeInt [MBi] + CodeInt [FMi]); WorkLine := Replace (CodeStr [FOi], '@', InName); WorkLine := Replace (WorkLine, '#', PageStr); WorkLine := LCRJust (WorkLine, DataLng); write (ListFile, ManyChar (Blank, CodeInt [POi])); if CodeBool [CMi] then write (ListFile, ' '); if CodeBool [BEi] then write (ListFile, '  '); if CodeBool [SQi] then write (ListFile, ' '); writeln (ListFile, WorkLine); LineCt := succ (LineCt); if CodeBool [FFi] then write (ListFile, FF) else SkipLine (CodeInt [PLi] - LineCt); PageBegun := false; end; end; procedure PutLine; begin if (LastLine > 0) and (LineCt >= LastLine) then begin EndPage; StartPage; end; LineCt := succ (LineCt); writeln (ListFile, OutLine); end; procedure PrintLine; var WorkStr : string [6]; begin if (LineToPrint and PrintingLines and ((CodeBool [CCi]) or (not FormatOnLine))) then begin TempLine := ManyChar (Blank, CodeInt [POi]); if CodeBool [CMi] then begin if KCount > 0 then WorkStr := '*' else WorkStr := Blank; TempLine := TempLine + WorkStr + Blank; end; if CodeBool [BEi] then begin str (BCount:2, WorkStr); TempLine := TempLine + WorkStr + Blank; end; if CodeBool [SQi] then begin str (SeqCt:5, WorkStr); TempLine := TempLine + WorkStr; if IncOn then TempLine := TempLine + '+' else TempLine := TempLine + blank; end; TempLine := TempLine + InRec; J := PrefixLng + 1; while ((J <= length (TempLine)) and (TempLine [J] = Blank)) do J := succ (J); if J > length (TempLine) then J := PrefixLng + 1; J := succ (J); while length (TempLine) > CodeInt [LLi] do begin I := CodeInt [LLi]; while ((I > PrefixLng) and (TempLine [I] <> Blank)) do I := pred (I); if I = PrefixLng then I := CodeInt [LLi]; OutLine := copy (TempLine, 1, I); PutLine; delete (TempLine, 1, I); TempLine := ManyChar (Blank, J) + TempLine; end; OutLine := TempLine; PutLine; end; LineToPrint := false; end; procedure GetLine; begin PrintLine; FormatOnLine := false; if IncOn then if eof (IncFile) then begin IncOn := false; close (IncFile); WriteFileLine (InName); end else begin readln (IncFile, InRec); LineToPrint := true; end; if not IncOn then begin if eof (InFile) then begin InRec := EndFile; end else begin readln (InFile, InRec); LineToPrint := true; end; end; NextSeqCt := succ (NextSeqCt); if (NextSeqCt > (SeqCtWritten + 10)) then WriteSeqCt; InLng := length (InRec); CI := 1; end; procedure GetChar; begin LastChar := CurrChar; CurrChar := NextChar; LastCI := CurrCI; CurrCI := NextCI; SeqCt := NextSeqCt; if OldLineDone then begin GetLine; OldLineDone := false; end; NextCI := CI; if CI > InLng then begin if CurrChar = EndFile then NextChar := EndFile else NextChar := Blank; OldLineDone := true; end else begin NextChar := upcase (InRec [CI]); CI := succ (CI); end; end; hen begin if eof (InFile) then begin InRec := EndFile; end else begin readln (InFile, InRec); LineToPrint := true; end; end; NextSeqCt := succ (NextSeqCt); if (NextSeqCt > (SeqCtWritten + 10)) then WriteSeqCt; InLng := length (InRec); CI := 1; end; procedure GetChar; begin LastChar := CurrChar; CurrChar := NextChar; LastCI := CurrCI; CurrCI := NextCI; SeqCt := NextSeqCt; if OldLineDone then begin GetLine; OldLineDone := false; end; NextCI := Cprocedure SkipBlanks; begin while CurrChar = Blank do GetChar; end; procedure GetCommentValue; begin SkipBlanks; CommentValue := ''; while KCount > 0 do begin if CurrChar = '}' then KCount := 0 else if ((CurrChar = '*') and (NextChar = ')')) then begin KCount := 0; GetChar; end else begin if length (CommentValue) < 128 then CommentValue := CommentValue + CurrChar; GetChar; end; end; end; procedure ProcDirective; begin GetChar; if ((CurrChar = 'I') and (not (NextChar in ['+', '-'])) and (IncStart >= CodeInt [ICi])) then begin GetChar; GetCommentValue; IncName := Squeeze (CommentValue, Blank); if (pos (':', IncName) = 0) then IncName := 'A:' + IncName; if (pos ('.', IncName) = 0) then IncName := IncName + '.PAS'; WriteFileLine (IncName); if DiskFile (IncName) then begin PrintLine; IncOn := true; assign (IncFile, IncName); reset (IncFile); end else begin write (' *** FILE NOT FOUND ***'); WriteFileLine (InName); end; end else GetCommentValue; end; procedure GetCodeNumber; var X, Y, Z: integer; begin X := 1; while ((X <= length (CommentValue)) and (not (CommentValue [X] in ['0'..'9']))) do X := succ (X); Y := X; while ((Y <= length (CommentValue)) and (CommentValue [Y] in ['0'..'9'])) do X := succ (X); if Y = X then CodeNumber := 0 else val (copy (CommentValue, X, Y - X), CodeNumber, Z); end; procedure ProcFormat; begin FormatOnLine := true; GetChar; CodeWork := ''; if CurrChar in ['A'..'Z'] then begin CodeWork := CurrChar; GetChar; if CurrChar in ['A'..'Z', '+', '-'] then begin C odeWork := CodeWork + CurrChar; GetChar; end; end; GetCommentValue; if CodeWork = 'PA' then LineCt := LastLine + 1 else if CodeWork = 'CP' then begin GetCodeNumber; if (LineCt + CodeNumber) >= LastLine then LineCt := LastLine + 1; end else if CodeWork = 'L-' then PrintingLines := false else if CodeWork = 'L+' then PrintingLines := true else begin CodeIndex := 1; while ((CodeIndex <= CodeNum) and (Code [CodeIndex] <> CodeWork)) do CodeIndex := succ (CodeIndex); if CodeIndex <= CodeNum then begin case CodeType [CodeIndex] of 'B': begin if length (CommentValue) = 0 then CodeBool [CodeIndex] := not CodeBool [CodeIndex] else if CommentValue [1] in ['T', 'Y', '+'] then CodeBool [CodeIndex] := true else  if CommentValue [1] in ['F', 'N', '-'] then CodeBool [CodeIndex] := false else CodeBool [CodeIndex] := not CodeBool [CodeIndex]; end; 'I': begin GetCodeNumber; CodeInt [CodeIndex] := CodeNumber; end; 'S': CodeStr [CodeIndex] := CommentValue; end; (* of case CodeType *) end; (* of CodeIndex <= CodeNum *) end; (* of if CodeWork else *) Compute; end; procedure ProcComment; begin KCount := 1; if CurrChar = '*' then IncStart := LastCI else IncStart := CurrCI; GetChar; case CurrChar of '$': ProcDirective; '.': ProcFormat; else GetCommentValue; end; GetChar; end; procedure ProcStrLit; begin repeat GetChar; if ((CurrChar = Quote) and (NextChar = Quote)) then begin GetChar; GetChar; end until CurrChar = Quote; GetChar; end; procedure GetWord; begin Word := CurrChar; GetChar; if Word [1] in IdStartChars then begin while CurrChar in IdChars do begin Word := Word + CurrChar; GetChar; end; end; end; procedure ProcWord; begin SkipBlanks; if CurrChar = '(' then GetChar; if (((LastChar = '(') and (CurrChar = '*')) or (CurrChar = '{')) then ProcComment else if CurrChar = Quote then begin ProcStrLit; end else if CurrChar <> EndFile then begin GetWord; if ((SXOpen) and (Word [1] in IDStartChars)) then begin if ((SXOption = 'A') or (Word [1] = '_') or (length (Word) > 10)) then writeln (SXFile, SeqCt:5, ',', Word) else begin RsvIndex := RsvPtr [ord (Word [1]) - 64]; while ((RsvIndex <= 144) and (Word > ReservedWord [RsvIndex])) do RsvIndex := succ (RsvIndex); if Word <> ReservedWord [RsvIndex] then writeln (SXFile, SeqCt:5, ',', Word); end; end; if ((Word = 'BEGIN') or (Word = 'CASE')) then BCount := succ (BCount) else if Word = 'END' then if BCount > 0 then BCount := pred (BCount); end; end;  if CurrChar = Quote then begin ProcStrLit; end else if CurrChar <> EndFile then begin GetWord; if ((SXOpen) and (Word [1] in IDStartChars)) then begin if ((SXOption = 'A') or (Word [1] = '_') or (length (Word) > 10)) then writeln (SXFile, SeqCt:5, ',', Word) else begin RsvIndex := RsvPtr [ord (Word [1]) - 64]; while ((RsvIndex <= 144) and (Word > (* SYSCONST.CON *) (* Global Constant Definitions *) Blank = ' '; Quote = ''''; Tab = #09; FF = #12; NewLine = #13; EndFile = #26; åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå (* SYSTYPE.TYP *) (* Global type definitions. *) String5 = string [5]; String255 = string [255]; StringMax = string [255]; åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå(* SYSVAR.VAR *) (* Global Constant Definitions to be initialized *) (* by SYSINIT.PRC. *) (* CRT Variables *) CRTBeepStr : string [2]; CRTDimStr : string [2]; CRTBrightStr : string [2]; CRTGraphStr : string [2]; CRTNoUndStr : string [2]; CRTTextStr : string [2]; CRTUnderStr : string [2]; CsrLeftStr : string [2]; CsrRightStr : string [2]; CsrUpStr : string [2]; CsrDownStr : string [2]; (* Printer Variables *) LSTMaxLngths : integer; LSTLineLength : array [1..5] of integer; LSTLLStr : array [1..5] of String5; åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå(* Center.Fnc *) (* Output: A string data item containing the *) (* contents of the input string, but *) (* with all non-blank data centered *) (* within the specified length. *) (* Input 1: A string field to have characters *) (* centered within it. *) (* Input 2: An integer value indicating the *) (* total desired length of the output*) (* string, including leading and *) (* trailing spaces. *) function Center (InStr: String255; OutLng: integer): String255; var A, B, C: integer; begin A := 1; while (A <= length (InStr)) and (InStr [A] = ' ') do A := succ (A); B := length (InStr); while (B > 0) and (InStr [B] = ' ') do B := pred (B); C := ((OutLng - B + A - 1) div 2) + 1; while A < C do begin insert (' ', InStr, 1); A := succ (A); end; while A > C do begin delete (InStr, 1, 1); A := pred (A); end; while length (InStr) < OutLng do InStr := InStr + ' '; while length (InStr) > OutLng do delete (InStr, length (InStr), 1); Center := InStr; end; nput 2: An integer value indicating the *) (* total desired length of the output*) (* string, including leading and *) (* trailing spaces. *) function Center (InStr: String255; OutLng: integer): String255; var A, B, C: integer; begin A := 1; while (A <= length (InStr)) and (InStr [A] = ' ') do A := succ (A); B := length (InStr); while (B > 0) and (InStr [B] = ' ') do B := pred (B); C := ((OutLng - B + A - 1) div 2) + 1; while A < C do be(* CPM.Prc *) (* Collection of operating system-dependent CP/M *) (* functions and procedures. *) (* NewDisks Procedure *) (* Function: Prepare operating system for disk *) (* change. *) procedure NewDisks; begin bdos (13); end; (* CurrDisk Function *) (* Output: Char containing current disk drive. *) function CurrDisk: char; begin CurrDisk := chr (bdoshl (25) + 65); end; (* SelDisk Procedure *) (* Function: Selects new disk drive for *) (* subsequent operations. *) (* Input 1: A character containing the desired *) (* drive letter. *) procedure SelDisk (DriveChar: char); begin bdos (14, ((ord (DriveChar) mod 32) - 1)); end; (* Dir Function *) (* Output: Str ing containing file name. If *) (* file name is null, then all file *) (* names have been returned. *) (* Input 1: String containing mask to be used *) (* to select file names. Asterisks *) (* and a period may be used, as well *) (* as question marks. *) (* Input 2: Boolean variable which should be *) (* set to true the first time through.*) (* It will be changed to false by this*) (* function. *) function Dir ( DirMask : String14; var FirstTime: boolean) : String14; const FCBL = $5C; FCB = $80; SchFirst = 17; SchNext = 18; SetDMA = 26; var PeriodPos : integer; ExtPos : integer; AstPos : integer; I : integer; DMAPntr : integer; DMABuf : array [1..130] of byte; SaveDisk : char; WorkName : string [12]; begin if FirstTime then begin if DirMask [2] = ':' then begin SaveDisk := CurrDisk; if SaveDisk <> DirMask [1] then SelDisk (DirMask [1]); delete (DirMask, 1, 2); end else SaveDisk := '0'; AstPos := pos ('*', DirMask); PeriodPos := pos ('.', DirMask); if PeriodPos > 0 then ExtPos := PeriodPos + 1 else if AstPos in [1..8] then ExtPos := AstPos + 1 else ExtPos := 9; if ((AstPos > 0) and (AstPos < ExtPos)) then begin repeat insert ('?', DirMask, AstPos); AstPos := succ (AstPos); until AstPos = 9; delete (DirMask, AstPos, 1); end; if PeriodPos > 0 then begin PeriodPos := pos ('.', DirMask); while PeriodPos < 9 do begin insert (' ', DirMask, PeriodPos); PeriodPos := succ (PeriodPos);  end; delete (DirMask, PeriodPos, 1); end; AstPos := pos ('*', DirMask); if AstPos > 0 then begin repeat insert ('?', DirMask, AstPos); AstPos := succ (AstPos); until AstPos > 11; delete (DirMask, AstPos, 1); end; mem [FCBL] := 0; for I := 1 to length (DirMask) do mem [FCBL + I] := ord (DirMask [I]); for I := (length (DirMask) + 1) to 11 do mem [FCBL + I] := ord (' '); for I := 12 to 36 do mem [FCBL + I] := 0; bdos (SetDMA, addr (DMABuf [1])); DMAPntr := bdos (SchFirst, FCBL); end else DMAPntr := bdos (SchNext, FCBL); if DMAPntr < 255 then begin DMABuf [(DMAPntr * 32) + 1] := 11; WorkName := ' '; move (DMABuf [(DMAPntr * 32) + 1], WorkName, 12); insert ('.', WorkName, 9); end else begin bdos (SetDMA, FCB); WorkName := ''; if (SaveDisk <> '0') and (SaveDisk <> CurrDisk) then SelDisk (SaveDisk); end; Dir := WorkName; FirstTime := false; end; s > 11; delete (DirMask, AstPos, 1); end; mem [FCBL] := 0; for I := 1 to length (DirMask) do mem [FCBL + I] := ord (DirMask [I]); for I := (length (DirMask) + 1) to 11 do mem [FCBL + I] := ord (' '); for I := 12 to 36 do mem [FCBL + I] := 0; bdos (SetDMA, addr (DMABuf [1])); DMAPntr := bdos (SchFirst, FCBL); end else DMAPntr := bdos (SchNext, FCBL); if DMAPntr < 255 then begin DMABuf [(DMAPntr * 32) + 1] := 11; WorkName := ' '; move (DMABuf [(DMAPntr * 32) + 1], WorkName, 12); insert ('.', WorkName, 9); end else begin bdos (SetDMA, FCB); WorkName := ''; if (SaveDisk <> (* Cursor.Prc *) (* Collection of video control procedures for the *) (* Osborne 1. *) (* CRTBeep Procedure *) (* Function: Beep at user *) procedure CRTBeep; begin write (CRTBeepStr); end; (* CRTGraph Procedure *) (* Function: Begin graphics mode on terminal *) procedure CRTGraph; begin write (CRTGraphStr) end; (* CRTNoUnd Procedure *) (* Function: End underlining on screen *) procedure CRTNoUnd; begin write (CRTNoUndStr) end; (* CRTText Procedure *) (* Function: End graphics mode, and begin text *) procedure CRTText; begin write (CRTTextStr) end; (* CRTUnder Procedure *) (* Function: Begin underlining on screen *) procedure CRTUnder; begin write (CRTUnderStr) end;   (* CsrLeft Procedure *) (* Function: Move cursor left specified spaces *) procedure CsrLeft (Times: integer); var Count: integer; begin for count := 1 to Times do write (CsrLeftStr) end; (* CsrRight Procedure *) (* Function: Move cursor right specified spaces*) procedure CsrRight (Times: integer); var Count: integer; begin for count := 1 to Times do write (CsrRightStr) end; (* CsrUp Procedure *) (* Function: Move cursor up specified rows *) procedure CsrUp (Times: integer); var Count: integer; begin for count := 1 to Times do write (CsrUpStr) end; (* CsrDown Procedure *) (* Function: Move cursor down specified rows *) procedure CsrDown (Times: integer); var Count: integer; begin for count := 1 to Times do write (CsrDownStr) end; (* DiskFile.Fnc *) (* Output: Boolean True if the passed file *) (* name exists, otherwise boolean *) (* False. *) (* Input 1: String value containing file name.*) function DiskFile (FileName: String255): boolean; var WorkFile: file; begin assign (WorkFile, FileName); (*$I-*) (* Turn off error checking *) reset (WorkFile); (*$I+*) (* Turn error checking back on *) DiskFile := (IOResult = 0) end; åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå (* HexToChr.Fnc *) (* Output: A string data item containing the *) (* contents of the input string, but *) (* converted from hex paired notation*) (* to a character string. *) (* Input 1: A string field in hex paired *) (* notation. *) function HexToChr (InStr: String255) : String255; var A, B, C: integer; function HexToInt (InChar: char) : integer; begin if InChar in ['0'..'9'] then HexToInt := ord (InChar) - 48 else HexToInt := (ord (InChar) mod 32) + 9; end; begin A := 1; while A <= length (InStr) do begin B := HexToInt (InStr [A]); C := 1; if A < length (InStr) then begin B := (B * 16) + HexToInt (InStr [A + 1]); C := succ (C); end; delete (InStr, A, C); insert (chr (B), InStr, A); A := succ (A); end; HexToChr := InStr; end; ntents of the input string, but *) (* converted from hex paired notation*) (* to a character string. *) (* Input 1: A string field in hex paired *) (* notation. *) function HexToChr (InStr: String255) : String255; var A, B, C: integer; function HexToInt (InChar: char) : integer; begin if InChar in ['0'..'9'] then HexToInt := ord (InChar) - 48 else HexToInt := (ord (InChar) mod 32) + 9; end; begin A := 1; while A <= length (InStr) do begin B := HexToInt (InStr [A]); C := 1; if A < length (InStr) then begin B := (B * 16) + HexToInt (InStr [A + 1]); C := succ (C); end; delete (InStr, A, C); insert(* LCRJust.Fnc *) (* Output: A string data item containing the *) (* data contained in parm 1, but with*) (* back-slashes ("\") removed, and *) (* with the data preceding the first *) (* backslash left-justified, the data*) (* between the first and second *) (* centered, and the data after the *) (* second justified. *) (* Input 1: A string field to be formatted. *) (* Input 2: An integer value indicating the *) (* total desired length of the output*) (* string. *) function LCRJust (InStr : String255; OutLng: integer) : String255; var A, B, C: integer; begin A := 1; while (A <= length (InStr)) and (InStr [A] <> '\') do A := succ (A); if A <= length (InStr) then begin delete (I nStr, A, 1); B := A; while (B <= length (InStr)) and (InStr [B] <> '\') do B := succ (B); if B <= length (InStr) then delete (InStr, B, 1); C := (((OutLng - B + A) div 2) + 1); while A < C do begin insert (' ', InStr, A); A := succ (A); B := succ (B); end; while length (InStr) < OutLng do insert (' ', InStr, B); while (A > 1) and (length (InStr) > OutLng) do begin A := pred (A); delete (InStr, A, 1); end; end; LCRJust := InStr; end; tput*) (* string. *) function LCRJust (InStr : String255; OutLng: integer) : String255; var A, B, C: integer; begin A := 1; while (A <= length (InStr)) and (InStr [A] <> '\') do A := succ (A); if A <= length (InStr) then begin delete (I(* LST.Prc *) (* Collection of printer control procedures. *) (* LSTLngth Procedure *) (* Function: Set printer to desired line length*) procedure LSTLngth (LineLength: integer); var A: integer; begin A := 1; while (A <= LSTMaxLngths) and (LineLength > LSTLineLength [A]) do A := succ (A); if A <= LSTMaxLngths then write (LST, LSTLLStr [A]); end; (* Page.Prc *) (* Function: Writes a form feed to the lst file*) (* in order to skip to the top of a *) (* new page. *) procedure Page; begin write (lst, FF) end; åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå(* ManyChar.Fnc *) (* Output: String containing a specified *) (* character repeated a specified *) (* number of times. *) (* Input 1: Character to be repeated. *) (* Input 2: Number of times to repeat char. *) function ManyChar (Fill: char; Chars: integer): String255; var WorkString: String255; begin WorkString := ''; while (length (WorkString) < Chars) do WorkString := concat (WorkString, Fill); ManyChar := WorkString end; åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå (* Replace.Fnc *) (* Output: A string with all occurrences of *) (* the search string replaced with *) (* the replacement string. Note that*) (* the search string must not occur *) (* in the replacement string, or an *) (* error will occur. *) (* Input 1: The input string, to have the *) (* replacement applied to it. *) (* Input 2: The search string to be replaced. *) (* Input 3: The replacement string. *) function Replace (InStr : String255; SearchStr : String255; ReplaceStr: String255) : String255; var A: integer; begin A := pos (SearchStr, InStr); while A > 0 do begin delete (InStr, A, length (SearchStr)); insert (ReplaceStr, InStr, A); A := pos (SearchStr, InStr); end; Replace := InStr;  end; e search string replaced with *) (* the replacement string. Note that*) (* the search string must not occur *) (* in the replacement string, or an *) (* error will occur. *) (* Input 1: The input string, to have the *) (* replacement applied to it. *) (* Input 2: The search string to be replaced. *) (* Input 3: The replacement string. *) function Replace (InStr : String255; SearchStr : String255; ReplaceStr: String255) : String255; var A: integer; begin A := pos (SearchStr, InStr); while A > 0 do begin delete (InStr, A, length (SearchStr)); insert (ReplaceStr, InStr, A); A := pos (SearchStr, InStr); end; Replace := InStr; (* SayBool.Fnc *) (* Output: A single character representing *) (* the input boolean value. *) (* Input 1: Boolean value to be displayed. *) function SayBool (InBool: boolean): char; begin if InBool then SayBool := 'Y' else SayBool := 'N'; end; REPLACE FNC 56SAYBOOL $$$åååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååå (* Squeeze.Fnc *) (* Output: A string data item containing the *) (* contents of the input string, but *) (* with all specified characters *) (* removed from the string. *) (* Input 1: A string field to have characters *) (* squeezed from it. *) (* Input 2: A string containing all the *) (* characters to be squeezed from the*) (* string. *) function Squeeze (InStr: String255; SqStr: String255): String255; var A, B: integer; begin A := 1; while A <= length (InStr) do begin while (A <= length (InStr)) and (pos (InStr [A], SqStr) = 0) do A := succ (A); B := A; while (B <= length (InStr)) and (pos (InStr [B], SqStr) > 0) do B := succ (B); if A <= length (InStr) then delete (InStr, A, B - A); end; (* while A <= length *) Squeeze := InStr; end; tents of the input string, but *) (* with all specified characters *) (* removed from the string. *) (* Input 1: A string field to have characters *) (* squeezed from it. *) (* Input 2: A string containing all the *) (* characters to be squeezed from the*) (* string. *) function Squeeze (InStr: String255; SqStr: String255): String255; var A, B: integer; begin A := 1; while A <= length (InStr) do begin while (A <= length (InStr)) and (pos (InStr [A], SqStr) = 0) do A := succ (A); B := A; while (B <= length (InStr)) and (pos (InStr [B], SqStr) > 0) do B := succ (B); if A <= length (InStr) then (* SysInit.Prc *) (* This procedure will initialize the variables *) (* defined in SysVar.Var, which can be included *) (* in a Turbo Pascal program. The initializing *) (* data will be read from file SYSTEM.DAT. *) procedure SysInit; var SysFile : text; SysName : string [14]; WorkStr : String5; WorkInt : integer; LSTLLIndex : integer; function HexStr: String5; begin WorkStr := ''; while (not eoln (SysFile)) do begin read (SysFile, WorkInt); WorkStr := WorkStr + chr(WorkInt); end; if not eof (SysFile) then readln (SysFile); HexStr := WorkStr; end; begin SysName := 'a:System.Dat'; assign (SysFile, SysName); reset (SysFile); CRTBeepStr := HexStr; CRTDimStr := HexStr; CRTBrightStr := HexStr; CRTGraphStr := HexStr; CRTNoUndStr := HexStr; CRTTextStr := HexStr; CRTUnderStr := HexStr; CsrLeftStr := HexStr; CsrRightStr := HexStr; CsrUpStr := HexStr; CsrDownStr := HexStr; readln (SysFile, LSTMaxLngths); for LSTLLIndex := 1 to LSTMaxLngths do begin read (SysFile, LSTLineLength [LSTLLIndex]); LSTLLStr [LSTLLIndex] := HexStr; end; for LSTLLIndex := (LSTMaxLngths + 1) to 5 do begin LSTLineLength [LSTLLIndex] := 0; LSTLLStr [LSTLLIndex] := ''; end; close (SysFile); end; (not eoln (SysFile)) do begin read (SysFile, WorkInt); WorkStr := WorkStr + chr(WorkInt); end; if not eof (SysFile) then readln (SysFile); HexStr := WorkStr; end; begin SysName := 'a:System.Dat'; assign (SysFile, SysName); reset (SysFile); CRTBeepStr := HexStr; CRTDimStr := HexStr; CRTBrightStr := HexStr; CRTGraphStr := HexStr; CRTNoUndStr := HexStr; CRTTextStr := HexStr; CRTUnderStr := H (* Trim.Fnc *) (* Output: A string data item containing the *) (* contents of the input string, but *) (* with spaces and/or nulls removed *) (* from the trailing *) (* positions of the string. *) (* Input 1: A string field to be trimmed on *) (* the right side. *) function Trim (Instr: String255): String255; var A, B: integer; BlankChar: boolean; begin if length (Instr) > 0 then begin BlankChar := true; B := length (Instr); while ((B >= 1) and BlankChar) do begin if ((Instr [B] = ' ') or (Instr [B] = chr (0))) then B := pred (B) else BlankChar := false end; if B = 0 then Trim := '' else Trim := copy (Instr, 1, B) end else (* length(InStr) = 0 *) Trim := '' end; ntents of the input string, but *) (* with spaces and/or nulls removed *) (* from the trailing *) (* positions of the string. *) (* Input 1: A string field to be trimmed on *) (* the right side. *) function Trim (Instr: String255): String255; var A, B: integer; BlankChar: boolean; begin if length (Instr) > 0 then begin BlankChar := true; B := length (Instr); while ((B >= 1) and BlankChar) do begin if ((Instr [B] = ' ') or (Instr [B] = chr (0))) then B := pred (B) else BlankChar := false end; if B = 0 then Trim := '' else Trim := copy (Instr, 1, B) end else (* length(InStr) = 0 *) Trim := '' end(* Wait.Prc *) (* Function: Writes message to console and *) (* then waits until user presses any *) (* key. *) procedure Wait; begin writeln ('Press any key to continue...'); while not keypressed do; end; HEXTOCHRFNC /0LCRJUST FNC 12LST PRC3MANYCHARFNC4REPLACE FNC 56SAYBOOL FNC7SQUEEZE FNC 89SYSINIT PRC :;TRIM FNC <=WAIT $$$ååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååååÃÉÍ«Copyright (C) 1984 BORLAND Inc‚A MORROW MT-70utivetedP= ERT()~·7È#õå~Íáñ=ÈóÍ% ÉÅÕåÝåýåõo&åͦñýáÝááÑÁÉoåͦÉþ€Ü�Ô©æîÅÕåÝåýåÍ£}Ùå!å!"8áãõÅÕ~#·(åÍáôÑÁñãÉ}´È:$‡‡‡ããããÅÒÁ= ô+èÍÐØ*ÎßõÅÕå!¨ÍZ!¢ÍÐ*ºÔBáÑÁñÉõÅÕå!´éõÅÕå!®àõ:¼·(ÅÕå=2¼!ÈÍZáÑÁñÉõ:¼· ÷ÅÕå<2¼!ÂåõÅÕå!¼ÛõÅÕååð!‹í°Ñ:žO:œ‚ÕÍÑ:ŸO:�ƒÍ!ðÍÐ* ÍBáÑÁñÉ!ð ë!›45(É!.+/ –0ü†õyþ0(ñíÉ d!kÃZ!{ÃZ͈æ͈o&Éô  áÁå:á·(yþ ÕÅÍ |µ(Íþ ÍþÊÅÁÑ*é"ÛÕx2áy·( >Ã28!?"9!É í°!á¸í°áí°>2گà Ã:ÃDÃ]ÃSÃXÃNÃ]ÃDÿ í[Ûþ (ú!eÍ}Í„þA8þQ0Gþ: xÖ@¯!\w# ( þ  ÍyÍVþ. ÍV!h6#ûÉ (þ*(þ.(þ!8þ}(þ*(Í„w#ßÉ>?> w#üÉþaØþ{ÐÖ É|Í’}õÍ›ñæÆ�'Î@'Ãè¯7Ë|À|·}È>ÿÉ"ÍíCß"í6#ûëÑùü "Ïë"ÕÍ�Í©éå*Ï·íB"Ïí[Í·íRëáÚ5í°É*Ïí°"ÏÙÉ^#V#Õ^#V#N#FáÉÝáëO/o&ÿ9ùëí°ÝéÑO/o&ÿ9ùëí°éÝáë!àÿ9ùëÅ(¯üí°Á> �‘(G¯üÝéÝá!àÿ9ù ¯w#üÝéÝáEÍŠ¶wÝéÝáÑ}“8÷�Ãu·íR·íB0 É>‘î·íRëê@ðøÉÕë·íRëáë·íR!È+Éͨ õÍz ð·íR!À+Éͨ õÍz ðÍ<!Ð+Éͨ õÍz ðÍ<!ÈØ+Éͨ ôÍz ïÍ<!ÈØ#Éͨ ôÍz ïÍ<!Ø+Éͨ õÍz ðT]KBë!z·> S>)ë)ë0 = öÉ|ªõÍJëÍJëDM¯go>íjíB0 7?ËË= ðëñðHåÍ\Ë<ËÑëÍÞëËzÈ5Í+È)ýÉÍ+ÈË<ËúÉëz· {þ0G·É¯goÉë|ª|úHºÀ}»ÉÉË|È|/g}/o#É}æo&ÉíKÓí[ÑÅÕxAJSËËËËáëáíJDM!éb"Ñë!6íJ"ÓDMÉ'ͬèͬdͬ ͬ} ¯<íR0û= ÈÆ0ÝwÝ#ÉÝ~Ö$O! Ý#Ý~Í„Ö08)þ 8 !Öþ 8þ0T])Ø)Ø T]Ø)Ø_ØËy·È|‡ÉÝááå}&#9N�8wë!DíB9ùëåí°ëá+Oí¸ë#ùÝé>ÃwÝáͦWáͧ _áå}“8(º8J`9{‚T]=o`9yí¸ë ¯ÃwÍÖ Ð>ÃuÍJ õÍuÍ` íÙ}·Ù>(è; àÙËxÙÂQ Ù}·ÙÈÙÅÕåÙ}· Ù˸TÅËø¯ÙËø}Ù•(0íD=ÙÍC ,= ù(Ùñæ€ Í[ 0%ÍD ·, 7 Í� ?õ(8ÙÍu Ëx ÍO - öÍ; ñ8˸·ÙáÑÁÙÉÙËxÙÂÝ ÍX ÍÝ Ø,-Èxî€GÉÙ}·ÙÊ; }·ÈÙ…ÙÍ ÅÕåÝ9Í; Ù.Ù>Ý#ÝnË0Í[ ÍD = ñÙ-Ù åÝnûËx ÍP ,-(-ñññ·ñÙÁáÙÝá˸°G,-Ì; É}·ÈÙ•Ù?Í åååÝ9Ù.Ù>Í� 8Íu ?Ë= ÝuÝ+Ù-Ù(>ÍO 0ßÍu ·áÍO 8Í� ?áÑÁËx ÍP š, —7•8Æ€8Æ€8oÝãÙåÅxËøÙ¨æ€õËøÝåÝ!ÉáØ¯oGOW_gÉ·ËËËËËÉ·ËËËËËÉ|Ù„Ùg{Ù‹Ù_zÙŠÙWyÙ‰ÙOxÙˆÙGÉ|Ù”Ùg{Ù›Ù_zÙšÙWyÙ™ÙOxÙ˜ÙGÉxÙ¸ÙÀyÙ¹ÙÀzÙºÙÀ{Ù»ÙÀ|Ù¼ÙÉÙxÙ¨ò² xÉËx(ͼ È?É}Ù½ÙÀ·ÈÃ� }Ö�Ú; <þ(ÐÙÅÕåÍ; 7ÍD = ùÙ|Ù¤Ùg{Ù£Ù_zÙ¢ÙWyÙ¡ÙOxÙ ÙGÃD ÙÅÕåÙÍuÙÍÆ ÙÍJ ë}·ÈËx>ÂuÍu}Æ€Ë/Æ€oÖõÙÅÕå; ÍÖ -ÅÕåÍJ }áÑÁÙáÑÁã¼ã0ãñÙÉÙÍW-ÍJ ÙÍW,Ù}þlØÅ˸ͨ Á8 ; Íý Í` Ëx(ÍÖ Ù-Ùͨ õ8ÍJ Ù-Ùͨ 8Ù,ÍJ }þl8;Ùª*ªª!ªÍ` ÝåÝ!Ð >ÍýÝáÍuÍ` Í` ÅÕåÙÍu--Ù-ÍÖ ÙáÑÁÙÍJ ,,ñ,-ÈØxî€GÉgª?+2×n¶*ï8t Ð Ðzˆˆˆˆ~«ªªªª,->ÊuËxÂuÙÍaÙ}.�•õ; ÙÍOÙÍJ ÅÕåÙ,ÍÖ ÙáÑÁ; ÝåÝ!U >ÍýÝá,ÙÍk-ÙÍÖ ñÅÕåo&0%ÍÑÙ,Í` ÙáÑÁÍÖ }þgÚ; É}Š�؉}颋.:}Žã8Žc~I’$I~ÍÌÌÌL«ªªª*ÙÍkÙ·Ëxõ˸; }þˆ0GÅÕå,Í™åË<Ë}áõÍÑ,-(-ÙñáÑÁõÍJ ÝåÝ!Ù >ÍÝáñ0 õÙÍaÙÍ` ñ…o8 ñÈÙÍOþ á>Ãum.`1pF,þåt6|‰„!wS<ÿÃ.zÒ}[•|%¸FXc~üïýu€Ò÷r1}·ÈÝåÙÍOÙ¯Ëx(<˸õͨ 8Ù; ñËÿõÙÏŽé!~JÙͨ 0Í÷OÝ!—>ÙÝÍ<Ùͨ 8 = ìÙ ÝÙÙÍ7ËøÍÖ ÅÕåÍ<Í` ÙÍOÍÖ ÙáÑÁ; ÝåÍ÷ÝáÙÍ7ÍÖ ñ0 õÙÍW-ÍJ ñÝáËOÈËøÉçÏÌTöô¢0 jÁ‘ €µžŠoD€‚,:Í€jÁ‘ �€!¢ÚI}袋.º}Žã8Žc~I’$I’~ÍÌÌÌL«ªªªªÝ!Ó>ÅÕåõÍuÍ` ñÍÙáÑÁÃ` õÙÍ7õÙÅÕåÍ7ÍÖ ÙáÑÁÙÍ` ñ= éÙÍOÃÖ ÝÝnÝfÝ^ÝVÝNÝFÉ!�DLT\ÉI¢Ú!‚!É53ó!�úÉr1÷!€ÒÉÅÕåÙáÑÁÉÍ\!€> Ëx Ë#ËËË-= ðo˸ÉËxÙÍO(Ëø-ÍÖ ·Ë}(ËxËø>�½8(ÍC ,óÍC `iÈÃM!É>’Ãu|µÊ; Ë|ÍJ>�Ë| )=Ë|(úDMboÀ˸Éͦë8þ8ͦÙËxÙ(’0¯þ 8> ÕÍMÑËx(>-ͲË{(aËy(Ͱͦ ò\z·(>.Ͳ (Ͱ ÷ú~ͦ÷Ë{È>EͲ>+Ë|(|íDg>-Ͳ|/Ö 0ûÆ:ÝpÝ# ý~ý#· ý+>0ÝwÝ#Éýå,-  ý60ý#ø¯ÃJÅ˸}ÙÖ€oŸgMÍÄ|þÙ <ýwíDÍ }þ�0Í€ý5Ëø>„•.(ÍC Ë= øý~õ> xæÆ0ýwý#xæGÅÕåË%ÍP Ë%ÍP ëãÑãíZëáãíJDMáË%ÍP = ÈñÁýáÉýåá_~6þ5Øúi+~¨¥Ôh¶¿ÉìÅëx-ÐÍÎÂSÞùx9?ë+¨­ÅøÉ{Η@}·ÈËøÅÕ|ÍC ÍC „gãíZëáãíJDMá0ÍD ,7È}Æo˸ÉÍ ¾ #øyîO!@9ùi&ÝéÍ  ë¶¾ â#÷ÚÍ ¶w#ùëùÝéÍ /¦w#øïÍ ¦w#ùãýáÝá!9ë! E9ýéÝá!!9~·(¯+FÍŠ¦!"9ù!(#Ýé>¯2æýá*ÛͲ¯á"âýå|·>"Ê :æ·( ͆ *â6#wÉÍ÷*â6#6 ë!\$í°É!¶Ååí[Ûþ (úÍ„–( áÁã·É#ëÁÁþ:À~ÉCONTRMKBDLSTAUXUSR>¯2æÍîÍ$*â#~þ ͶÍ$*â:æ·> >w###6ÀÃÖþ þ #6++pÉ>¯2æíSäÍ-Í$Ͷ:Ù·À*â6###ww#w$w#wÖÿ:æ· åÍôá##N#F*ä·íBÈ>�à å¯w#w#í[äs#ráÃó>¯2æÍSÍ$ͶÍ$*â6å ë#Íá-¯Nw#FwÖÿq#p#6€#w#w#wÉÍß*â ë:æ·( ÕÍÑñÅÍÁ<Àxà *â6#ûÉ"â#~+þ 2ËN(>Í’:Ù· *âË^ îËFÈ*âå ëÍá< >ÿ2Ù6É"â~æÈÍŸ*â-¯w#wÕÿw#ÍóÍŸÀ"â~æÈ·ÍÀ ëÍ<À@ýá*ÛͲ¯áýåÍÀåÍ÷áåë!\ í°á åëÍÑ<Ê®!\$í°É>à >¯2æÍÀ*ß|µ>! ë*â \$í°\Í<(Ï!ý€í°:æ· í[1Ã�ÿÕÍ\ÍÑ!€ë·(éf"âÍÂÈ> 2ÙÉ:Ù·ÈñÉÝáÝåå!ÊÍ<áÉÝáÝå"âËF( #~þÀ#6Ãe>Îå!ÊÍ[áÉ"âËNÀ>ë!Ú~þ€8>O6*Û"ÝÍwþ (=þ(&þ("þ(þ :á·(ßÃNþ 8Øyº(Ô~#ÍèÌúx+Í% (½ï6Éå*â#~þáÉÍÂÈÍ[þÈÅÕå*â#~· *Ý~þ(h#"Ýb= Íõþ 8Íèþ ÌáñJ= ÍB== ͯ}8= ͵}/Í­ !*â###å~Æ-_~áþ(4òQ6*âËÖ>™2Ù>*â##wáÑÁÉ:Ù·>Àå*â##~áÉå*â#~þÿ(EÍÌÍ[þ ( þ (þ (þ ÍÖè!]Í[þ (þ (þ (þ(w#(ÍÖãÍÂÌÖ6áÉÝ!]Ý~·Èþ-ÀÝ#É8Ý~·È>7à ëÍ Í[ÃÖÍÖÉ>¯OÅÍkÁͼÈÅåÍÁÑÁÍÎØÌMës #rëÉÍkͼÈÅåÍpÙáÁÍÎØÙÌX ÙáåÍÌÍ[þ ÍÖôÍ[þ (þ( #w(ÍÖêÍÂÌÖáqÉ*â#~þÊáÍ[þ (þÈÍÖñÍ ÍÖþ ÀÃÖ*â##~þÈ6ÉÅÕåÍœáÑÁÉOÍ$*â#~þ(08áÅå·Ê¦=ʦ==Ê©=ʬò+ËÞ###å~Æ-_qá4ð6Í¡È>ðà *æ:è¾È4^qÉ}Ã’ÁÑÅÝ*ÛË|(ÍMëëË|( ÍMÝ6-Ý#ÕÍ�áͦí[ÛÝåá·íRë“8 (G> Í’ùCÈ~Í’#÷ÁÑÙáÑÁÙÅÝ*ÛÕÍôÇÁÑÅͦËC!h Ç!lÀTRUEFALSEͦ!9^#Í(ÑùÕÉá~#·(G~Í’#ùé> Í’> Ã’ "âËF!ÈÍ[¸(þÀ#ÉåÍRë·íRá0Íô*â4À#4É>™Ã åÍR·íR *â4 #4(áÍóÒ>òÜ>¯2çÍ$ë*âËV(/Ë–:ç·(#~+· x· y·ú2ÅÕ!͵ÑÁ( =(þ X:ç·(R*â:ç·(ËÞ###~Æ-Õ_ÑÖ-ÍŒí âX<òN=<ÍŒ*â###æw ÅÕåÍŸáÑÁ Õ*Ñ4 #4x±ÂüëÉ>™>ðà õ:ç·(ëñÉ"âÍŸÈè"*âËÖË^ÈËž*âËVÈË–åÅ0ëÍÁá ëÍ·ÉÁÑíSâÅåÍRÑ·íR8A*â N#F#s#rÍ$ 0}æ)ëíjëS\*â###w* N#Fë·íB ÈÕåÍŸÑár+sÉ>‘à ÕÙáÙ!T]>)ëíjëÙ)Ù0 0= ïÉÍU·íR!À#ÉÍUëÉ*â^#V#ÕN#F#^#VáÉ>">!2çDMÝáÑáÝå"â~æÊóx±(LÅÕÍ*â ë:çOÍÑÁ·(o:çþ" C}=(þ ?ÅÕ*â-N#Fp+qÛÿq#pÑÁ!€ë °*â F+N+++V+^ë·íBÐëq#pÉ>™>ð>à ÁÑíSâÅåÍRÑ·íRÚ*â s#r$ s#rÉ"äíSæëá"â! N#Fë·íB(^x± *â 6#ûí[âÍ<(H*â! íKäq#p##ëíKæÅÕÍí[â!Í· *â! 4 #4Ñ!€ëÁ x± Õ*â$ éÝ*â>ðÃw"òëáã"ô{æü_!í"ëÝ*íÝnÝf}´(HíR0ÝnÝfåÝ"ëÝáã Ý^ÝVÝåMDÝnÝfÝåÝÝuÝtÝqÝpÝåÑ*ës#rÑ*ôs#rÉÝåá"Í*ò ÝåÁ Ú5íKÏíB!Úð>ÿÃuëáã~#fo{æü_ë"ò*íåÝá·íR0RÝnÝfå·íR0ÝáðáÕýáíKòýqýpýuýtÝsÝrÝåáÝNÝFÍÄ( Ý^ÝVÕÝáÝåáÝNÝFÝ^ÝV*ííSíÕÝáÝuÝtíKòÝqÝpë ·íRÀÕýá*Í·íR(ý~Ýwý~Ýwýnýf ÝuÝt¯ÉÝåá"Í6#ûÉÍ *öÉÍ *øÉ!"ö"øÝ*íÝNÝFy°(*ö "ö*ø·íB0íCøÝnÝfåÝáØ*Ïûÿ í[Í·íRØë*ö"ö*ø·íRÐíSøÉí[Ís#rÉ^#VíSÍÉ>¯O"æ¯w2Ùx2è!ê"âá"äá ÍöÍ@*äé>¯2ê"æ!ê"âá"äá"è!\Ͳ¯*è:ê· ÍîÍ!Ù~6·go(Ýåá\íRë*æs#r¯ÿí_2ÔÉëÝáÁáx±( s x±(T]í°ÝéDMÝáÑá·íR0ð ë ëí¸ÝéÑÁÕ-a%ÃÆ}Í„oÉ*é!Ù~6o&ÉÍ |µÈÍ£}þÀÝáÍ%^C User break1:Ù·ÈÝáõÍ% I/OÝáÍ% Run-timeÍ% error Í’Í%, PC=Ýåáí[Õ·íR"×Í�Í% Program aborted*ßé1!Àô¸ÿÍ�!3/ÎóͲÃ/ýááÑÁÙ!žôÍ¡ýå!žôÍüÅÕå!|(\�ÂuÙáÑÁÍÄ Ù!¤ôÍ¡!¤ôÍüÉýáá"—ôá}2™ôýå!å*—ôÑÍ5z³ÊT Õ"‘ô*™ô&ÍRÍòÍb*‘ô#ÑÃ4 ÉÍRÍ�ÍbÍRÍ�; -------> TYPE TO CONTINUE <-------Íb!ŒôÍ+ÍÛÍ_ÍbÉÍR!ÍòÍb! å!åÍ ÍRÍ�1-----> NOT A VALID INPUT, PLEASE TRY AGAIN <-----Í�ÍbÉÍR!ÍòÍbÍRÍ�OKAY...........SO LONGÍ�ÍbÉýááÑÁÙ!~ôÍ¡ýå!2ôå!+)))ÑåTWENTIES!W!Ñí°! ôå!+)Ñå!Ðëás#r!2ôå!+)))ÑåTENS !Œ!Ñí°! ôå!+)Ñå!èëás#r!2ôå!+)))ÑåFIVES !Á!Ñí°! ôå!+)Ñå!ôëás#r!2ôå!+)))ÑåONES !ö!Ñí°! ôå!+)Ñå!dëás#r!2ôå!+)))ÑåHALVES !+"Ñí°! ôå!+)Ñå!2ëás#r!2ôå!+)))ÑåQUARTERS!`"Ñí°! ôå!+)Ñå!ëás#r!2ôå!+)))ÑåDIMES !•"Ñí°! ôå!+)Ñå! ëás#r!2ôå!+)))ÑåNICKLES !Ê"Ñí°! ôå!+)Ñå!ëás#r!2ôå! +)))ÑåPENNIES !ÿ"Ñí°! ôå! +)Ñå!ëás#rÍRÍ�AMOUNT TENDERED? Íb!ôÍ+ÍÍ_Íb!ôÍüÅÕå!~ôÍüÙáÑÁͼ Ù!ôÍ¡ÍRÍ�ÍbÍRÍ� CHANGE IS !ôÍüÅÕå! å!Í@Í�ÍbÍRÍ�Íb!ôÍüÅÕå!‰p= ×#ÙáÑÁ͸ËEÊä#!‡HÅÕå!ôÍüÙáÑÁÍÄ Í™"ô!å! ÑÍ5z³Êv$Õ"ô*ôå! ôå*ô+)Ñ^#VëÑÍÞ"ô*ôå! ôå*ô+)Ñ^#VëÑÍ"ô*ôå!ÑÍ›ËEÊm$!2ôå*ô+)))ÑÍÍR!ÍqÍ�: *ôå!ÍöÍ�Íb*ô#ÑÃï#ÍU Éýáá"ôáÑÁÙ!ôÍ¡áÑÁÙ! ôÍ¡á}2ôýå!ë*ôs*ô&1·íRÂ(%!ôÍüÅÕå!ƒ ÙáÑÁ͸å!ôÍüÅÕå!ˆÙáÑÁÍ¥Ñ}³oËEÊø$!ë*ôsÃ%%!¶ôÍüÅÕå! ôÍüÅÕå!ôÍüÙáÑÁÍÄ ÙáÑÁͳ Ù!¶ôÍ¡Ã-&2·íR©%!ôÍüÅÕå!‚ÙáÑÁ͸å!ôÍüÅÕå!…HÙáÑÁÍ¥Ñ}³oËEÊy%!ë*ôsæ%!°ôÍüÅÕå! ôÍüÅÕå!ôÍüÙáÑÁÍÄ ÙáÑÁͳ Ù!°ôÍ¡Ã-&3·íRÂ*&!ôÍüÅÕå!€ÙáÑÁ͸å!ôÍüÅÕå!„pÙáÑÁÍ¥Ñ}³oËEÊú%!ë*ôsÃ'&!ªôÍüÅÕå! ôÍüÅÕå!ôÍüÙáÑÁÍÄ ÙáÑÁͳ Ù!ªôÍ¡Ã-&ͳ É!=å!OåÍ ÍRÍ�Íb! å!!åÍ ÍRÍ� DAILY TOTALSÍ�Íb!=å!OåÍ ÍRÍ�ÍbÍRÍ�ÍbÍRÍ�Íb! å!!åÍ ÍRÍ�SOLD TAX TOTALÍ�ÍbÍRÍ�ÍbÍRÍ�SOFTWARE..................... !¶ôÍüÅÕå!å!Í@ÍbÍR!¶ôÍüÅÕåÍçÅÕå! å!Í@!¶ôÍüÅÕå!¶ôÍüÅÕåÍçÙáÑÁͳ ÅÕå! å!Í@Í�ÍbÍRÍ�BOOKS AND TAPES.............. !°ôÍüÅÕå!å!Í@ÍbÍR!°ôÍüÅÕåÍçÅÕå! å!Í@!°ôÍüÅÕå!°ôÍüÅÕåÍçÙáÑÁͳ ÅÕå! å!Í@Í�ÍbÍRÍ�MISC. MERCHANDISE............ !ªôÍüÅÕå!å!Í@ÍbÍR!ªôÍüÅÕåÍçÅÕå! å!Í@!ªôÍüÅÕå!ªôÍüÅÕåÍçÙáÑÁͳ ÅÕå! å!Í@Í�Íb!¶ôÍüÅÕå!°ôÍüÙáÑÁͳ ÅÕå!ªôÍüÙáÑÁͳ Ù!÷óÍ¡ÍRÍ�ÍbÍRÍ�TOTAL........................ !÷óÍüÅÕå!å!Í@ÍbÍR!÷óÍüÅÕåÍçÅÕå! å!Í@!÷óÍüÅÕå!÷óÍüÅÕåÍçÙáÑÁͳ ÅÕå! å!Í@Í�ÍbÍRÍ�ÍbÍRÍ�ÍbÍRÍ�ÍbÍU É!ÍÑÙ!ßóÍ¡ÍR!ÍòÍb!=å!OåÍ ÍRÍ�Íb! å!!åÍ ÍRÍ� CASH REGISTERÍ�Íb!=å!OåÍ ÍRÍ�ÍbÍRÍ�ÍbÍRÍ�Íb! å!åÍ ÍRÍ�1 = SOFTWARE ($5.00 TO $150.00)Í�ÍbÍRÍ�Íb! å!åÍ ÍRÍ�%2 = BOOKS AND TAPES ($2.00 TO $25.00)Í�ÍbÍRÍ�Íb! å!åÍ ÍRÍ�&3 = MISC. MERCHANDISE ($.50 TO $15.00)Í�ÍbÍRÍ�Íb!_å!OåÍ ÍRÍ�ÍbÍRÍ� Íb!òóÍ+ÍÛÍ_Íb*òó&åÍQ!1Ía!2Ía!3ÍaÍËEÊ,ÍRÍ� QUANTITY? Íb!åóÍ+ÍÍ_ÍbÍRÍ�PRICE? Íb!ëóÍ+ÍÍ_Íb*òó&å!åóÍüÅÕå!ëóÍüÅÕå!ñóåÍz$*ñó&}îoËEÊz+ͳ ç+!ßóÍüÅÕå!åóÍüÅÕå!ëóÍüÙáÑÁÍÄ ÙáÑÁͳ Ù!ßóÍ¡ÍRÍ�ÍbÍRÍ� Íb!òóÍ+ÍÛÍ_ÍbÃá*ÍRÍ�ÍbÍR!ÍòÍbÍRÍ� SUBTOTAL = !ßóÍüÅÕå!å!Í@Í�Íb!ßóÍüÅÕåÍçÙ!ÙóÍ¡ÍRÍ� SALESTAX = !ÙóÍüÅÕå!å!Í@Í�Íb! å! åÍ !-å!åÍ ÍRÍ�Íb!ßóÍüÅÕå!ÙóÍüÙáÑÁͳ Ù!ÓóÍ¡ÍRÍ� TOTAL = !ÓóÍüÅÕå!å!Í@Í�Íb!ÓóÍüÅÕåÍ9!ÉÍR!ÍòÍ�Íb!=å!OåÍ ÍRÍ�Íb! å!åÍ ÍRÍ�THE FOG COMPUTER STOREÍ�Íb!=å!OåÍ ÍRÍ�ÍbÍRÍ�ÍbÍRÍ�ÍbÍRÍ�YOUR SELECTIONSÍ�Íb!-å!åÍ ÍRÍ�ÍbÍRÍ�ÍbÍRÍ�1 CASH REGISTERÍ�ÍbÍRÍ�2 DAILY TOTALSÍ�ÍbÍRÍ�3 QUIT PROGRAMÍ�ÍbÍRÍ�ÍbÍRÍ�Íb!_å!OåÍ ÍRÍ�ÍbÍRÍ�(PLEASE MAKE YOUR SELECTION 1,2 OR 3 --> Íb!ÎóÍ+ÍÛÍ_Íb*Îó&åÍQ!1Ía!2Ía!3ÍaÍ}îoËEÊ�.ͳ *Îó&åÍQ!1Ía!2Ía!3ÍaÍËEÊ%.ÍR!ÍòÍ�Íb*Îó&1·íRÂÖ.Í3)Ãó.2·íRÂæ.Í.&Ãó.3·íRÂó.Í !*Îó&å!3ÑÍNËEÊú,É!ÍÑÙ!¶ôÍ¡!ÍÑÙ!°ôÍ¡!ÍÑÙ!ªôÍ¡Íú,ÃÅÍR!ÍòÍ�Íb*Îó&1·íRÂ1Í3)ÃÎ.2·íRÂ2Í.&ÃÞ.3·íRÂ3Í !*Îó&å!3ÑÍNÅÕå!åóÍüÅÕå!ëóÍüÙáÑÁÍÄ ÙáÑÁͳ Ù!ßóÍ¡ÍRÍ�ÍbÍRÍ� Íb!òóÍ+ÍÛÍ_ÍbÃá*ÍRÍ�ÍbÍR!ÍòÍbÍRÍ� SUBTOTAL = !ßóÍüÅÕå!å!Í@Í�Íb!ßóÍüÅÕåÍçÙ!ÙóÍ¡ÍRÍ� SALESTAX = !ÙóÍüÅÕå!å!Í@Í�Íb! å! åÍ !-å!åÍ ÍRÍ�Íb!ßóÍüÅÕå!ÙóÍüÙáÑÁͳ Ù!ÓóÍ¡ÍRÍ� TOTAL = !ÓóÍüÅÕå!å!Í@Í�Íb!ÓóÍüÅÕåÍ9!ÉÍR! bù Roî Forsythe Thió articlå anä thå accompanyinç prograí arå thå resulô  oæ � á  requesô  madå oî FOÇ RCP/Í #1® Someonå starteä  á  discussioî � abouô  Turbï  Pascaì (É can'ô imaginå who© whicè  resulteä  iî  á � requesô  foò  á regulaò columî iî thå FOGHORN® É  answereä  theî � thaô  É don'ô havå thå expertiså tï writå á regulaò  column¬  buô � figureä iæ É goô thå balì rolling¬ maybå somå oæ thå reaì expertó � woulä  contributå tï thå causå anä wå coulä geô aô  leasô  twelvå � Pascaì articleó á year. Thå  accompanyinç  prograí  listinç  ió  foò  aî   imaginarù � computeò  supplù storå calleä FOG® Anù resemblancå tï anù  otheò � computeò  organizatioî oæ thå samå namå ió  purelù  coincidental® � Whaô  followó  ió mù efforô tï explaiî thå prograí logic¬  anä  á � brieæ discussioî oæ thå higè pointó oæ Pascaì and¬ iî particular¬ � Turbï  Pascal®   Beforå  yoõ gï on¬ perhapó  É  shoulä  attacè  á � disclaimer®   É dï noô pretenä tï bå aî experô Pascaì  programmeò � anä  thió prograí maù havå bugó whicè É didn'ô  discover®   Maybå � thå  nexô Pascaì articlå coulä discusó improvementó tï  thió  onå � (iæ anyonå ió stucë foò á topic). Thå  biggesô advantagå oæ á languagå likå Pascaì ió thaô  iô � forceó  thå programmeò tï develoð structureä programminç  habits® � Á  Pascaì  prograí ió actuallù severaì  smalleò  programó  calleä � procedureó  and/oò  functions®   Manù  oæ  theså  procedureó  anä � functionó arå similaò iî severaì programó thaô yoõ write® Iô  ió � á  simplå tasë tï builä yourselæ á toolchesô oæ  frequentlù  useä � modules¬  anä  inserô  theí iî whateveò ne÷ prograí  yoõ  maù  bå � running®   Thió  alsï allowó yoõ tï tesô á prograí beforå  iô  ió � fullù written¬ onå modulå aô á time® Iî  thå prograí listinç thaô accompanieó thió  article¬  thå � actuaì  prograí  itselæ consistó oæ onlù thå  twï  stepó  betweeî � BEGIÎ  anä  END® aô thå enä oæ thå prograí listing®   Otheò  thaî � that¬  thå prograí ió actuallù á serieó oæ moduleó  eacè  callinç � anotheò untiì thå finaì outpuô ió reached. Iæ  yoõ  examinå thå program¬ yoõ wilì finä thaô  thå  firsô � steð  ió thå prograí titlå followeä bù aî optionaì comment®   Thå � Pascaì  equivalenô  oæ  MBASIC'ó  REÍ  ió  thå  parenthesió   anä � asterisk. Thå  nexô  steð ió tï declarå anù globaì  variables®   Theså  arå � variableó thaô caî bå useä froí thå maiî prograí oò anù  modules® � Pascaì  makeó nï assumptionó aó tï thå attributeó oæ á  variable® � Eacè musô bå defined» sucè aó á REAL¬ INTEGER¬ BOOLEAN¬ oò  CHAR® � REAÌ  pertainó  tï  reaì numberó anä  coveró  thå  widesô  range® � Integeró arå wholå numberó witè á rangå oæ -3276¸ througè  32768® � BOOLEAÎ  ió á logicaì argument¬ TRUÅ oò FALSE®   CHAÒ  representó � character. Nexô iî ouò prograí ió thå functioî SALESTAX® Thió functioî � ió  á  gooä onå foò youò toolchest¬ iæ yoõ intenä tï  writå  manù � programó  whicè  calì foò thå salestaø tï bå computed®   Iî  thió � program¬ thå ratå ió defineä aó á constanô witè á valuå oæ  0.06® � Thió  allowó yoõ tï easilù updatå thå prograí iæ thå ratå  shoulä � change®   Foò example¬ iæ thió prograí werå beinç writteî  foò  á � businesó  iî thå Saî Franciscï Baù area¬ theî thå ratå  woulä  bå � changeä tï 0.065® Bù usinç á functioî iî thió manner¬ nï  matteò � ho÷ largå thå prograí growó to¬ iô ió seldoí difficulô tï update. Š Thå  nexô  modulå  ió á  procedurå  calleä  WRITECHR®   Thió � procedurå  ió  useä  tï painô thå screeî  displaù  foò  aesthetiã � reasonó  only®  Again¬  iô ió donå thió waù  tï  allo÷  foò  easù � modifications¬ anä lesó repetitioî oæ thå samå code® Nexô  comeó  procedurå PAUSE® Aó thå  namå  implies¬  thió � modulå  wilì  bå  calleä anytimå thå prograí needó  tï  telì  thå � operatoò  something¬ anä theî pauså thå prograí  executioî  untiì � thå  operatoò  sayó  thaô theù arå readù tï  proceed®   Thå  linå � READLN(CH©  causeó  thå  prograí  tï  waiô  untiì  iô  getó  somå � characteò inpuô froí thå operator. Procedurå  TERMINATÅ simplù displayó á messagå tï  telì  thå � operatoò thaô thå prograí ió quitting. Thå  nexô procedurå ió calleä CHANGE® Iô wilì  computå  thå � changå duå tï á customer® Computatioî oæ thå denominationó oæ thå � changå  wilì  occuò  onlù iæ thå amounô oæ thå  changå  doeó  noô � exceeä 327.68® Thió ió duå tï thå integeò valuå range. Thå  procedurå  CHECKNADÄ  ió aî erroò  trað  tï  checë  foò � predefineä  minimuí anä maximuí valueó iî thå maiî  program®   Iî � ordeò  tï keeð ouò saleó clerë froí ringinç uð á boø oæ  computeò � papeò  aô  $2000¬  wå havå establisheä á  valuå  rangå  foò  eacè � category. Procedurå  DAYTOTAÌ  wilì  computå  thå  Dailù  Totals¬   bù � categorù foò ouò computeò supplù store¬ anä ió calleä bù thå maiî � menu. Procedurå  REGISTEÒ  ió  thå casè registeò  portioî  oæ  ouò � business®   Iô ió calleä froí thå maiî menu¬ anä wilì  displaù  á � seconä  menõ  oæ choices¬ checë foò valiä  input¬  theî  transfeò � valueó tï thå otheò procedureó anä functionó iô needó tï  computå � thå finaì output. Thå  lasô procedurå iî thå prograí iî calleä  MAINMENU®   Iô � wilì displaù á menõ oæ choices¬ checë foò valiä input¬ theî  pasó � controì procedurå REGISTER¬ DAYTOTAÌ oò TERMINATE. Iæ  yoõ  don'ô  havå Turbï Pascaì anä don'ô  quitå  kno÷  iæ � Pascaì  ió  thå directioî yoõ wanô tï go¬ trù  usinç  JRÔ  Pascaì � first® JRÔ Pascaì ió iî thå FOÇ library¬ sï thå pricå ió  right® � Thió  prograí  wilì  compilå witè JRÔ Pascaì oò  Turbo®   JRÔ  ió � reallù  nï comparisoî tï Turbo¬ buô iô wilì givå yoõ aî  ideá  oæ � thå  flexibilitù oæ thå Pascaì language® Iæ yoõ likå JRÔ eveî  á � little¬  theî spenä thå $49.9µ foò Turbï anä falì iî love®   Witè � Turbï  yoõ caî generatå truå COÍ fileó thaô wilì ruî  outsidå  oæ � Turbo®   Thå  compilinç speeä ió awesomå anä thå  erroò  catchinç � outstanding. Thankó  tï Stevå Turner¬ SYSOÐ oæ FOÇ #20¬ foò checkinç  ouô � mù code® Anä tï Joeì Sebeò É woulä likå tï say¬ "OK¬ É tooë  thå � challenge¬ no÷ it'ó youò turn." ouô � mù code® Anä tPROGRAM FOGSTORE; (* By Ron Forsythe *) VAR OPONE,OPTWO,OPTHREE: REAL; FUNCTION SALESTAX(AMOUNT: REAL): REAL; CONST RATE = 0.06; BEGIN SALESTAX := AMOUNT * RATE; END;(* SALESTAX *) PROCEDURE WRITECHR(CHRIN : CHAR; NUM :INTEGER); VAR CTR : INTEGER; BEGIN FOR CTR := 1 TO NUM DO WRITE(CHRIN); END;(* WRITECHR *) PROCEDURE PAUSE; VAR CH : CHAR; BEGIN WRITELN; WRITE(' -------> TYPE TO CONTINUE <-------'); READLN(CH); END; (* PAUSE *) PROCEDURE ERROR; BEGIN WRITE(CHR(7)); WRITECHR(' ',14); WRITELN('-----> NOT A VALID INPUT, PLEASE TRY AGAIN <-----'); END;(* ERROR *) PROCEDURE TERMINATE; BEGIN WRITE(CHR(26)); WRITELN('OKAY...........SO LONG'); END; (* TERMINATE *) PROCEDURE CHANGE(TOTAL: REAL); TYPE DENOMINATION = ARRAY[1..8] OF CHAR; VAR NAMES: ARRAY[1..9] OF DENOMINATION; VALUES: ARRAY[1..9] OF INTEGER; AMOUNT: REAL; COUNT,CHANGE, I: INTEGER; BEGIN NAMES[1] := 'TWENTIES'; VALUES[1] := 2000; NAMES[2] := 'TENS '; VALUES[2] := 1000; NAMES[3] := 'FIVES '; VALUES[3] := 500; NAMES[4] := 'ONES '; VALUES[4] := 100; NAMES[5] := 'HALVES '; VALUES[5] := 50; NAMES[6] := 'QUARTERS'; VALUES[6] := 25; NAMES[7] := 'DIMES '; VALUES[7] := 10; NAMES[8] := 'NICKLES '; VALUES[8] := 5; NAMES[9] := 'PENNIES '; VALUES[9] := 1; WRITE('AMOUNT TENDERED? '); READLN(AMOUNT); AMOUNT := AMOUNT - TOTAL; WRITELN;WRITELN('CHANGE IS ',AMOUNT:10:2); WRITELN; IF AMOUNT < 327.68 THEN CHANGE := ROUND(100.0 * AMOUNT); FOR I := 1 TO 9 DO BEGIN COUNT := CHANGE DIV VALUES[I]; CHANGE := CHANGE MOD VALUES[I]; IF COUNT > 0 THEN WRITELN(NAMES[I],': ',COUNT); END; PAUSE; END;(* PROCEDURE CHANGE *) PROCEDURE CHECKNADD(OPTION: CHAR; QUAN,PRICE: REAL;VAR OK:BOOLEAN); BEGIN OK := TRUE; CASE OPTION OF '1' : IF (PRICE < 5.00) OR (PRICE > 150.00) THEN OK := FALSE ELSE OPONE := OPONE + (QUAN * PRICE); '2' : IF (PRICE < 2.00) OR (PRICE > 25.00) THEN OK := FALSE ELSE OPTWO := OPTWO + (QUAN * PRICE); '3' : IF (PRICE < 0.50) OR (PRICE > 15.0) THEN OK := FALSE ELSE OPTHREE := OPTHREE + (QUAN * PRICE); ELSE ERROR END; (* CASE *) END; (* CHECKNADD *) PROCEDURE DAYTOTAL; VAR TOTAL: REAL; BEGIN WRITECHR('=',79);WRITELN; WRITECHR(' ',33);WRITELN('DAILY TOTALS'); WRITECHR('=',79); WRITELN;WRITELN;WRITELN; WRITECHR(' ',33);WRITELN('SOLD TAX TOTAL'); WRITELN; WRITE('SOFTWARE..................... ',OPONE:8:2); WRITELN(SALESTAX(OPONE):10:2,(OPONE + SALESTAX(OPONE)):10:2); WRITE('BOOKS AND TAPES.............. ',OPTWO:8:2); WRITELN(SALESTAX(OPTWO):10:2,(OPTWO + SALESTAX(OPTWO)):10:2); WRITE('MISC. MERCHANDISE............ ',OPTHREE:8:2); WRITELN(SALESTAX(OPTHREE):10:2,(OPTHREE + SALESTAX(OPTHREE)):10:2); TOTAL := OPONE + OPTWO + OPTHREE; WRITELN; WRITE('TOTAL........................ ',TOTAL:8:2); WRITELN(SALESTAX(TOTAL):10:2,(TOTAL + SALESTAX(TOTAL)):10:2); WRITELN;WRITELN;WRITELN; PAUSE; END; (* DAYTOTAL *) PROCEDURE REGISTER; VAR OPTION: CHAR; OK: BOOLEAN; PRICE,QUAN,SUBTOTAL,TAX,TOTAL: REAL; BEGIN SUBTOTAL := 0; WRITE(CHR(26)); WRITECHR('=',79); WRITELN; WRITECHR(' ',33); WRITELN('CASH REGISTER'); WRITECHR('=',79); WRITELN; WRITELN; WRITELN; WRITECHR(' ',15); WRITELN('1 = SOFTWARE ($5.00 TO $150.00)'); WRITELN; WRITECHR(' ',15); WRITELN('2 = BOOKS AND TAPES ($2.00 TO $25.00)'); WRITELN; WRITECHR(' ',15); WRITELN('3 = MISC. MERCHANDISE ($.50 TO $15.00)'); WRITELN; WRITECHR('_',79); WRITELN; WRITE('ENTER YOUR CHOICE - 1,2,3 OR ANY OTHER KEY FOR SUBTOTAL --> '); READLN(OPTION); WHILE OPTION IN ['1','2','3'] DO BEGIN WRITE('QUANTITY? ');READLN(QUAN); WRITE('PRICE? ');READLN(PRICE); CHECKNADD(OPTION,QUAN,PRICE,OK); IF NOT OK THEN ERROR ELSE SUBTOTAL := SUBTOTAL + (QUAN * PRICE); WRITELN; WRITE ('ENTER YOUR CHOICE - 1,2,3 OR ANY OTHER KEY FOR SUBTOTAL --> '); READLN(OPTION); END; (* WHILE *) WRITELN; WRITE(CHR(26)); WRITELN('SUBTOTAL = ',SUBTOTAL:8:2); TAX := SALESTAX(SUBTOTAL); WRITELN('SALESTAX = ',TAX:8:2); WRITECHR(' ',11);WRITECHR('-',8);WRITELN; TOTAL := SUBTOTAL+TAX; WRITELN(' TOTAL = ',TOTAL:8:2); CHANGE(TOTAL); END;(* REGISTER *) PROCEDURE MAINMENU; VAR CHOICE : CHAR; BEGIN REPEAT WRITELN(CHR(26)); WRITECHR('=',79); WRITELN; WRITECHR(' ',30);WRITELN('THE FOG COMPUTER STORE'); WRITECHR('=',79); WRITELN;WRITELN;WRITELN; WRITELN('YOUR SELECTIONS'); WRITECHR('-',15); WRITELN;WRITELN; WRITELN('1 CASH REGISTER'); WRITELN('2 DAILY TOTALS'); WRITELN('3 QUIT PROGRAM'); WRITELN;WRITELN; WRITECHR('_',79); WRITELN; REPEAT WRITE('PLEASE MAKE YOUR SELECTION 1,2 OR 3 --> '); READLN(CHOICE); IF NOT (CHOICE IN ['1','2','3']) THEN ERROR; UNTIL CHOICE IN ['1','2','3']; WRITELN(CHR(26)); CASE CHOICE OF '1' : REGISTER; '2' : DAYTOTAL; '3' : TERMINATE; END; (* CASE *) UNTIL CHOICE = '3'; END; (* MAINMENU *) BEGIN OPONE := 0; OPTWO := 0; OPTHREE := 0; MAINMENU; END. END. (' TOTAL = ',TOTAL:8:2); CHANGE(TOTAL); END;(* REGISTER *) PROCEDURE MAINMENU; VAR CHOICE : CHAR; BEGIN REPEAT WRITELN(CHR(26)); WRITECHR('=',79); WRITELN; WRITECHR(' ',30);WRITELN('THE FOG COMPUTER STORE'); WRITECHR('=',79); WRITELN;WRITELN;WRITELN; WRITELN('YOUR SELECTIONS'); WRITECHR('-',15); WRITELN;WRITELN; WRITELN('1 CASH REGISTER'); WRITELN('2 DAILY TOTALS'); WRITELN('3 QUIT PROGRAM'); WRITELN;WRITELN; WRITECHR('_',79); WRITELN; REPEAT WRITE('PLEASE MAKE YOUR SELECTION 1,2 OR 3 --> '); READLN(CHOICE); IF NOT (CHOICE ÃÉÍ«Copyright (C) 1984 BORLAND Inc‚ANCR DMVinal selectedP(= EERTG0G4~·7È#õå~Íáñ=ÈóÍ% ÉÅÕåÝåýåõo&åͦñýáÝááÑÁÉoåͦÉþ€Ü�Ô©æîÅÕåÝåýåÍ£}Ùå!å!"8áãõÅÕ~#·(åÍáôÑÁñãÉ}´È:$‡‡‡ããããÅÒÁ= ô+èÍÐØ*ÎßõÅÕå!¨ÍZ!¢ÍÐ*ºÔBáÑÁñÉõÅÕå!´éõÅÕå!®àõ:¼·(ÅÕå=2¼!ÈÍZáÑÁñÉõ:¼· ÷ÅÕå<2¼!ÂåõÅÕå!¼ÛõÅÕååð!‹í°Ñ:žO:œ‚ÕÍÑ:ŸO:�ƒÍ!ðÍÐ* ÍBáÑÁñÉ!ð ë!›45(É!.+/ –0ü†õyþ0(ñíÉ d!kÃZ!{ÃZ͈æ͈o&Éô  áÁå:á·(yþ ÕÅÍ |µ(Íþ ÍþÊÅÁÑ*é"ÛÕx2áy·( >Ã28!?"9!É í°!á¸í°áí°>2گà Ã:ÃDÃ]ÃSÃXÃNÃ]ÃDÿ í[Ûþ (ú!eÍ}Í„þA8þQ0Gþ: xÖ@¯!\w# ( þ  ÍyÍVþ. ÍV!h6#ûÉ (þ*(þ.(þ!8þ}(þ*(Í„w#ßÉ>?> w#üÉþaØþ{ÐÖ É|Í’}õÍ›ñæÆ�'Î@'Ãè¯7Ë|À|·}È>ÿÉ"ÍíCß"í6#ûëÑùü "Ïë"ÕÍ�Í©éå*Ï·íB"Ïí[Í·íRëáÚ5í°É*Ïí°"ÏÙÉ^#V#Õ^#V#N#FáÉÝáëO/o&ÿ9ùëí°ÝéÑO/o&ÿ9ùëí°éÝáë!àÿ9ùëÅ(¯üí°Á> �‘(G¯üÝéÝá!àÿ9ù ¯w#üÝéÝáEÍŠ¶wÝéÝáÑ}“8÷�Ãu·íR·íB0 É>‘î·íRëê@ðøÉÕë·íRëáë·íR!È+Éͨ õÍz ð·íR!À+Éͨ õÍz ðÍ<!Ð+Éͨ õÍz ðÍ<!ÈØ+Éͨ ôÍz ïÍ<!ÈØ#Éͨ ôÍz ïÍ<!Ø+Éͨ õÍz ðT]KBë!z·> S>)ë)ë0 = öÉ|ªõÍJëÍJëDM¯go>íjíB0 7?ËË= ðëñðHåÍ\Ë<ËÑëÍÞëËzÈ5Í+È)ýÉÍ+ÈË<ËúÉëz· {þ0G·É¯goÉë|ª|úHºÀ}»ÉÉË|È|/g}/o#É}æo&ÉíKÓí[ÑÅÕxAJSËËËËáëáíJDM!éb"Ñë!6íJ"ÓDMÉ'ͬèͬdͬ ͬ} ¯<íR0û= ÈÆ0ÝwÝ#ÉÝ~Ö$O! Ý#Ý~Í„Ö08)þ 8 !Öþ 8þ0T])Ø)Ø T]Ø)Ø_ØËy·È|‡ÉÝááå}&#9N�8wë!DíB9ùëåí°ëá+Oí¸ë#ùÝé>ÃwÝáͦWáͧ _áå}“8(º8J`9{‚T]=o`9yí¸ë ¯ÃwÍÖ Ð>ÃuÍJ õÍuÍ` íÙ}·Ù>(è; àÙËxÙÂQ Ù}·ÙÈÙÅÕåÙ}· Ù˸TÅËø¯ÙËø}Ù•(0íD=ÙÍC ,= ù(Ùñæ€ Í[ 0%ÍD ·, 7 Í� ?õ(8ÙÍu Ëx ÍO - öÍ; ñ8˸·ÙáÑÁÙÉÙËxÙÂÝ ÍX ÍÝ Ø,-Èxî€GÉÙ}·ÙÊ; }·ÈÙ…ÙÍ ÅÕåÝ9Í; Ù.Ù>Ý#ÝnË0Í[ ÍD = ñÙ-Ù åÝnûËx ÍP ,-(-ñññ·ñÙÁáÙÝá˸°G,-Ì; É}·ÈÙ•Ù?Í åååÝ9Ù.Ù>Í� 8Íu ?Ë= ÝuÝ+Ù-Ù(>ÍO 0ßÍu ·áÍO 8Í� ?áÑÁËx ÍP š, —7•8Æ€8Æ€8oÝãÙåÅxËøÙ¨æ€õËøÝåÝ!ÉáØ¯oGOW_gÉ·ËËËËËÉ·ËËËËËÉ|Ù„Ùg{Ù‹Ù_zÙŠÙWyÙ‰ÙOxÙˆÙGÉ|Ù”Ùg{Ù›Ù_zÙšÙWyÙ™ÙOxÙ˜ÙGÉxÙ¸ÙÀyÙ¹ÙÀzÙºÙÀ{Ù»ÙÀ|Ù¼ÙÉÙxÙ¨ò² xÉËx(ͼ È?É}Ù½ÙÀ·ÈÃ� }Ö�Ú; <þ(ÐÙÅÕåÍ; 7ÍD = ùÙ|Ù¤Ùg{Ù£Ù_zÙ¢ÙWyÙ¡ÙOxÙ ÙGÃD ÙÅÕåÙÍuÙÍÆ ÙÍJ ë}·ÈËx>ÂuÍu}Æ€Ë/Æ€oÖõÙÅÕå; ÍÖ -ÅÕåÍJ }áÑÁÙáÑÁã¼ã0ãñÙÉÙÍW-ÍJ ÙÍW,Ù}þlØÅ˸ͨ Á8 ; Íý Í` Ëx(ÍÖ Ù-Ùͨ õ8ÍJ Ù-Ùͨ 8Ù,ÍJ }þl8;Ùª*ªª!ªÍ` ÝåÝ!Ð >ÍýÝáÍuÍ` Í` ÅÕåÙÍu--Ù-ÍÖ ÙáÑÁÙÍJ ,,ñ,-ÈØxî€GÉgª?+2×n¶*ï8t Ð Ðzˆˆˆˆ~«ªªªª,->ÊuËxÂuÙÍaÙ}.�•õ; ÙÍOÙÍJ ÅÕåÙ,ÍÖ ÙáÑÁ; ÝåÝ!U >ÍýÝá,ÙÍk-ÙÍÖ ñÅÕåo&0%ÍÑÙ,Í` ÙáÑÁÍÖ }þgÚ; É}Š�؉}颋.:}Žã8Žc~I’$I~ÍÌÌÌL«ªªª*ÙÍkÙ·Ëxõ˸; }þˆ0GÅÕå,Í™åË<Ë}áõÍÑ,-(-ÙñáÑÁõÍJ ÝåÝ!Ù >ÍÝáñ0 õÙÍaÙÍ` ñ…o8 ñÈÙÍOþ á>Ãum.`1pF,þåt6|‰„!wS<ÿÃ.zÒ}[•|%¸FXc~üïýu€Ò÷r1}·ÈÝåÙÍOÙ¯Ëx(<˸õͨ 8Ù; ñËÿõÙÏŽé!~JÙͨ 0Í÷OÝ!—>ÙÝÍ<Ùͨ 8 = ìÙ ÝÙÙÍ7ËøÍÖ ÅÕåÍ<Í` ÙÍOÍÖ ÙáÑÁ; ÝåÍ÷ÝáÙÍ7ÍÖ ñ0 õÙÍW-ÍJ ñÝáËOÈËøÉçÏÌTöô¢0 jÁ‘ €µžŠoD€‚,:Í€jÁ‘ �€!¢ÚI}袋.º}Žã8Žc~I’$I’~ÍÌÌÌL«ªªªªÝ!Ó>ÅÕåõÍuÍ` ñÍÙáÑÁÃ` õÙÍ7õÙÅÕåÍ7ÍÖ ÙáÑÁÙÍ` ñ= éÙÍOÃÖ ÝÝnÝfÝ^ÝVÝNÝFÉ!�DLT\ÉI¢Ú!‚!É53ó!�úÉr1÷!€ÒÉÅÕåÙáÑÁÉÍ\!€> Ëx Ë#ËËË-= ðo˸ÉËxÙÍO(Ëø-ÍÖ ·Ë}(ËxËø>�½8(ÍC ,óÍC `iÈÃM!É>’Ãu|µÊ; Ë|ÍJ>�Ë| )=Ë|(úDMboÀ˸Éͦë8þ8ͦÙËxÙ(’0¯þ 8> ÕÍMÑËx(>-ͲË{(aËy(Ͱͦ ò\z·(>.Ͳ (Ͱ ÷ú~ͦ÷Ë{È>EͲ>+Ë|(|íDg>-Ͳ|/Ö 0ûÆ:ÝpÝ# ý~ý#· ý+>0ÝwÝ#Éýå,-  ý60ý#ø¯ÃJÅ˸}ÙÖ€oŸgMÍÄ|þÙ <ýwíDÍ }þ�0Í€ý5Ëø>„•.(ÍC Ë= øý~õ> xæÆ0ýwý#xæGÅÕåË%ÍP Ë%ÍP ëãÑãíZëáãíJDMáË%ÍP = ÈñÁýáÉýåá_~6þ5Øúi+~¨¥Ôh¶¿ÉìÅëx-ÐÍÎÂSÞùx9?ë+¨­ÅøÉ{Η@}·ÈËøÅÕ|ÍC ÍC „gãíZëáãíJDMá0ÍD ,7È}Æo˸ÉÍ ¾ #øyîO!@9ùi&ÝéÍ  ë¶¾ â#÷ÚÍ ¶w#ùëùÝéÍ /¦w#øïÍ ¦w#ùãýáÝá!9ë! E9ýéÝá!!9~·(¯+FÍŠ¦!"9ù!(#Ýé>¯2æýá*ÛͲ¯á"âýå|·>"Ê :æ·( ͆ *â6#wÉÍ÷*â6#6 ë!\$í°É!¶Ååí[Ûþ (úÍ„–( áÁã·É#ëÁÁþ:À~ÉCONTRMKBDLSTAUXUSR>¯2æÍîÍ$*â#~þ ͶÍ$*â:æ·> >w###6ÀÃÖþ þ #6++pÉ>¯2æíSäÍ-Í$Ͷ:Ù·À*â6###ww#w$w#wÖÿ:æ· åÍôá##N#F*ä·íBÈ>�à å¯w#w#í[äs#ráÃó>¯2æÍSÍ$ͶÍ$*â6å ë#Íá-¯Nw#FwÖÿq#p#6€#w#w#wÉÍß*â ë:æ·( ÕÍÑñÅÍÁ<Àxà *â6#ûÉ"â#~+þ 2ËN(>Í’:Ù· *âË^ îËFÈ*âå ëÍá< >ÿ2Ù6É"â~æÈÍŸ*â-¯w#wÕÿw#ÍóÍŸÀ"â~æÈ·ÍÀ ëÍ<À@ýá*ÛͲ¯áýåÍÀåÍ÷áåë!\ í°á åëÍÑ<Ê®!\$í°É>à >¯2æÍÀ*ß|µ>! ë*â \$í°\Í<(Ï!ý€í°:æ· í[1Ã�ÿÕÍ\ÍÑ!€ë·(éf"âÍÂÈ> 2ÙÉ:Ù·ÈñÉÝáÝåå!ÊÍ<áÉÝáÝå"âËF( #~þÀ#6Ãe>Îå!ÊÍ[áÉ"âËNÀ>ë!Ú~þ€8>O6*Û"ÝÍwþ (=þ(&þ("þ(þ :á·(ßÃNþ 8Øyº(Ô~#ÍèÌúx+Í% (½ï6Éå*â#~þáÉÍÂÈÍ[þÈÅÕå*â#~· *Ý~þ(h#"Ýb= Íõþ 8Íèþ ÌáñJ= ÍB== ͯ}8= ͵}/Í­ !*â###å~Æ-_~áþ(4òQ6*âËÖ>™2Ù>*â##wáÑÁÉ:Ù·>Àå*â##~áÉå*â#~þÿ(EÍÌÍ[þ ( þ (þ (þ ÍÖè!]Í[þ (þ (þ (þ(w#(ÍÖãÍÂÌÖ6áÉÝ!]Ý~·Èþ-ÀÝ#É8Ý~·È>7à ëÍ Í[ÃÖÍÖÉ>¯OÅÍkÁͼÈÅåÍÁÑÁÍÎØÌMës #rëÉÍkͼÈÅåÍpÙáÁÍÎØÙÌX ÙáåÍÌÍ[þ ÍÖôÍ[þ (þ( #w(ÍÖêÍÂÌÖáqÉ*â#~þÊáÍ[þ (þÈÍÖñÍ ÍÖþ ÀÃÖ*â##~þÈ6ÉÅÕåÍœáÑÁÉOÍ$*â#~þ(08áÅå·Ê¦=ʦ==Ê©=ʬò+ËÞ###å~Æ-_qá4ð6Í¡È>ðà *æ:è¾È4^qÉ}Ã’ÁÑÅÝ*ÛË|(ÍMëëË|( ÍMÝ6-Ý#ÕÍ�áͦí[ÛÝåá·íRë“8 (G> Í’ùCÈ~Í’#÷ÁÑÙáÑÁÙÅÝ*ÛÕÍôÇÁÑÅͦËC!h Ç!lÀTRUEFALSEͦ!9^#Í(ÑùÕÉá~#·(G~Í’#ùé> Í’> Ã’ "âËF!ÈÍ[¸(þÀ#ÉåÍRë·íRá0Íô*â4À#4É>™Ã åÍR·íR *â4 #4(áÍóÒ>òÜ>¯2çÍ$ë*âËV(/Ë–:ç·(#~+· x· y·ú2ÅÕ!͵ÑÁ( =(þ X:ç·(R*â:ç·(ËÞ###~Æ-Õ_ÑÖ-ÍŒí âX<òN=<ÍŒ*â###æw ÅÕåÍŸáÑÁ Õ*Ñ4 #4x±ÂüëÉ>™>ðà õ:ç·(ëñÉ"âÍŸÈè"*âËÖË^ÈËž*âËVÈË–åÅ0ëÍÁá ëÍ·ÉÁÑíSâÅåÍRÑ·íR8A*â N#F#s#rÍ$ 0}æ)ëíjëS\*â###w* N#Fë·íB ÈÕåÍŸÑár+sÉ>‘à ÕÙáÙ!T]>)ëíjëÙ)Ù0 0= ïÉÍU·íR!À#ÉÍUëÉ*â^#V#ÕN#F#^#VáÉ>">!2çDMÝáÑáÝå"â~æÊóx±(LÅÕÍ*â ë:çOÍÑÁ·(o:çþ" C}=(þ ?ÅÕ*â-N#Fp+qÛÿq#pÑÁ!€ë °*â F+N+++V+^ë·íBÐëq#pÉ>™>ð>à ÁÑíSâÅåÍRÑ·íRÚ*â s#r$ s#rÉ"äíSæëá"â! N#Fë·íB(^x± *â 6#ûí[âÍ<(H*â! íKäq#p##ëíKæÅÕÍí[â!Í· *â! 4 #4Ñ!€ëÁ x± Õ*â$ éÝ*â>ðÃw"òëáã"ô{æü_!í"ëÝ*íÝnÝf}´(HíR0ÝnÝfåÝ"ëÝáã Ý^ÝVÝåMDÝnÝfÝåÝÝuÝtÝqÝpÝåÑ*ës#rÑ*ôs#rÉÝåá"Í*ò ÝåÁ Ú5íKÏíB!Úð>ÿÃuëáã~#fo{æü_ë"ò*íåÝá·íR0RÝnÝfå·íR0ÝáðáÕýáíKòýqýpýuýtÝsÝrÝåáÝNÝFÍÄ( Ý^ÝVÕÝáÝåáÝNÝFÝ^ÝV*ííSíÕÝáÝuÝtíKòÝqÝpë ·íRÀÕýá*Í·íR(ý~Ýwý~Ýwýnýf ÝuÝt¯ÉÝåá"Í6#ûÉÍ *öÉÍ *øÉ!"ö"øÝ*íÝNÝFy°(*ö "ö*ø·íB0íCøÝnÝfåÝáØ*Ïûÿ í[Í·íRØë*ö"ö*ø·íRÐíSøÉí[Ís#rÉ^#VíSÍÉ>¯O"æ¯w2Ùx2è!ê"âá"äá ÍöÍ@*äé>¯2ê"æ!ê"âá"äá"è!\Ͳ¯*è:ê· ÍîÍ!Ù~6·go(Ýåá\íRë*æs#r¯ÿí_2ÔÉëÝáÁáx±( s x±(T]í°ÝéDMÝáÑá·íR0ð ë ëí¸ÝéÑÁÕ-a%ÃÆ}Í„oÉ*é!Ù~6o&ÉÍ |µÈÍ£}þÀÝáÍ%^C User break1:Ù·ÈÝáõÍ% I/OÝáÍ% Run-timeÍ% error Í’Í%, PC=Ýåáí[Õ·íR"×Í�Í% Program aborted*ßé1!€Ÿ¸ÿÍ�!¿;˜žͲÃ8!å!Í!å!ÑÍ5z³Ê Õ"ŸÍRÍ�Íb*Ÿ#ÑÃü!å!ÍÉ!å!FÑÍ5z³ÊX Õ"Ÿ*Ÿå!ÍÍR!$ÍòÍ�Íb*Ÿ#ÑÃ- !å!FÑÍ5z³ÊŽ Õ"Ÿ*Ÿå!ÍÍR!$ÍòÍ�Íb*Ÿ#ÑÃc !å!ÑÍ5z³ÊÄ Õ"Ÿ!å*ŸÍÍR!$ÍòÍ�Íb*Ÿ#ÑÙ !å!ÑÍ5z³Êú Õ"Ÿ!Få*ŸÍÍR!$ÍòÍ�Íb*Ÿ#ÑÃÏ É!_ŸÍüÅÕå!å!å!öž Ís!YŸÍüÅÕå!å!å!ëž Ís!SŸÍüÅÕå!å!å!Õž Ís!ÁÍ[! ÍòÍ� INITIAL INVESTMENT? = $!öžÍ !ÍqÍ�Íb!ÁÍ[! ÍòÍ� ANNUAL INTEREST RATE? = !ëžÍ !ÍqÍ� %Í�Íb!ÁÍ[! ÍòÍ� YEARS OF INVESTMENT? = *!Ÿå!ÍöÍ�Íb!ÁÍ[! ÍòÍ� MONTHLY INVESTMENT? = $!ÕžÍ !ÍqÍ�Íb!ÁÍ[! ÍòÍ�Í�Íb!ÁÍ[Í�Í�Íb!ÁÍ[! Íò!$Íò! ŸÍ !ÍqÍ� THIS IS THE FINAL BALANCEÍ�Íb!ÁÍ[Í�Í�Íb!ÁÍ[Í�Í�ÍbÉ!_ŸÍüÅÕå!å!å!öž Ís!YŸÍüÅÕå!å!å!ëž Ís!kŸÍüÅÕå!å!å!Õž Ís!ÁÍ[! ÍòÍ� INITIAL VALUE OF THE LOAN = $!öžÍ !ÍqÍ�Íb!ÁÍ[! ÍòÍ� ANNUAL INTEREST RATE = !ëžÍ !ÍqÍ�% Í�Íb!ÁÍ[! ÍòÍ� LENGTH OF LOAN = *!Ÿå!ÍöÍ� YearsÍ�Íb!ÁÍ[! ÍòÍ� *Ÿå!ÍöÍ� MonthsÍ�Íb!ÁÍ[! ÍòÍ� FINAL BALLOON PAYMENT = $!ÕžÍ !ÍqÍ�Íb!ÁÍ[Í�Í�Íb!ÁÍ[Í�Í�Íb!SŸÍüÅÕå!å!å!Ÿ Ís!eŸÍüÅÕå!å!å! Ÿ Ís!ÁÍ[! Íò!$Íò!ŸÍ !ÍqÍ�" THIS IS THE PAYMENT OF EACH MONTHÍ�Íb!ÁÍ[Í�Í�Íb!ÁÍ[Í�Í�Íb!ÁÍ[! Íò!$Íò! ŸÍ !ÍqÍ� THIS IS THE FINAL PAYMENTÍ�Íb!ÁÍ[Í�Í�Íb!ÁÍ[Í�Í�ÍbÉÍçÍ" !å!ÍÍRÍ� INITIAL INVESTMENT? = $___Í�Íb!å!ÍÍRÍ� ANNUAL INTEREST RATE? = ___ %Í�Íb!å!ÍÍRÍ� YEARS OF INVESTMENT? = __Í�Íb!å!ÍÍRÍ� MONTHLY INVESTMENT? = $___Í�Íb!å!Í!_ŸÍ+ÍÍ_Íb!å!Í!YŸÍ+ÍÍ_Íb!å!Í!!ŸÍ+ÍîÍ_Íb!å!Í!SŸÍ+ÍÍ_Íb!YŸÍüÅÕå!°ÍÑÙáÑÁÍÉ Ù!5ŸÍ¡*!Ÿå! ÑÍÄ"%Ÿ!ÍÑÙ!/ŸÍ¡!å*%ŸÑÍ5z³ÊD'Õ"'Ÿ!/ŸÍüÅÕå!å!5ŸÍüÙáÍÑͳ ÙáÑÁÍÄ Ù!/ŸÍ¡*'Ÿ#Ñà '!SŸÍüÅÕå!å!5ŸÍüÙáÍÑͳ ÙáÑÁÍÄ ÅÕå!/ŸÍüÅÕå!ÍÑÙáÑÁͼ ÅÕå!5ŸÍüÙáÑÁÍÉ ÙáÑÁÍÄ Ù!AŸÍ¡!_ŸÍüÅÕå!/ŸÍüÙáÑÁÍÄ Ù!GŸÍ¡!AŸÍüÅÕå!GŸÍüÙáÑÁͳ Ù!eŸÍ¡!eŸÍüÅÕå!å!å! Ÿ Ís!å! Í*Ÿå!ÑÍNËEÊ«(ÍR!$Íò! ŸÍ !ÍqÍ� THIS IS THE FINAL BALANCEÍ�Íb!å!ÍÍRÍ� Do you want a hard copy? Y/NÍ�Íb!-å!Í!¾Í8!{ŸÍÛÍb*{Ÿ&Í(å!YÑÍNËEÊ«(Íû *Ÿå!ÑÍNËEÊJ*Íç!å!Í!å*!ŸÑÍ5z³ÊD*Õ"'Ÿ!å! ÑÍ5z³Êu)Õ"Ÿ!SŸÍüÅÕå!å!5ŸÍüÙáÍÑͳ ÙáÑÁÍÄ Ù!AŸÍ¡!_ŸÍüÅÕå!å!5ŸÍüÙáÍÑͳ ÙáÑÁÍÄ Ù!GŸÍ¡!AŸÍüÅÕå!GŸÍüÙáÑÁͳ Ù!eŸÍ¡!eŸÍüÙ!_ŸÍ¡*Ÿ#ÑÃç(!eŸÍüÅÕå!å!å! Ÿ ÍsÍR!$Íò! ŸÍ ! ÍqÍ� Balance at end of year *'Ÿå!ÍöÍ�Íb*Ÿå!ÑÍNå*'Ÿå*!ŸÑÍNÑ}³oËEÊ/*!"ŸÍRÍ� Press any key to continueÍ�Íb!¾Í8!{ŸÍÛÍbÍç*Ÿå!Ñ"Ÿ*'Ÿ#ÑÃÓ(!"Ÿ*Ÿå!ÑÍNËEÊØ+ÍRÍ�ÍbÍRÍ�ÍbÍRÍ�ÍbÍû !ÁÍ[! ÍòÍ�Íb!å*!ŸÑÍ5z³ÊØ+Õ"'Ÿ!å! ÑÍ5z³Ê7+Õ"Ÿ!SŸÍüÅÕå!å!5ŸÍüÙáÍÑͳ ÙáÑÁÍÄ Ù!AŸÍ¡!_ŸÍüÅÕå!å!5ŸÍüÙáÍÑͳ ÙáÑÁÍÄ Ù!GŸÍ¡!AŸÍüÅÕå!GŸÍüÙáÑÁͳ Ù!eŸÍ¡!eŸÍüÙ!_ŸÍ¡*Ÿ#Ñé*!eŸÍüÅÕå!å!å! Ÿ Ís!ÁÍ[! Íò!$Íò! ŸÍ ! ÍqÍ� Balance at end of year *'Ÿå!ÍöÍ�Íb*Ÿå!=ÑÍNËEÊÃ+!"Ÿ!ÁÍ[! ÍòÍ�Íb*Ÿå!Ñ"Ÿ*'Ÿ#ÑÕ*!"ŸÉÍçÍ" !å!ÍÍRÍ�) INITIAL VALUE OF THE LOAN = $____ Í�Íb!å!ÍÍRÍ�) ANNUAL INTEREST RATE = ____% Í�Íb!å!ÍÍRÍ�* LENGTH OF LOAN = ___ Years Í�Íb!å!ÍÍRÍ�* & ___ MonthsÍ�Íb!å!ÍÍRÍ�' FINAL BALLOON PAYMENT = $___ Í�Íb!#å!Í!_ŸÍ+ÍÍ_Íb!#å!Í!YŸÍ+ÍÍ_Íb!#å!Í!!ŸÍ+ÍîÍ_Íb!#å!Í!ŸÍ+ÍîÍ_Íb!#å!Í!kŸÍ+ÍÍ_Íb!YŸÍüÅÕå!°ÍÑÙáÑÁÍÉ Ù!5ŸÍ¡*!Ÿå! ÑÍÄå*ŸÑ"%Ÿ!ÍÑÙ!/ŸÍ¡!å*%ŸÑÍ5z³Ê&.Õ"'Ÿ!/ŸÍüÅÕå!å!5ŸÍüÙáÍÑͳ ÙáÑÁÍÄ Ù!/ŸÍ¡*'Ÿ#ÑÃë-!å!/ŸÍüÙáÍÑÍÉ Ù!;ŸÍ¡!_ŸÍüÅÕå!kŸÍüÅÕå!;ŸÍüÙáÑÁÍÄ ÙáÑÁͼ Ù!AŸÍ¡!å!;ŸÍüÙáÍÑͼ ÅÕå!5ŸÍüÙáÑÁÍÉ Ù!GŸÍ¡!AŸÍüÅÕå!GŸÍüÙáÑÁÍÉ Ù!SŸÍ¡!AŸÍüÅÕå!GŸÍüÙáÑÁÍÉ ÅÕå!kŸÍüÙáÑÁͳ Ù!eŸÍ¡*Ÿå!ÑÍNËEÊS1ÍçÍRÍ�4Payment # | Payment | Principal | Interest | BalanceÍ�Íb!_ŸÍüÙ!)ŸÍ¡!å*%ŸÑÍ5z³ÊM1Õ"Ÿ!SŸÍüÅÕå!)ŸÍüÅÕå!5ŸÍüÙáÑÁÍÄ ÙáÑÁͼ Ù!;ŸÍ¡!_ŸÍüÅÕå!;ŸÍüÙáÑÁͼ Ù!)ŸÍ¡!)ŸÍüÙ!_ŸÍ¡!SŸÍüÅÕå!;ŸÍüÙáÑÁͼ Ù!eŸÍ¡!SŸÍüÅÕå!å!å!Ÿ Ís!;ŸÍüÅÕå!å!å! Ÿ Ís!eŸÍüÅÕå!å!å!Êž Ís!)ŸÍüÅÕå!å!å!¿ž ÍsÍRÍ�# *Ÿå!ÍöÍ� $!ŸÍ !ÍqÍ� $! ŸÍ !ÍqÍ� $!ÊžÍ !ÍqÍ� $!¿žÍ ! ÍqÍ�Íb*Ÿå!ÑÍNå*Ÿå*%ŸÑÍNÑ}³oËEÊ81!"ŸÍRÍ� Press any key to continueÍ�Íb!¾Í8!{ŸÍÛÍbÍçÍRÍ�4Payment # | Payment | Principal | Interest | BalanceÍ�Íb*Ÿå!Ñ"Ÿ*Ÿ#ÑÃK/!"Ÿ*Ÿå!ÑÍNËEÊú3ÍÄ"!ÁÍ[! ÍòÍ�Íb!YŸÍüÅÕå!å!å!´ž Ís!ÁÍ[! ÍòÍ�5Payment # | Payment | Principal | Interest | BalanceÍ�Íb!_ŸÍüÙ!)ŸÍ¡!å*%ŸÑÍ5z³Êô3Õ"Ÿ!SŸÍüÅÕå!)ŸÍüÅÕå!5ŸÍüÙáÑÁÍÄ ÙáÑÁͼ Ù!;ŸÍ¡!_ŸÍüÅÕå!;ŸÍüÙáÑÁͼ Ù!)ŸÍ¡!)ŸÍüÙ!_ŸÍ¡!SŸÍüÅÕå!;ŸÍüÙáÑÁͼ Ù!eŸÍ¡!SŸÍüÅÕå!å!å!Ÿ Ís!;ŸÍüÅÕå!å!å! Ÿ Ís!eŸÍüÅÕå!å!å!Êž Ís!)ŸÍüÅÕå!å!å!¿ž Ís!ÁÍ[! ÍòÍ�# *Ÿå!ÍöÍ� $!ŸÍ !ÍqÍ� $! ŸÍ !ÍqÍ� $!ÊžÍ !ÍqÍ� $!¿žÍ ! ÍqÍ�Íb*Ÿå*%ŸÑÍNËEÊl3!ÁÍ[! ÍòÍ�Íb*Ÿå!=ÑÍNËEÊß3!"Ÿ!ÁÍ[! ÍòÍ�Íb!ÁÍ[! ÍòÍ�5Payment # | Payment | Principal | Interest | BalanceÍ�Íb*Ÿå!Ñ"Ÿ*Ÿ#ÑÃô1!"Ÿ*Ÿå!ÑÍNËEÊ15!SŸÍüÅÕå!å!å!Ÿ Ís!eŸÍüÅÕå!å!å! Ÿ Ís!å! ÍÍR!$Íò!ŸÍ !ÍqÍ�" THIS IS THE PAYMENT OF EACH MONTHÍ�Íb!å! ÍÍR!$Íò! ŸÍ !ÍqÍ� THIS IS THE FINAL PAYMENTÍ�Íb!å!ÍÍRÍ� Do you want a hard copy? Y/NÍ�Íb!-å!Í!¾Í8!{ŸÍÛÍb*{Ÿ&Í(å!YÑÍNËEÊ15ÍÄ"!"ŸÉ*#Ÿå!Ñ"#Ÿ*#Ÿ·íRÂÅ5ÍRÍ�- "... There is none righteous, no, not one." Í�ÍbÍRÍ�+ Rom. 3:10Í�ÍbÃì7·íRÂE6ÍRÍ�- "For all have sinned, and come short of the Í�ÍbÍRÍ�, glory of God." Rom. 3:23Í�ÍbÃì7·íRÂ7ÍRÍ�- "For the wages of sin is death; but the giftÍ�ÍbÍRÍ�. of God is eternal life through Jesus Christ Í�ÍbÍRÍ�- our Lord." Rom. 6:23Í�ÍbÃì7·íRÂì7ÍRÍ�+ "That if thou shalt confess with thy mouthÍ�ÍbÍRÍ�- the Lord Jesus, and shalt believe in thine Í�ÍbÍRÍ�* heart that God hath raised him from the Í�ÍbÍRÍ�+ dead, thou shalt be saved." Rom. 10:9Í�Íb*#Ÿå!ÑÍNËEÊ8!"#ŸÉÍçÍRÍ�* This program written by Charles J. ArnettÍ�ÍbÍRÍ�* of Union, Ohio Phone No. 513-836-3272 Í�ÍbÍRÍ�* Please call if you have any questions Í�ÍbÍRÍ� or comments Í�ÍbÍRÍ�Íb!"Ÿ!"#ŸÍRÍ�Type M for MenuÍ�Íb!¾Í8!zŸÍÛÍb*Ÿå!ÑÍNËEÊ(9Íç!"Ÿ!å!ÍÍ85!å! ÍÍRÍ�$ Type S to Run the Savings program Í�Íb!å! ÍÍRÍ�1 Type G to show the Growth of the savings programÍ�Íb!å! ÍÍRÍ�: Type C for hard Copy of the Growth of the savings programÍ�Íb!å!ÍÍRÍ�! Type L to Run the Loan program Í�Íb!å!ÍÍRÍ�+ Type P For Hard copy of Loan Amortization Í�Íb!å!ÍÍRÍ�* Type D For Display of Loan Amortization Í�Íb!å!ÍÍRÍ� Type Q to quit program Í�Íb!¾Í8!zŸÍÛÍb*zŸ&Í(}2yŸ*yŸ&P·íRÂ.;!"ŸÍß+à;D·íRÂD;!"ŸÍß+à;C·íRÂZ;!"ŸÍ�%à;G·íRÂp;!"ŸÍ�%à;S·íR€;Í�%à;L·íRÂ�;Íß+à;M·íR ;!"Ÿ*yŸ&å!QÑÍNËEÊ9!å!ÍÃÅß+Ã6;C·íRÂC!"ŸÍ�%ÃL;G·íRÂG!"ŸÍ�%Ãb;S·íRÂSÍ�%Ãx;#ŸÉÍçÍRÍ�* This program written by Charles J. ArnettÍ�ÍbÍRÍ�* of Union, Ohio Phone No. 513-836-3272 Í�ÍbÍRÍ�* Please call if you have any questions Í�ÍbÍRÍ� or comments Í�ÍbÍRÍ�Íb!"Ÿ!"#ŸÍRÍ�Type M for Menu{ MONEY Version 2 7/04/85 } { Created by Charles J. Arnett } { 111 Worman Dr. } { Union OH 45322 } { 1-513-836-3272 } { This program is used to calculate } { Money accounts. ie. IRA's, Savings, or Loan payments } ---------------------------------------------------------------- MONEY2 The program Money2 is the same as Money1 except you can use the Loan program for fractional parts of years. If your loan is for 18 months you can use Money2. Money1 is only for whole number of years. I didn't rework the savings portion, because I think most people will want their savings accounts for a specific number of years. --------------------------------------------------------------- MONEY1 The program MONEY1 will operate on any CP/M 2.2 machine. To use this program on CP/M 3.x you must run TPATCH.COM first. When the MENU appears, select the program that you wish to run. The Savings Program will prompt you at to an initial ammount, a monthly investment, the annual interest rate, and the number of years of the account. This program assumes that you make your first month's investment at the same time you put in your initial ammount. This works for an IRA account also. Any difference between this program and your bank may be in the type of compounding. This program coumpounds monthly. After you have ran this program you will be given the choice of getting a hard copy if your computer is connected toa printer. The hard copy shows only the final balance at the end of the account. If you would like to see your yearly growth on an IRA or regular savings use option G. If you want a hard copy of your yearly growth use Option C. The Loan Program is equally simply to use. The program will prompt you as to the initial ammount of the Loan, the annual interest rate, the number of years of the Loan, and the ballon payment. Note the ballon payment is added to the monthly payment to give the final payment. After the program calculates your monthly payment, interest if figured monthly on the unpayed balance, you will be given the opportunity to gety a hard copy of the loan information. Option D will display the Loan amoratization information on the screen for you. This was designed for an 80 column display. Option P will print out the monthly amoratization informatin on your LST divice. THis was written in Turbo Pascal and the source code is given for your convience. If you modify it and put it back on the BBs please give it a new number and add a note stating what the change was for. If you have any questions or would like me to modify the program for you please call me. Charles J. Arnett 111 Worman. Dr Union Ohio 45322 1-513-836-3272 mber of years of the Loan, and the ballon payment. Note the ballon payment is added to the monthly payment to give the fin{ Created by Charles J. Arnett } { 111 Worman Dr. } { Union OH 45322 } { 1-513-836-3272 } { Version 1.00 June 29, 1985 } { Version 2.00 July 4, 1985 } { Rev. 2 is adding months to duration of Loan. } { You can now figure loan for fractional part of years } { This program is used to calculate } { Money accounts. ie. IRA's, Savings, or Loan payments } PROGRAM Money; VAR Answer,Kind,Kind1,Enuf : CHAR; VAR S,L,P,D,Q,G,C : CHAR; VAR BalloonPayment, FinalAmount, InitialAmount, AnnualInterestRate, MonthlyAmount, F,R,H,W,X,Z,U : REAL; VAR I, Y, VerseCount, YearsOfAccount, AA, BB, CC, DD, EE : INTEGER; VAR J, K, A1, B1, C1, D1, K1, J1, I1 : STRING[10]; Procedure ClearScreen; Begin GOTOXY(20,20); FOR BB := 1 TO 30 DO WRITELN; { This will clear any screen } gotoXY(1,1); End; Procedure DrawBox; Begin FOR AA := 1 TO 70 DO BEGIN gotoXY(AA,1); WRITELN('$'); END; FOR AA := 1 TO 70 DO BEGIN gotoXY(AA,21); WRITELN('$'); END; FOR AA := 1 TO 20 DO BEGIN GOTOXY(1,AA); WRITELN('$'); END; FOR AA := 1 TO 20 DO BEGIN GOTOXY(70,AA); WRITELN('$'); END; End; { End Draw Box } Procedure PrintSavings; begin { Begin routine to print savings } STR(InitialAmount:6:2,A1); STR(AnnualInterestRate:6:2,B1); STR(MonthlyAmount:6:2,D1); WRITELN(Lst,Chr(09),' INITIAL INVESTMENT? = $',A1); WRITELN(Lst,Chr(09),' ANNUAL INTEREST RATE? = ',B1,' %'); WRITELN(Lst,Chr(09),' YEARS OF INVESTMENT? = ',YearsOfAccount); WRITELN(Lst,Chr(09),' MONTHLY INVESTMENT? = $',D1); WRITELN(Lst,Chr(09),''); WRITELN(Lst,''); WRITELN(Lst,Chr(09),'$',J,' THIS IS THE FINAL BALANCE'); WRITELN(Lst,''); WRITELN(Lst,''); end; { End routine to Print Savings routine } Procedure PrintLoan; begin { Print Loan Summery } STR(InitialAmount:6:2,A1); STR(AnnualInterestRate:6:2,B1); STR(BalloonPayment:6:2,D1); WRITELN(Lst,Chr(09), ' INITIAL VALUE OF THE LOAN = $',A1); WRITELN(Lst,Chr(09), ' ANNUAL INTEREST RATE = ',B1,'% '); WRITELN(Lst,Chr(09), ' LENGTH OF LOAN = ',YearsOfAccount,' Years'); WRITELN(Lst,Chr(09), ' ',EE,' Months'); WRITELN(Lst,Chr(09), ' FINAL BALLOON PAYMENT = $',D1); WRITELN(LST,''); WRITELN(LST,''); STR(MonthlyAmount:4:2,K); STR(FinalAmount:4:2,J); WRITELN(Lst,Chr(09),'$',K,' THIS IS THE PAYMENT OF EACH MONTH'); WRITELN(LST,''); WRITELN(LST,''); WRITELN(LST,Chr(09),'$',J,' THIS IS THE FINAL PAYMENT'); WRITELN(LST,''); WRITELN(LST,''); end; { End routine to Print Loan summery } PROCEDURE Savings; BEGIN { Ira or savings account } ClearScreen; DrawBox; GOTOXY(4,3); WRITELN(' INITIAL INVESTMENT? = $___'); GOTOXY(4,4); WRITELN(' ANNUAL INTEREST RATE? = ___ %'); GOTOXY(4,5); WRITELN(' YEARS OF INVESTMENT? = __'); GOTOXY(4,6); WRITELN(' MONTHLY INVESTMENT? = $___'); GOTOXY(29,3); READLN(InitialAmount); GOTOXY(29,4); READLN(AnnualInterestRate); GOTOXY(29,5); READLN(YearsOfAccount); GOTOXY(29,6); READLN(MonthlyAmount); X := AnnualInterestRate/1200; { Monthly Interest } Y := YearsOfAccount*12; { Number of months } Z := 1; FOR I := 1 to Y DO { Total Interest } Z := Z * (1 + X); H := MonthlyAmount*(1+X)*((Z-1)/X); { Growth of monthly investment } R := InitialAmount*Z; { Growth of initial investment } FinalAmount := H+R; { Total growth } STR(FinalAmount:6:2,J); GOTOXY(20,10); if DD = 0 THEN BEGIN WRITELN ('$',J,' THIS IS THE FINAL BALANCE'); GOTOXY(5,18); WRITELN(' Do you want a hard copy? Y/N'); GOTOXY(45,18); READ(KBD,Answer); If UpCase(Answer) = 'Y' then PrintSavings; End; { end regular savings account } if DD = 1 THEN {Display yearly Growth of Saavings } BEGIN ClearScreen; GOTOXY(1,1); FOR I := 1 to YearsOfAccount DO { Total Interest } begin FOR CC := 1 to 12 do BEGIN H := MonthlyAmount*(1 + X); { Growth of monthly investment } R := InitialAmount*(1 + X); { Growth of initial investment } FinalAmount := H+R; { Total growth } InitialAmount := FinalAmount; END; STR(FinalAmount:6:2,J); WRITELN ('$',J:9,' Balance at end of year ',I); IF (DD = 20) OR (I = YearsOfAccount ) THEN BEGIN DD := 1; WRITELN(' Press any key to continue'); READ(KBD,ANSWER); ClearScreen; END; DD := DD + 1; End; DD := 8; End; { end of display yearly growth } if DD = 2 THEN { Print yearly Growth of Saavings } BEGIN WriteLn; WriteLn; WriteLn;  PrintSavings; WriteLn(Lst,Chr(12)); FOR I := 1 to YearsOfAccount DO { Total Interest } begin FOR CC := 1 to 12 do BEGIN H := MonthlyAmount*(1 + X); { Growth of monthly investment } R := InitialAmount*(1 + x); { Growth of initial investment } FinalAmount := H+R; { Total growth } InitialAmount := FinalAmount; END; STR(FinalAmount:6:2,J); WRITELN (LST,CHR(09),'$',J:9,' Balance at end of year ',I); IF DD = 61 THEN BEGIN DD := 1; WRITELN(Lst,Chr(12)); END; DD := DD + 1; End; { Print list of growth } END; DD := 8; END; { End savings routine } PROCEDURE Loan; BEGIN ClearScreen; DrawBox; GOTOXY(3,3); WRITELN( ' INITIAL VALUE OF THE LOAN = $____ '); GOTOXY(3,4); WRITELN( ' ANNUAL INTEREST RATE = ____% '); GOTOXY(3,5); WRITELN( ' LENGTH OF LOAN = ___ Years '); GOTOXY(3,6); WRITELN( '  & ___ Months'); GOTOXY(3,7); WRITELN( ' FINAL BALLOON PAYMENT = $___ '); gotoxy(35,3); READLN(InitialAmount); gotoxy(35,4); READLN(AnnualInterestRate); gotoxy(35,5); READLN(YearsOfAccount); gotoxy(35,6); READLN(EE); gotoxy(35,7); READLN(BalloonPayment); X := AnnualInterestRate/1200; { Monthly Interest } Y := (YearsOfAccount*12) + EE; { Number of months } Z := 1; FOR I := 1 to Y DO { Total Interest } Z := Z * (1 + X); W := 1/Z; { Reciprocal of Interest } H := InitialAmount-(BalloonPayment*W); { Initial loan minus effective value of ballon payment } R := (1-W)/X; MonthlyAmount := H/R; { Monthly payments } FinalAmount := (H/R) + BalloonPayment; { Monthly payment plus final ballon payment } if DD = 1 then { Dispay Amortization chart } begin ClearScreen; Writeln('Payment # | Payment | Principal | Interest | Balance'); U := InitialAmount; for CC := 1 to Y do begin  W := MonthlyAmount - (U*X); { Principal } U := InitialAmount - W; { New Balance } InitialAmount := U; FinalAmount := MonthlyAmount - W; { Interest } STR(MonthlyAmount:4:2,K); STR(W:4:2,J); STR(FinalAmount:4:2,K1); STR(U:4:2,J1); Writeln('# ',CC:3,' $',K:7,' $',J:7,' $',K1:7,' $',J1:9); IF (DD = 20) OR (CC = Y ) THEN BEGIN DD := 1; WRITELN(' Press any key to continue'); READ(KBD,ANSWER); ClearScreen; Writeln('Payment # | Payment | Principal | Interest | Balance'); END; DD := DD + 1; End; DD := 8; End; { Print out amortization chart } if DD = 2 then begin PrintLoan; WriteLn(Lst,Chr(12)); STR(AnnualInterestRate:2:2,I1); Writeln(Lst,Chr(09),'Payment # | Payment | Principal | Interest | Balance'); U := InitialAmount; for CC := 1 to Y do begin W := MonthlyAmount - (U*X); { Principal } U := InitialAmount - W; { New Balance } InitialAmount := U; FinalAmount := MonthlyAmount - W; { Interest } STR(MonthlyAmount:4:2,K); STR(W:4:2,J); STR(FinalAmount:4:2,K1); STR(U:4:2,J1); Writeln(Lst,Chr(09),'# ',CC:3,' $',K:7,' $',J:7,' $',K1:7,' $',J1:9); IF CC = Y THEN WRITELN(Lst,Chr(12)); IF DD = 61 THEN BEGIN DD := 1; WRITELN(Lst,Chr(12)); Writeln(Lst,Chr(09),'Payment # | Payment | Principal | Interest | Balance'); END; DD := DD + 1; End; DD := 8; End; { End Hard copy of amortization } If DD = 0 then Begin STR(MonthlyAmount:4:2,K); STR(FinalAmount:4:2,J); gotoxy(15,10); WRITELN('$',K,' THIS IS THE PAYMENT OF EACH MONTH'); gotoxy(15,12); WRITELN('$',J,' THIS IS THE FINAL PAYMENT'); GOTOXY(5,18); WRITELN(' Do you want a hard copy? Y/N'); GOTOXY(45,18); READ(KBD,Answer); If UpCase(Answer) = 'Y' then PrintLOAN; End; DD := 8; End; Procedure RomansRoad; Begin VerseCount := VerseCount + 1; Case VerseCount of 1 : begin WriteLn(' "... There is none righteous, no, not one." '); WriteLn(' Rom. 3:10'); end; 2 : begin WriteLn(' "For all have sinned, and come short of the '); WriteLn(' glory of God." Rom. 3:23'); end; 3 : begin WriteLn(' "For the wages of sin is death; but the gift'); WriteLn(' of God is eternal life through Jesus Christ '); WriteLn(' our Lord." Rom. 6:23'); end; 4 : begin WriteLn(' "That if thou shalt confess with thy mouth'); WriteLn(' the Lord Jesus, and shalt believe in thine '); WriteLn(' heart that God hath raised him from the '); WriteLn(' dead, thou shalt be saved." Rom. 10:9');  end; end; if VerseCount = 4 then VerseCount := 0; end; Begin { start main routine } ClearScreen; WRITELN(' This program written by Charles J. Arnett'); WRITELN(' of Union, Ohio Phone No. 513-836-3272 '); WRITELN(' Please call if you have any questions '); writeln(' or comments '); WriteLn; DD := 8; VerseCount := 0; WriteLn('Type M for Menu'); READ(KBD,Kind); REPEAT IF DD = 8 THEN ClearScreen; DD := 0; gotoXY(2,5); RomansRoad; gotoXY(3,09); WRITELN(' Type S to Run the Savings program '); gotoXY(3,11); WRITELN(' Type G to show the Growth of the savings program'); gotoXY(3,13); WRITELN(' Type C for hard Copy of the Growth of the savings program'); gotoXY(3,15); WRITELN(' Type L to Run the Loan program '); gotoXY(3,17); WRITELN(' Type P For Hard copy of Loan Amortization '); gotoXY(3,19); WRITELN(' Type D For Display of Loan Amortization '); gotoXY(3,21); WRITELN(' Type Q to quit program '); READ(KBD,Kind); Kind1 := UpCase(Kind); Case Kind1 of 'P' : Begin DD := 2; Loan; End; 'D' : Begin DD := 1; Loan; End; 'C' : Begin DD := 2; Savings; End; 'G' : Begin DD := 1; Savings; End; 'S' : Savings; 'L' : Loan; 'M' : DD := 8; End; UNTIL Kind1 = 'Q'; GOTOXY(1,23) END.  WRITELN(' Type S to Run the Savings program '); gotoXY(3,11); WRITELN(' Type G to show the Growth of the savings program'); gotoXY(3,13); WRITELN(' Type C for hard Copy of the Growth of the savings program'); gotoXY(3,15); WRITELN(' Type L to Run the Loan program '); gotoXY(3,17); WRITELN(' Type P For Hard copy of Loan Amortization '); gotoXY(3,19); WRITELN(' Type D For Display of Loan Amortization '); gotoXY(3,21); WRITELN(' Type Q to quit program '); READ(KBD,KinÃv4Copyright (C) 1983 BORLAND Inc Osborne 1= ()TERPœ<~·7È#õå~ÍÕáñ=ÈóÍø ÉÅÕåÝåýåõo&åͦñýáÝááÑÁÉoåͦÉþ€ÜcÔ|æîÅÕåÝåÍ£}Ýå!Ûå!Õ" áãõÅÕ~#·(åÍÕáôÑÁñãÉ}´È:8‡‡‡ããããÅÒÁ= ô+èÍ¥Ø*ŠßõÅÕå!vÍ-!pÍ¥*|ÔáÑÁñÉõÅÕå!˜éõÅÕå!’àõ:�·(ÅÕå=2�!„Í-áÑÁñÉõ:�· ÷ÅÕå<2�!~åõÅÕå!ŒÛõÅÕååð!Yí°Ñ:jO:l‚ÕÍÓÑ:kO:mƒÍÓ!ðÍ¥*nÍáÑÁñÉ!ð ë!i45(É!+/ –0ü†õyþ0(ñíÉ d!9Ã-!IÃ-Í[æÍ[o&Éô  áÁå:á·(yþ ÕÅÍ |µ(Íçþ ÍçþÊrÁÑ*é"ÛÕx2áy·( >Ã28!ì"9!œ í°!´¸í°áí°>2Ú¯Ãßà ÃÃ0Ã&Ã+Ã!Ã0Ãÿ í[Ûþ (ú!eÍPÍWþA8þQ0Gþ: xÖ@¯!\w# ( þ  ÍLÍ)þ. Í)!h6#ûÉ (þ*(þ.(þ!8þ}(þ*(ÍWw#ßÉ>?> w#üÉþaØþ{ÐÖ É|Íe}õÍnñæÆ�'Î@'ý¯7Ë|À|·}È>ÿÉ"ÍíCßëÑùü "Ïë"Õéå*Ï·íB"Ïí[Í·íRëáÚöí°É*Ïí°"ÏÙÉ^#V#Õ^#V#N#FáÉÝáëO/o&ÿ9ùëí°ÝéÑO/o&ÿ9ùëí°éÝáë!àÿ9ùëÅ(¯üí°Á> �‘(G¯üÝéÝá!àÿ9ù ¯w#üÝéÝáEÍM¶wÝéÝáÑ}“8÷�Ã"·íR·íB0 É>‘î·íRëêðøÉÕë·íRëáë·íR!È+ÉÍk õÍ= ð·íR!À+ÉÍk õÍ= ðÍÿ!Ð+ÉÍk õÍ= ðÍÿ!ÈØ+ÉÍk ôÍ= ïÍÿ!ÈØ#ÉÍk ôÍ= ïÍÿ!Ø+ÉÍk õÍ= ðT]KBë!z·> S>)ë)ë0 = öÉ|ªõÍ ëÍ ëDM¯go>íjíB0 7?ËË= ðëñðHåÍË<ËÑëÍ¡ëËzÈ5ÍîÈ)ýÉÍîÈË<ËúÉëz· {þ0G·É¯goÉë|ª|ú ºÀ}»ÉÉË|È|/g}/o#É}æo&ÉíKÓí[ÑÅÕxAJSËËËËáëáíJDM!éb"Ñë!6íJ"ÓDMÉ'ÍoèÍodÍo Ío} ¯<íR0û= ÈÆ0ÝwÝ#ÉÝ~Ö$O! Ý#Ý~ÍWÖ08)þ 8 !Öþ 8þ0T])Ø)Ø T]Ø)Ø_ØËy·È|‡ÉÝááå}&#9N�8wë!DíB9ùëåí°ëá+Oí¸ë#ùÝé>Ã$ÝáÍyWáÍj _áå}“8(º8J`9{‚T]=o`9yí¸ë ¯Ã$Í™ Ð>Ã"Í õÍ8Í# íÙ}·Ù>(èÍ� àÙËxÙ Ù}·ÙÈÙÅÕåÙ}· Ù˸TÅËø¯ÙËø}Ù•(0íD=ÙÍ ,= ù(Ùñæ€ Í 0%Í ·, 7 ÍR ?õ(8ÙÍ8 Ëx Í - öÍþ ñ8˸·ÙáÑÁÙÉÙËxÙ  Í Í  Ø,-Èxî€GÉÙ}·ÙÊþ }·ÈÙ…ÙÍÙ ÅÕåÝ9Íþ Ù.Ù>Ý#ÝnË0Í Í = ñÙ-Ù åÝnûËx Í ,-(-ñññ·ñÙÁáÙÝá˸°G,-Ìþ É}·ÈÙ•Ù?ÍÙ åååÝ9Ù.Ù>ÍR 8Í8 ?Ë= ÝuÝ+Ù-Ù(>Í 0ßÍ8 ·áÍ 8ÍR ?áÑÁËx Í š, —7•8Æ€8Æ€8oÝãÙåÅxËøÙ¨æ€õËøÝåÝ!ÉáØ¯oGOW_gÉ·ËËËËËÉ·ËËËËËÉ|Ù„Ùg{Ù‹Ù_zÙŠÙWyÙ‰ÙOxÙˆÙGÉ|Ù”Ùg{Ù›Ù_zÙšÙWyÙ™ÙOxÙ˜ÙGÉxÙ¸ÙÀyÙ¹ÙÀzÙºÙÀ{Ù»ÙÀ|Ù¼ÙÉÙxÙ¨òu xÉËx(Í È?É}Ù½ÙÀ·ÈÃR }Ö�Úþ <þ(ÐÙÅÕåÍþ 7Í = ùÙ|Ù¤Ùg{Ù£Ù_zÙ¢ÙWyÙ¡ÙOxÙ ÙGà ÙÅÕåÙÍ8Ù͉ ÙÍ ë}·ÈËx>Â"Í8}Æ€Ë/Æ€oÖõÙÅÕåÍ� Í™ -ÅÕåÍ }áÑÁÙáÑÁã¼ã0ãñÙÉÙÍ-Í ÙÍ,Ù}þlØÅ˸Ík Á8 Í� ÍÀ Í# Ëx(Í™ Ù-ÙÍk õ8Í Ù-ÙÍk 8Ù,Í }þl8;Ùª*ªª!ªÍ# ÝåÝ!“ >ÍÀÝáÍ8Í# Í# ÅÕåÙÍ8--Ù-Í™ ÙáÑÁÙÍ ,,ñ,-ÈØxî€GÉgª?+2×n¶*ï8t Ð Ðzˆˆˆˆ~«ªªªª,->Ê"ËxÂ"ÙÍ$Ù}.�•õÍ� ÙÍÙÍ ÅÕåÙ,Í™ ÙáÑÁÍ� ÝåÝ! >ÍÀÝá,ÙÍ.-ÙÍ™ ñÅÕåo&0%Í”Ù,Í# ÙáÑÁÍ™ }þgÚþ É}Š�؉}颋.:}Žã8Žc~I’$I~ÍÌÌÌL«ªªª*ÙÍ.Ù·Ëxõ˸Í� }þˆ0GÅÕå,Í\åË<Ë}áõÍ”,-(-ÙñáÑÁõÍ ÝåÝ!œ >ÍÕÝáñ0 õÙÍ$ÙÍ# ñ…o8 ñÈÙÍÃ� á>Ã"m.`1pF,þåt6|‰„!wS<ÿÃ.zÒ}[•|%¸FXc~üïýu€Ò÷r1}·ÈÝåÙÍÙ¯Ëx(<˸õÍk 8ÙÍ� ñËÿõÙÏŽé!~JÙÍk 0ͺOÝ!Z>ÙÝÍÿÙÍk 8 = ìÙ ÝÙÙÍúËøÍ™ ÅÕåÍÿÍ# ÙÍÍ™ ÙáÑÁÍ� ÝåͺÝáÙÍúÍ™ ñ0 õÙÍ-Í ñÝáËOÈËøÉçÏÌTöô¢0 jÁ‘ €µžŠoD€‚,:Í€jÁ‘ �€!¢ÚI}袋.º}Žã8Žc~I’$I’~ÍÌÌÌL«ªªªªÝ!–>ÅÕåõÍ8Í# ñÍÕÙáÑÁÃ# õÙÍúõÙÅÕåÍúÍ™ ÙáÑÁÙÍ# ñ= éÙÍÙ ÝÝnÝfÝ^ÝVÝNÝFÉ!�DLT\ÉI¢Ú!‚!É53ó!�úÉr1÷!€ÒÉÅÕåÙáÑÁÉÍ!€> Ëx Ë#ËËË-= ðo˸ÉËxÙÍ(Ëø-Í™ ·Ë}(ËxËø>�½8(Í ,óÍ `iÈÃ!É>’Ã"|µÊþ Ë|Í >�)=Ë|(úDMboÀ˸ÉÍyë8þ8ÍyÙËxÙ(’0¯þ 8> ÕÍ ÑËx(>-ÍqË{(aËy(ÍoÍe òz·(>.Íq (Ío ÷ú=Íe÷Ë{È>EÍq>+Ë|(|íDg>-Íq|/Ö 0ûÆ:ÝpÝ# ý~ý#· ý+>0ÝwÝ#Éýå,-  ý60ý#ø¯Ã Å˸}ÙÖ€oŸgM͇|þÙ <ýwíDÍÌ}þ�0Í?ý5Ëø>„•.(Í Ë= øý~õ> xæÆ0ýwý#xæGÅÕåË%Í Ë%Í ëãÑãíZëáãíJDMáË%Í = ÈñÁýáÉýåá_~6þ5Øú(+~¨¥Ôh¶¿ÉìÅëx-ÐÍÎÂSÞùx9?ë+¨­ÅøÉ{Η@}·ÈËøÅÕ|Í Í „gãíZëáãíJDMá0Í ,7È}Æo˸ÉÍ˾ #øyîO!@9ùi&ÝéÍË ë¶¾ â#÷ÚÍ˶w#ùëùÝéÍË/¦w#øïÍ˦w#ùãýáÝá!9ë! E9ýéÝá!!9~·(¯+FÍM¦!"9ù!(#Ýé>¯2æýá*ÛÍu¯á"âýå|·>"Êß:æ·( ÍE *â6#wÉÍÊ*â6#6 ë!\$í°É!uÅåí[Ûþ (úÍW–( áÁã·É#ëÁÁþ:À~ÉCONTRMKBDLSTAUXUSR>¯2æÍ­Íã*â#~þ ÍuÍã*â:æ·> >w###6ÀÕþ þ #6++pÉ>¯2æíSäÍìÍãÍu:Ù·À*â6###ww#w$w#wÖÿ:æ· åͳá##N#F*ä·íBÈ>�Ãßå¯w#w#í[äs#ráò>¯2æÍÍãÍuÍã*â6å ë#Íá-¯Nw#FwÖÿq#p#6€#w#w#wÉÍž*â ë:æ·( ÕÍÑñÅÍÁ<ÀxÃß*â6#ûÉ"â#~+þ 2ËN(>ÍQ:Ù· *âË^ îËFÈ*âå ëÍá< >ÿ2Ù6É"â~æÈÍ^*â-¯w#wÕÿw#ͲÍ^À"â~æÈ·ÍÖÀ ëÍ<À@ýá*ÛÍu¯áýåÍÖÀåÍÊáåë!\ í°á åëÍÑ<Êm!\$í°É>Ãß>¯2æÍÖÀ*ß|µ>! ë*â \$í°\Í<(Ï!¼€í°:æ· í[1Ã�ÿÕÍ\ÍÑ!€ë·(éf"âÍ�È> 2ÙÉ:Ù·ÈñÉÝáÝåå!ÊÍûáÉÝáÝå"âËF( #~þÀ#6Ã$>Îå!ÊÍáÉ"âËNÀ>ë!Ú~þ€8>O6*Û"ÝÍçwþ (=þ(&þ("þ(þ :á·(ßÃûþ 8Øyº(Ô~#ͽÌú7+Íø (½ï6Éå*â#~þáÉÍ�ÈÍþÈÅÕå*â#~· *Ý~þ(h#"Ýb= Íçõþ 8ͽþ ̶ñJ= ÍçB== ͯ}8= ͵}/Íl !*â###å~Æ-_~áþ(4ò6*âËÖ>™2Ù>*â##wáÑÁÉ:Ù·>Àå*â##~áÉå*â#~þÿ(EÍ‹Íþ ( þ (þ (þ Í•è!]Íþ (þ (þ (þ(w#(Í•ãÍ�Ì•6áÉÝ!]Ý~·Èþ-ÀÝ#É8Ý~·È>7ÃßëÍ� ÍÕÍ•É>¯OÅÍ*ÁÍ{ÈÅåÍ„ÑÁÍ�ØÌës #rëÉÍ*Í{ÈÅåÍ/ÙáÁÍ�ØÙÌ ÙÃdåÍ‹Íþ Í•ôÍþ (þ( #w(Í•êÍ�Ì•áqÉ*â#~þʶÍþ (þÈÍ•ñÍ� Í•þ ÀÕ*â##~þÈ6ÉÅÕåÍ[áÑÁÉOÍã*â#~þ(08áÅå·Ê¦=ʦ==Ê©=ʬò+ËÞ###å~Æ-_qá4ð6Í`È>ðÃß*æ:è¾È4^qÉ}ÃQÁÑÅÝ*ÛË|(ÍëëË|( ÍÝ6-Ý#ÕÍSáÍyí[ÛÝåá·íRë“8 (G> ÍQùCÈ~ÍQ#÷ÁÑÙáÑÁÙÅÝ*ÛÕͳÇÁÑÅÍyËC!' Ç!+ÀTRUEFALSEÍy!9^#ÍçÑùÕÉá~#·(G~ÍQ#ùé> ÍQ> ÃQ "âËF!È͸(þÀ#ÉåÍë·íRá0ͳ*â4À#4É>™ÃßåÍ·íR *â4 #4(áͲÒ>òÜ>¯2çÍãë*âËV(/Ë–:ç·(#~+· x· y·úñÅÕ!ÍtÑÁ( =(þ X:ç·(R*â:ç·(ËÞ###~Æ-Õ_ÑÖ-ÍKí â<ò =<ÍK*â###æw ÅÕåÍ^áÑÁ Õ*Ñ4 #4x±Â»ëÉ>™>ðÃßõ:ç·(ëñÉ"âÍ^Èè"*âËÖË^ÈËž*âËVÈË–åÅ0ëÍÁá ëÍ·ÉÁÑíSâÅåÍÑ·íR8A*â N#F#s#rÍã 0}æ)ëíjëS\*â###w* N#Fë·íB ÈÕåÍ^Ñár+sÉ>‘ÃßÕÙáÙ!T]>)ëíjëÙ)Ù0 0= ïÉÍ·íR!À#ÉÍëÉ*â^#V#ÕN#F#^#VáÉ>">!2çDMÝáÑáÝå"â~æʲx±(LÅÕÍ*â ë:çOÍÑÁ·(o:çþ" C}=(þ ?ÅÕ*â-N#Fp+qÛÿq#pÑÁ!€ë °*â F+N+++V+^ë·íBÐëq#pÉ>™>ð>ÃßÁÑíSâÅåÍÑ·íRÚÞ*â s#r$ s#rÉëáãå*Íå"Íí[Ï·íRÑá0s#rÉ>ÿÃ"í[Íñ^#VíSÍÉ!9í[Ï·íR8ëí[Í·íRÉ>¯O"æ¯w2Ùx2è!—"âá"äá ͵Íÿ*äé>¯2ê"æ!—"âá"äá"è!\Íu¯*è:ê· Í­ÍÑ!Ù~6·go(Ýåá\íRë*æs#r¯ÿí_2ÔÉëÝáÁáx±( s x±(T]í°ÝéDMÝáÑá·íR0ð ë ëí¸ÝéÑÁÕ-a%Ù}ÍWoÉ*é!Ù~6o&ÉÍ |µÈÍ£}þÀÝáÍø^C User break1:Ù·ÈÝáõÍø I/OÝáÍø Run-timeÍø error ÍeÍø, PC=Ýåáí[Õ·íR"×Í`Íø Program aborted*ßé1!ÓϸÿÍ`!²0Ç}Í…Ã¥0ýáá"Œ~á"Ž~ýå*Ž~^#Vë"†~*Œ~^#Vëë*Ž~s#r*†~ë*Œ~s#rÉýáá"‚~á"„~ýå!}2}~*„~å*‚~å!Ñë·íRÑÍøz³ÊRÕ"{~!Œ°å*{~+)Ñ^#Vëå!Œ°å*{~å!Ñ+)Ñ^#VëÑÍ^ËEÊI!Œ°å*{~+)Ñå!Œ°å*{~å!Ñ+)ÑåÍ”!}2}~*{~#ÑÃê*}~&å!ÑÍËEÊÏÉýáá"w~á"y~ýå*y~å*w~ÑÍøz³Ê¢Õ"m~!�~å*m~+)Ñå!ëás#r*m~#ÑÃ|*y~å!Ñå*w~ÑÍøz³ÊbÕ"o~*y~å*o~å!Ñë·íRÑÍøz³ÊYÕ"q~!Œ°å*o~+)Ñ^#Vëå!Œ°å*q~+)Ñ^#VëÑÍ^ËEÊ*!�~å*o~+)Ñå!�~å*o~+)Ñ^#Vëå!Ñëás#rÃP!�~å*q~+)Ñå!�~å*q~+)Ñ^#Vëå!Ñëás#r*q~#ÑÃÐ*o~#Ñó*y~å*w~ÑÍøz³Ê«Õ"m~!Ž—å!�~å*m~+)Ñ^#Vë+)Ñå!Œ°å*m~+)Ñ^#Vëëás#r*m~#ÑÃm*y~å*w~ÑÍøz³ÊèÕ"m~!Œ°å*m~+)Ñå!Ž—å*m~+)Ñ^#Vëëás#r*m~#ÑöÉÃÛ ýáá"_~á"a~ýå!Œ°å*a~+)Ñ^#Vë"W~*a~å*a~Ñ"Y~*Y~å*_~ÑÍ^ËEÊ, ÃÆ þ *Y~å*_~ÑÍrå!Œ°å*Y~+)Ñ^#Vëå!Œ°å*Y~å!Ñ+)Ñ^#VëÑÍrÑ}£oËEÊv *Y~å!Ñ"Y~!Œ°å*Y~+)Ñ^#Vëå*W~ÑÍJËEʘ ÃÆ þ !Œ°å*a~+)Ñå!Œ°å*Y~+)Ñ^#Vëëás#r*Y~"a~!ËEÊ !Œ°å*a~+)Ñå*W~ëás#rÉýáá"i~á"k~ýå*i~å!ÑÍ¡å*k~å!ÑÑÍz³Ê!Õ"c~*c~å*i~åÍì*c~+ÑÃ!*i~å*k~å!ÑÑÍz³Êf!Õ"c~!å*c~åÍì!Œ°å!+)Ñå!Œ°å*c~+)ÑåÍ”*c~+ÑÃ.!Éýáá"S~á"U~ýå*U~å!Ñå*S~ÑÍøz³Ê2"Õ"K~*K~"M~!Œ°å*M~+)Ñ^#Vë"I~*M~å*U~ÑÍ^å*I~å!Œ°å*M~å!Ñë·íR+)Ñ^#VëÑÍrÑ}£oËEÊ"!Œ°å*M~+)Ñå!Œ°å*M~å!Ñë·íR+)Ñ^#Vëëás#r*M~å!Ñë·íR"M~Ã¥!!Œ°å*M~+)Ñå*I~ëás#r*K~#ÑÄ!É!;~Í›ýáá"E~á"G~ýå*G~å*E~ÑÍrËEÊD#*G~"?~*E~å!Ñ"=~!Œ°å*G~+)Ñ^#Vë";~*?~å!Ñ"?~!Œ°å*?~+)Ñ^#Vëå*;~ÑÍ7ËEÊ|"*=~å!Ñë·íR"=~!Œ°å*=~+)Ñ^#Vëå*;~ÑÍJËEʤ"*?~å*=~ÑÍrËEÊú"!Œ°å*?~+)Ñå!Œ°å*=~+)ÑåÍ”*?~å*=~ÑÍ^ËEÊ|"!Œ°å*G~+)Ñå!Œ°å*=~+)ÑåÍ”*G~å*=~å!Ñë·íRåÍ3"*?~å*E~åÍ3";~õÃ>$ !!~Í›ýáá"'~á")~ýå*)~å*'~Ñå!ÑÍ¡"!~!Œ°å*)~+)Ñ^#Vëå!Œ°å*!~+)Ñ^#VëÑÍJå!Œ°å*!~+)Ñ^#Vëå!Œ°å*'~+)Ñ^#VëÑÍJÑ}£oËEÊÒ#*!~"+~Ã1$!Œ°å*)~+)Ñ^#Vëå!Œ°å*'~+)Ñ^#VëÑÍJå!Œ°å*'~+)Ñ^#Vëå!Œ°å*!~+)Ñ^#VëÑÍJÑ}£oËEÊ+$*'~"+~Ã1$*)~"+~*+~Ù !~õ!-~Í›ýáá"7~á"9~ýå*7~å*9~Ñë·íRå! ÑÍ^ËEÊ{%*9~"1~*7~å!Ñ"/~!Œ°å*9~+)Ñå!Œ°å*9~å*7~åÍP#+)ÑåÍ”!Œ°å*9~+)Ñ^#Vë"-~*1~å!Ñ"1~!Œ°å*1~+)Ñ^#Vëå*-~ÑÍ7ËEʳ$*/~å!Ñë·íR"/~!Œ°å*/~+)Ñ^#Vëå*-~ÑÍJËEÊÛ$*1~å*/~ÑÍrËEÊ1%!Œ°å*1~+)Ñå!Œ°å*/~+)ÑåÍ”*1~å*/~ÑÍ^ËEʳ$!Œ°å*9~+)Ñå!Œ°å*/~+)ÑåÍ”*9~å*/~å!Ñë·íRåÍM#*1~å*7~åÍM#-~õ!~Í›ýáá"~á"~ýå*~å*~ÑÍøz³Ê(&Õ"~*~"~*~å!Ñå*~ÑÍøz³Ê&Õ"~!Œ°å*~+)Ñ^#Vëå!Œ°å*~+)Ñ^#VëÑÍrËEÊû%*~"~*~#ÑÃÄ%!Œ°å*~+)Ñå!Œ°å*~+)ÑåÍ”*~#Ñä%~õ!~Í›ýáá"~á"~ýå*~å*~Ñë·íRå!ÑÍ¡" ~* ~å*~ÑÍ7ËEÊ@'* ~å*~ÑÍøz³Ê/'Õ"~*~"~!Œ°å*~+)Ñ^#Vë"~*~å* ~Ñë·íRå*~ÑÍ7å*~å!Œ°å*~å* ~Ñë·íR+)Ñ^#VëÑÍrÑ}£oËEÊ'!Œ°å*~+)Ñå!Œ°å*~å* ~Ñë·íR+)Ñ^#Vëëás#r*~å* ~Ñë·íR"~Ù&!Œ°å*~+)Ñå*~ëás#r*~#ÑÃx&* ~å!ÑÍ¡" ~Ã]&~õÃS(!ñ}Í›ýáá"õ}ýå!Ž—å!å*õ}Ñ͇+)Ñ^#Vëå!Ž—å!å*õ}Ñ͇å!Ñ+)Ñ^#VëÑÍJËEÊî'!Ž—å*õ}+)Ñå!Ž—å!å*õ}Ñ͇+)Ñ^#Vëëás#r!�~å*õ}+)Ñå!�~å!å*õ}Ñ͇+)Ñ^#Vëëás#rÃJ(!Ž—å*õ}+)Ñå!Ž—å!å*õ}Ñ͇å!Ñ+)Ñ^#Vëëás#r!�~å*õ}+)Ñå!�~å!å*õ}Ñ͇å!Ñ+)Ñ^#Vëëás#rñ}õ !÷}Í›ýáá"ÿ}á"~ýå*ÿ}å!å*ÿ}Ñ͇å!Ñë·íRÑÍøz³ÊÙ(Õ"ù}!Ž—å*ù}+)Ñå!Œ°å*ù}å*ÿ}Ñë·íRå!Ñ+)Ñ^#Vëëás#r!�~å*ù}+)Ñå*ù}ëás#r*ù}#ÑÄ(*ÿ}å!Ñë·íRå*~ÑÍz³Ê)Õ"ù}*ù}åÍL'*ù}+ÑÃí(*~å*ÿ}ÑÍøz³ÊŸ)Õ"ù}!Œ°å*ù}+)Ñå!Ž—å*~+)Ñ^#Vëëás#r!�~å*~+)Ñ^#Vë"÷}!Ž—å*÷}+)Ñå!ÿëás#r*÷}å!ÑÍ¡"÷}*÷}å*~ÑÍ7ËEÊ–)*÷}åÍL'*÷}å!ÑÍ¡"÷}Ãn)*ù}#ÑÃ) ÷}õ!é}Í›ýáá"ï}ýå!å*ï}å!ÑÑÍøz³Êü)Õ"é}!Œ°å*é}+)Ñå!,Àå*é}+)Ñ^#Vëëás#r*é}#ÑÃÊ)é}õ!á}Í›ýáá"ç}ýåÍÍOÍÍÍ@Number of items to sort: Í*ç}ÍêÍ­ÍÍ!å*ç}^#VëÑÍøz³ÊŠ*Õ"á}!,Àå*á}+)Ñå!ÐÍÈëás#r*á}#ÑÃa*!,Àå*ç}^#Vëå!Ñ+)Ñå!ÿëás#r*ç}^#Vëåͨ)á}õ!Ù}Í›ýáá"ß}ýå!å*ß}åÍM#!å*ß}ÑÍøz³Ê+Õ"Ù}!,Àå*Ù}+)Ñå!Œ°å*Ù}+)Ñ^#Vëëás#r*Ù}#ÑÃã*Ù}õ!Ñ}Í›ýáá"×}ýåÍÍOÍ!å*×}ÑÍøz³Ê’+Õ"Ñ}!Œ°å*Ñ}+)Ñ^#VëÍå!͵Í*Ñ}å! ÑÍÒå!ÑÍËEʉ+ÍÍOÍ*Ñ}#ÑÃC+Ñ}õ!Ì}Í›ýáá}2Ð}ýå*ÍÏåͨ)*ÌÏ&ËEÊÅ+*ÍÏåÍ+ÍÍOÍÍÍ@ready?ÍÍ ËEÊÞ+ÍÍ@ beginÍ*Ð}&B·íRÂ,!å*ÍÏåÍÃÃÝ,C·íRÂ-,!å*ÍÏåÍeÃÝ,H·íRÂE,!å*ÍÏåÍéÃÝ,I·íRÂ],!å*ÍÏåÍg!ÃÝ,L·íRÂu,!å*ÍÏåÍ1&ÃÝ,Q·íRÂ�,!å*ÍÏåÍ3"ÃÝ,R·íR°,!å*ÍÏåÍM#!å*ÍÏåÍg!ÃÝ,S·íRÂÈ,!å*ÍÏåÍ„%ÃÝ,T·íRÂÝ,!å*ÍÏåÍI'ÍÍ@ endÍOÍ*ÌÏ&ËEÊ-*ÍÏåÍ+Ì}õ!Ç}Í›ÍÍOÍÍÍ@Options:ÍÍÍOÍÍÍOÍÍ! e.å! Í0Í@B Bubble sort.ÍOÍÍ! e.å! Í0Í@C Count sort.ÍOÍÍ! e.å! Í0Í@D toggle Display of list.ÍOÍÍ! e.å! Í0Í@ H Heap sort.ÍOÍÍ! e.å! Í0Í@I Insertion sort.ÍOÍÍ! e.å! Í0Í@L sheLL sort.ÍOÍÍ! e.å! Í0Í@N Number of items to sort.ÍOÍÍ! e.å! Í0Í@P Presort master list.ÍOÍÍ! e.å! Í0Í@Q Quick sort.ÍOÍÍ! e.å! Í0Í@R quick sort 2.ÍOÍÍ! e.å! Í0Í@S Selection sort.ÍOÍÍ! e.å! Í0Í@ T Tree sort.ÍOÍÍ! e.å! Í0Í@X eXit program.ÍOÍÍÍOÍÍÍ@Your choice? Í!¾Í÷!Ç}ÍšÍ*Ç}&ÍÕ}2Ç}ÍÍOÍ*Ç}&B·íRÊ0C·íRÊ0H·íRÊ0I·íRÊ0L·íRÊ0Q·íRÊ0R·íRÊ0S·íRÊ0T·íRÂ%0*Ç}&åÍ›+Ù0D·íRÂ?0*ÌÏ&}îo}2ÌÏÙ0N·íRÂS0!ÍÏåÍ*Ù0P·íRÂg0*ÍÏåͼ*Ù0X·íRÂw0ÍrÙ0ÍÍOÍÍÍ@ Not on menu.ÍOÍÍ -Ç}õ!}2ÌÏÍ -Ãr&}îo}2ÌÏÃ-0N·íRÂN!ÍÏåÍ*ÃG0P·íRÂP*ÍÏåͼ*Ã[0X·íRÂXÍrÃo0ÍÍOÍSORT.COÍ   ió   prograí  shelì  designeä  tï   allo÷ � comparisoî  oæ  á  numbeò  oæ  sortinç   algorithms® � SORT.PAÓ  ió  thå correspondinç Turbï Pascaì  sourcå � file®  Thå prograí menõ allowó thå useò tï generatå � á desireä numbeò oæ randoí integeró (uð tï 2000¬ buô � treå  sorô caî handlå onlù 1600)®  Thå masteò  lisô � caî  bå  presorteä iæ desired¬  anä displaù  oæ  thå � numberó  caî bå toggleä oî oò off®  Thå otheò  menõ � choiceó  allo÷  thå  useò  tï  tesô  thå  particulaò � sorting methods. Thå  individuaì  sortinç algorithmó appeaò aó  nameä � procedureó  withiî SORT.PAS®  Theù werå writteî  tï � gaiî understandinç oæ thå sorts¬  anä werå optimizeä � foò  cleaò  expressioî ratheò  thaî  versatilitù  oò � speed®  Tï  comparå thå speeä oæ thå variouó  algorithms¬  É � timeä thå intervaì betweeî mù responså tï thå prompô � "Ready?¢  anä thå momenô wheî thå sorteä lisô  begaî � tï  prinô  out®  É testeä eacè sorô oî 40° anä  80° � randoí  integers¬  anä theî oî thå samå numbeò  setó � afteò presorting¬  witè thå followinç resultó (timeó � in seconds): SORT 400 800 400 (PS) 800 (PS) bubble 29.7 114.8 .3 .3 count 17.8 70.2 18.0 71.0 insert 11.5 42.2 .4 .4 select 9.2 35.6 9.1 35.4 tree 6.3 14.1 6.3 14.0 shell 1.9 4.0 1.1 2.1 heap 1.6 3.5 1.7 3.6 quick1 1.1 2.1 8.7 failed quick2 1.0 2.0 .7 1.2 Thå firsô fouò sortó arå oæ á clasó thaô takeó  timå � proportionaì  tï î *ª ² tï sorô î items¬  shelì sorô � ió   iî  aî  intermediatå  clasó  thaô  takeó   timå � proportionaì  tï roughlù î *ª 1.25¬  anä  thå  otheò � fouò  arå  iî  thå besô caså clasó thaô  takeó  timå � proportionaì tï î loç n®  Notå  thaô twï oæ thå verù simplå sortó (bubblå  anä � insertion©  arå excellenô oî listó thaô arå  alreadù � sorteä oò nearlù so®  Treå sorô ió worså thaî shelì � sorô  aô  î thió lo÷ becauså oæ higè  overhead¬  buô � woulä  eventuallù catcè uð aô mucè  largeò  n®  Thå � simplå  quicë  sorô ió notoriouslù baä oî  presorteä � lists--aô  î  ½ 80° iô failó duå tï  stacë  overflo÷ � durinç  recursivå calls®  Thå improveä  quicë  sorô � overcomeó  thió probleí anä wilì bå thå fastesô sorô � oæ  thió  collectioî  foò  alì  buô  verù   unlikelù � sequenceó  oæ numbers®  (Iî á fe÷ rarå cases¬  heað �Šsorô  wilì  beaô it¬  sincå thå  improveä  quicksorô � stilì  haó á baä worsô case¬  whilå heað sorô  takeó � about the same time for best and worse case lists.)elì sorô � ió   iî  aî  intermediatå  clasó  thaô  takeó   timå � proportionaì  tï roughlù î *ª 1.25¬  anä  thå  otheò � fouò  arå  iî  thå besô caså clasó thaô  takeó  timå � proportionaì tï î loç n®  Notå  thaô twï oæ thå verù simplå sortó (bubblå  anä � insertion©  arå excellenô oî listó thaô arå  alreadù � sorteä oò nearlù so®  Treå sorô ió worså thaî shelì � sorô  aô  î type list = array[1..2000] of integer; longlist = array[1..3199] of integer; var n : integer; (* number of items to sort *) toggle : boolean; (* controls display of list *) master : list; (* random values for sorting *) a : list; (* working list to be sorted *) aux1 : longlist; (* auxiliary arrays used by *) aux2 : longlist; (* count and tree sort *) (* Internal arrays in count and tree sort are forced to overlay aux1 and aux2 using the absolute address variable ability of Turbo Pascal. This saves some critical space in the program so that large lists can be sorted without a heap stack collision. *) (***** COMMON PROCEDURES USED BY SORTING ALGORITHMS *****************) procedure swap(var i, j : integer); var t : integer; begin t := i; i := j; j := t; end; (***** BUBBLE SORT **************************************************) (* The list is scanned repeatedly, and adjacent items that are out of order are swapped. When a pass occurs with no swaps, the list is sorted. *) procedure bubble(lb, ub : integer); var swapped : boolean; cell : integer; begin repeat swapped := false; for cell := lb to ub - 1 do begin if (a[cell] > a[cell + 1]) then begin swap(a[cell], a[cell + 1]); swapped := true; end; end; until (swapped = false); end; (***** COUNT SORT ***************************************************) (* An auxiliary array is created with one cell for each item in the list, and these cells are set to 1. Each pair of items is compared, and the auxiliary cell corresponding to the higher item is incremented. The auxiliary cells then give the number of items smaller than any given item, which establishes its position in the sorted list. *) procedure count(lb, ub : integer); var left, right, cell : integer; sorted : list absolute aux1; count : list absolute aux2; begin for cell := lb to ub do count[cell] := 1; for right := lb + 1 to ub do begin for left := lb to right - 1 do begin if (a[right] > a[left]) then count[right] := count[right] + 1 else count[left] := count[left] + 1; end; end; for cell := lb to ub do sorted[count[cell]] := a[cell]; for cell := lb to ub do a[cell] := sorted[cell]; end; (***** HEAP SORT ****************************************************) (* The items are rearranged into a "heap", where each item at position i is larger than the two items at positions 2i and 2i + 1. The top item in the heap is then repeatedly removed and placed in its final position, with the heap being consolidated after each such removal. *) procedure heap(lb, ub : integer); var cell : integer; procedure siftup(parent, top : integer); label done; var child, copy : integer; begin copy := a[parent]; repeat child := parent + parent; if (child > top) then goto done else begin if (child < top) and (a[child] < a[child + 1]) then child := child + 1; if (a[child] <= copy) then goto done else begin a[parent] := a[child]; parent := child; end; end; until (false); done: a[parent] := copy; end; begin for cell := (ub div 2) downto (lb + 1) do siftup(cell, ub); for cell := ub downto (lb + 1) do begin siftup(1, cell); swap(a[1], a[cell]); end; end; (***** INSERTION SORT ***********************************************) (* The first item is considered as the nucleus of a sorted lefthand sublist. Each succeeding item to the right is compared backward along the left sublist and inserted at the correct position in the sorted portion. *) procedure insert(lb, ub : integer); var cell, newcell, newval : integer; begin for newcell := lb + 1 to ub do begin cell := newcell; newval := a[cell]; while (cell > lb) and (newval < a[cell - 1]) do begin a[cell] := a[cell - 1]; cell := cell - 1; end; a[cell] := newval; end; end; (***** SIMPLE QUICK SORT *****************************************) {$A-} (* compiler toggle to allow recursion *) (* A pivotal value is chosen and the list is rearranged so that all values to the left are less than or equal to the pivot and all values to the right are greater than or equal to the pivot. The same procedure is then called recursively to deal with the left and right sublists. When all sublists are of length one, the list is sorted. In this version, the pivot is simply chosen to be the leftmost member of each sublist. *) procedure quick1(lb, ub : integer); var left, right, pivot : integer; begin if (lb < ub) then begin left := lb; right := ub + 1; pivot := a[lb]; repeat repeat left := left + 1 until (a[left] >= pivot); repeat right := right - 1 until (a[right] <= pivot); if (left < right) then swap(a[left], a[right]); until (left > right); swap(a[lb], a[right]); quick1(lb, right - 1); quick1(left, ub); end; end; (***** IMPROVED QUICK SORT *****************************************) (* This version includes two improvements: (1) The pivot is chosen to be the median of the leftmost, rightmost and middle items in each sublist; and (2) sublists of less than ten items are left unsorted. The partly sorted list can then be rapidly brought into complete order with insertion sort. *) procedure quick2(lb, ub : integer); const CUTOFF = 10; var left, right, pivot : integer; function med(lb, ub : integer) : integer; var mid : integer; begin mid := (lb + ub) div 2; if (a[lb] <= a[mid]) and (a[mid] <= a[ub]) then med := mid else if (a[lb] <= a[ub]) and (a[ub] <= a[mid]) then med := ub else med := lb; end; begin if (ub - lb > CUTOFF) then begin left := lb; right := ub + 1; swap(a[lb], a[med(lb, ub)]); pivot := a[lb]; repeat repeat left := left + 1 until (a[left] >= pivot); repeat right := right - 1 until (a[right] <= pivot); if (left < right) then swap(a[left], a[right]); until (left > right);  swap(a[lb], a[right]); quick2(lb, right - 1); quick2(left, ub); end; end; (***** SIMPLE SELECTION SORT ****************************************) (* The smallest item is found and placed in the leftmost cell. On each succeeding pass, the smallest remaining unsorted item is found and placed at the end of the sorted lefthand portion. *) {procedure select(lb, ub : integer); var left, right : integer; begin for left := lb to ub do for right := left + 1 to ub do if (a[left] > a[right]) then swap(a[left], a[right]); end;} (***** IMPROVED SELECTION SORT **************************************) (* In this faster version, most calls on swap are replaced by an explicit temporary variable, which represents the position holding the lowest item yet found at a given time during one pass. *) procedure select(lb, ub : integer); var left, right, low : integer; begin for left := lb to ub do  begin low := left; for right := left + 1 to ub do if (a[right] < a[low]) then low := right; swap(a[left], a[low]); end; end; (***** SIMPLE SHELL SORT ********************************************) (* The list is divided into a number of interlaced sublists in which items are separated by a gap initially equal to half the length of the list. On each pass, the gap is cut in half until on the last pass, adjacent items are being compared. During each pass, items on each of the current sublists are sorted by insertion sort. *) {procedure shell(lb, ub : integer); var gap, left, right : integer; begin gap := (ub - lb) div 2; while (gap >= lb) do begin for right := gap to ub do begin left := right - gap; while ((left >= lb) and (a[left] > a[left + gap])) do begin swap(a[left], a[left + gap]); left := left - gap;  end; end; gap := gap div 2; end; end;} (***** IMPROVED SHELL SORT ******************************************) (* This version saves some time in the inner loop with a better version of insertion sort that uses a temporary variable to cut down on swaps. *) procedure shell(lb, ub : integer); var gap, left, right, newval : integer; begin gap := (ub - lb) div 2; while (gap >= lb) do begin for right := gap to ub do begin left := right; newval := a[left]; while (left - gap >= lb) and (newval < a[left - gap]) do begin a[left] := a[left - gap]; left := left - gap; end; a[left] := newval; end; gap := gap div 2; end; end; (***** TREE SORT ****************************************************) (* In one auxiliary array, the items are arranged in a tree where each position i contains a copy of the smaller item at positions 2i and 2i + 1. A second auxiliary array contains pointers to the original position of each item in the first auxiliary array. The first (smallest) item in the tree is repeatedly removed and transfered to its final position in the sorted list. Then, it is replaced at its original position with a value higher than any item in the list, and the tree is rearranged to move the new smallest item to the top. *) procedure tree(lb, ub : integer); var cell, node : integer; value : longlist absolute aux1; pointer : longlist absolute aux2; procedure minimum(cell : integer); begin if (value[2 * cell] <= value[2 * cell + 1]) then begin value[cell] := value[2 * cell]; pointer[cell] := pointer[2 * cell]; end else begin value[cell] := value[2 * cell + 1]; pointer[cell] := pointer[2 * cell + 1]; end; end; begin for cell := ub to (2 * ub - 1) do begin value[cell] := a[cell - ub + 1]; pointer[cell] := cell; end; for cell := (ub - 1) downto lb do minimum(cell); for cell := lb to ub do begin a[cell] := value[lb]; node := pointer[lb]; value[node] := MAXINT; node := node div 2; while (node >= lb) do begin minimum(node); node := node div 2; end; end; end; (***** MAIN PROGRAM INFRASTRUCTURE **********************************) procedure reset(n : integer); var i : integer; begin for i := 1 to n + 1 do a[i] := master[i]; end; procedure init(var n : integer); var i : integer; begin writeln; write('Number of items to sort: '); readln(n); for i := 1 to n do master[i] := random(2000); master[n + 1] := MAXINT; reset(n); end; procedure presort(n : integer); var i : integer; begin quick2(1, n); for i := 1 to n do master[i] := a[i]; end; procedure show(n : integer); var i : integer; begin writeln; for i := 1 to n do begin write(a[i] : 5); if (i mod 10 = 0) then writeln; end; end; procedure dosort(c : char); begin reset(n); if (toggle) then show(n); writeln; write('ready?'); repeat until keypressed; write(' begin'); case c of 'B' : bubble(1, n); 'C' : count(1, n); 'H' : heap(1, n); 'I' : insert(1, n); 'L' : shell(1, n); 'Q' : quick1(1, n); 'R' : begin quick2(1, n); insert(1, n); end; 'S' : select(1, n); 'T' : tree(1, n); end; writeln(' end'); if (toggle) then show(n); end; procedure menu; var c : char; begin writeln; write('Options:'); writeln; writeln; writeln(' ' : 10, 'B Bubble sort.'); writeln(' ' : 10, 'C Count  sort.'); writeln(' ' : 10, 'D toggle Display of list.'); writeln(' ' : 10, 'H Heap sort.'); writeln(' ' : 10, 'I Insertion sort.'); writeln(' ' : 10, 'L sheLL sort.'); writeln(' ' : 10, 'N Number of items to sort.'); writeln(' ' : 10, 'P Presort master list.'); writeln(' ' : 10, 'Q Quick sort.'); writeln(' ' : 10, 'R quick sort 2.'); writeln(' ' : 10, 'S Selection sort.'); writeln(' ' : 10, 'T Tree sort.'); writeln(' ' : 10, 'X eXit program.'); writeln; write('Your choice? '); read(kbd, c); c := upcase(c); writeln; case c of 'B', 'C', 'H', 'I', 'L', 'Q', 'R', 'S', 'T' : dosort(c); 'D' : toggle := not toggle; 'N' : init(n); 'P' : presort(n); 'X' : halt; else begin writeln; writeln('Not on menu.'); end; end; menu; end; (***** MAIN PROGRAM *************************************************) begin toggle := true; menu; end. I Insertion sort.'); writeln(' ' : 10, 'L sheLL sort.'); writeln(' ' : 10, 'N Number of items to sort.'); writeln(' ' : 10, 'P Presort master list.'); writeln(' ' : 10, 'Q Quick sort.'); writeln(' ' : 10, 'R quick sort 2.'); writeln(' ' : 10, 'S Selection sort.'); writeln(' ' : 10, 'T Tree sort.'); writeln(' ' : 10, 'X eXit program.'); writeln; write('Your choice? '); read(kbd, c); c := upcase(c); writeln; case c of 'B', 'C', 'H', 'I', 'L', 'Q', 'R', 'S', 'T' : dosort(c); 'D' : toggle := not toggle; 'N' : init(n); 'P' : presort(n); 'X' : halt; else begin writeln; writeln('Not on menu.'); end; end; menu; end; (***** MAIN PROGRAM *************************************************) begin togHB230002.FOG TURBO TIPS A Picture's Worth A Thousand (Reserved) Words by Herb Bowie Onå   oæ  thå  manù  nicå  thingó  abouô  Turbï  Pascaì  ió   itó extensibilityº  á  programmeò caî writå hió  owî  general-purposå procedureó  anä  functions¬  anä includå theí iî á  prograí  wheî necessarù  bù meanó oæ thå inclusioî feature®  Iî thió way¬  thå languagå  caî  bå  extendeä tï  includå  featureó  noô  otherwiså available. Manù  higè leveì languageó allo÷ thå programmeò tï uså á  picturå strinç  tï  specifù  á formaô foò displayinç outpuô oî  á  user'ó terminaì  oò  printer¬  oò  editinç á  user'ó  input®  Witè  thå inclusioî oæ thå followinç functions¬ thå Turbï Pascaì programmeò caî alsï uså thió handù feature. SAYPICº  Thió functioî formató á characteò strinç anä allowó  thå � programmeò  tï  specifù thå desireä formaô bù meanó oæ á  picturå � string® Thå firsô inpuô parameteò ió thå strinç tï bå formatted¬ � whicè maù bå oæ anù lengtè uð tï StringMax¬  whicè ió á typå thaô � musô bå defineä prioò tï thió function® anä thå nexô one. Thå seconä inpuô parameteò ió thå picturå strinç representinç thå � desireä  formaô oæ thå outpuô string®  Thå followinç  characteró � havå speciaì meaningó wheî encountereä iî thå picturå string.   # - Any digit may occupy this position.   9 - Same as #.   $ - Will be used to replace leading zeros.   Ú - Wilì causå leadinç zeroó tï bå replaceä bù spaces®   « - Iæ thå numbeò ió positive¬  theî á pluó sigî  wilì  appeaò �      iî thió position.   - - Iæ thå numbeò ió negative¬ theî á minuó sigî wilì appeaò iî �      thió position.   X - Any character may occupy this position.   Á - Anù letteò iî thå alphabet¬  uppeò oò loweò  case¬  oò  á �      space¬ maù occupù thió position.   ¡ - Samå aó X¬  buô loweò caså characteró wilì bå converteä tï �    uppeò case®   Æ - Anù  characteò  otheò thaî <>.,;:=?*[Ý  maù  occupù  thió �    positioî (anù characteò legaì iî á CP/Í filå name). Anù  otheò characteò appearinç iî thå picturå strinç wilì  appeaò � aó ió iî thå outpuô string. Thió  functioî simplù returnó thå formatteä strinç aó thå  resulô � oæ  thå function¬  ratheò thaî writinç iô anywhere¬  tï allo÷ thå � programmer to do whatever he wants with the resulting string. Thå functioî workó bù takinç thå inpuô string¬ onå characteò aô á � time¬ anä mappinç iô againsô thå picturå string® Notå  thaô integeró oò reaì numbers¬  aó welì aó strings¬  maù bå �Šformatteä usinç thió functioî bù firsô convertinç theí tï stringó � bù usinç thå STÒ procedure. GETPICº  Thió  functioî  allowó thå useò tï keù  iî  á  characteò � strinç anä allowó thå programmeò tï specifù thå desireä formaô oæ � thå outpuô strinç bù meanó oæ á picturå string®  Thå firsô inpuô � parameteò  ió á strinç representinç thå initiaì defaulô valuå  oæ � thå  strinç tï bå input®  Notå thaô thió defaulô valuå shoulä bå � thå samå lengtè aó thå picturå string®  Iæ  necessary¬  functioî � S!AYPIà maù bå useä bù thå programmeò tï adjusô thå lengtè oæ thå � defaulô string. � Thå seconä parameteò ió thå picturå string®  Thå samå characteró � havå  thå  samå  speciaì meaningó aó iî  thå  picturå  strinç  iî � SAYPIC®  Eacè timå thå useò enteró aî acceptablå character¬  thå � functioî  wilì advancå thå cursoò tï thå nexô position®  Iæ  thå � useò  enteró  á characteò thaô ió noô acceptablå aô  thå  currenô � position¬  theî  thå  functioî wilì looë aheaä tï trù tï  finä  á � followinç positioî wherå thå characteò ió acceptable®  Iæ sucè á � positioî ió found¬  theî thå user'ó entrù wilì gï there¬  anä thå � cursoò  wilì bå advanceä tï thå nexô positioî followinç thå poinô � oæ entry. Noticå thaô thå cursoò wilì noô automaticallù skið pasô  literaló � iî thå picturå string®  Iæ thå useò enteró thå literal¬  theî iô � wilì bå accepteä anä thå cursoò advanced» iæ thå useò enteró somå � otheò  value¬  theî  thå functioî wilì looë ahead¬  aó  describeä � above¬ tï finä á positioî wherå thaô valuå wilì bå acceptable. Thå useò maù alsï enteò thå followinç controì codes¬  whicè  havå � speciaì meanings.   ^Ó - Moveó thå cursoò lefô onå position¬ unlesó iô ió currentlù �    aô thå leftmosô position®   ^H - same as ^S.   ^Ä - Moveó  thå  cursoò  righô  onå  position¬  unlesó  iô  ió �      currentlù aô thå rightmosô position.   ^L - Same as ^D.   ^Ù - Clearó thå field¬  bù settinç alì variablå positionó  tï �    eitheò blankó oò zeros¬ aó appropriate®   ^É - Toggleó betweeî overwritå anä inserô mode®  Overwritå  ió �      thå initiaì default®  ^Ç - Deleteó thå characteò aô thå currenô cursoò position.   ^Ð - Turnó oî Decimaì Poinô insertion¬  whicè ió initiallù off® �        Turninç thió oî moveó thå cursoò tï thå positioî jusô lefô �        oæ  thå  decimaì point¬  iæ therå ió one¬  oò tï thå  lasô �        numeriã  position¬  iæ therå ió nï decimaì  point®  Digitó �        entereä   subsequentlù  wilì  bå  inserteä  aô  thå   samå �        position¬  whilå shiftinç otheò digitó tï thå left®  untiì �        thå  useò  enteró á decimaì point®  Thió ió á  greaô  anä �        naturaì waù foò á useò tï enteò numbers¡ Iô  ió  thå  programmer'ó responsibilitù tï positioî  thå  cursoò � appropriatelù  beforå  usinç  thió  function®  Iô  ió  alsï  hió � responsiblitù tï displaù thå defaulô value¬  iæ hå wishes¬ beforå �Šcalling this function. Notå  thaô  thió functioî requireó thå uså oæ somå  terminaì  I/Ï � commandó  noô builô intï Turbï Pascalº  thå abilitù tï  movå  thå � cursoò  lefô  onå  position¬  thå abilitù tï movå  iô  righô  onå � position¬  anä  thå  abilitù tï makå iô beep®  Theså  havå  beeî � implementeä foò thå Osbornå 1¬  anä maù neeä tï bå changeä bù thå � programmeò foò otheò computers. Thå  samplå  prograí PICTURE.PAÓ demonstrateó thå  uså  oæ  theså � functions¬  and¬  wheî run¬ wilì allo÷ thå programmeò tï tesô thå � functions. program Picture; type StringMax = string [255]; String2 = string [2]; const (* CRT Variables *) CRTBeepStr : string2 = #07; CsrLeftStr : string2 = #08; CsrRightStr : string2 = #12; var InString: StringMax; InPic : StringMax; Choice : char; {$I B:CRT.Prc } {$I B:SayPic.Fnc } {$I B:GetPic.Fnc } begin ClrScr; repeat writeln; writeln ('1 = SayPic'); writeln ('2 = GetPic'); writeln ('9 = Exit Program'); writeln; write ('Enter your choice: '); Choice := GetPic ('0', '#'); writeln; case Choice of '1': begin writeln; write ('Enter Picture: '); readln (InPic); writeln; write ('Enter String: '); readln (InString); writeln; write ('Output String: '); writeln (SayPic (InString, InPic)); end; '2': begin writeln; write ('Enter Picture: '); readln (InPic); writeln; write ('Enter String: '); readln (InString); InString := SayPic (InString, InPic); writeln; write ('GetPic: '); write (InString); CsrLeft (length (InPic)); InString := GetPic (InString, InPic); writeln; writeln; write ('Output String: '); writeln (InString); end; end; until Choice = '9'; end.  Exit Program'); writeln; write ('Enter your choice: '); Choice := GetPic ('0', '#'); writeln; case Choice of '1': begin writeln; write ('Enter Picture: '); readln (InPic); writeln; write ('Enter String: '); readln (InString); writeln; write ('Output String: '); writeln (SayPic (InString, InPic)); end; '2': begin writeln; write ('Enter Picture:"(* GetPic.Fnc *) (* Output: String input by user and formatted*) (* according to format defined by *) (* picture string. *) (* Input 1: Initial, default value for string.*) (* Input 2: String representing format *) (* picture. The characters found in *) (* this string will be interpreted *) (* according to the following table. *) (* # - Any digit. *) (* 9 - Same as #. *) (* + - If the number is positive, *) (* then a plus sign is to *) (* appear in this position. *) (* - - If the number is negative, *) (* then a minus sign will *) (* appear in this position. *) (* X - Any character. *) (* A - Any letter in the alphabet, *) (* upper or lower case, or a *) (* space. *) (* ! - Any character. Lower case *) (* letters will be converted *) (* to upper. *) (* F - Any character other than *) (* <>.,;:=?*[]. (Any character*) (* legal in a file name.) *) (* Any other character will appear in*) (* the formatted string as is. *) (* Input from screen: The user may enter the *) (* following control codes. *) (* ^S - Move cursor left one. *) (* ^H - Same as ^S. *) (* ^D - Move cursor right one. *) (* ^L - Move cursor right one. *) (* ^Y - Clear field. *) (* ^I - Overwrite/Insert toggle *) (* (overwrite default) *) (* ^G - Delete character. *) (* ^P - Begin at decimal point, and*) (* shift existing characters *) (* to the left. *) function GetPic (InString: StringMax; Format: StringMax): StringMax; type Characters = set of char; ASCII = set of 0..127; const Digits: Characters = ['0'..'9']; SignChars: Characters = ['+', '-', ' ']; Alpha: Characters = [' ','a'..'z','A'..'Z']; FileChars: Characters = [' '..'+','-','/'..'9','@'..'Z','\','^'..'z']; ControlOrds: ASCII = [1..27]; DigitChars: Characters = ['#', '9', 'Z', '*', '$']; var WorkString: StringMax; WorkChar: char; FormatChar: char; I, J: integer; FormatLength: integer; WorkOrd: integer; InsertMode: boolean; NumberMode: boolean; procedure ReadChar; begin read (kbd, WorkChar); WorkOrd := ord(WorkChar); end; function FillChar (FormatChar: char): char; begin case FormatChar of 'X', 'A', '!', 'F', '-': FillChar := ' '; '#', '9', 'Z', '*', '$': FillChar := '0'; '+': FillChar := '+'; else FillChar := FormatChar; end; end; function FormatMatch (InChar: char; FormatChar: char): boolean; begin FormatMatch := false; case FormatChar of 'X', '!': FormatMatch := true; 'A': if InChar in Alpha then FormatMatch := true; 'F': if InChar in FileChars then FormatMatch := true; '#', '9', '*', '$', 'Z': if InChar in Digits then FormatMatch := true; '+', '-': if InChar in SignChars then FormatMatch := true; else if InChar = FormatChar then FormatMatch := true; end; end; begin FormatLength := length(Format); WorkString := InString; InsertMode := false; NumberMode := false; I := 1; ReadChar; while WorkOrd <> 13 do begin if WorkOrd in ControlOrds then (* Control Chr *) begin if ((WorkOrd = 4) (* ^D/^L - Move cursor right *) or (WorkOrd = 12) or (WorkChar = CsrRightStr)) then if I < FormatLength then begin CsrRight (1); I := I + 1; NumberMode := false; end else CRTBeep else if (WorkOrd = 7) then (* ^G - Delete Char *) begin J := I; FormatChar := Format [I]; while ((J < FormatLength) and (Format [J + 1] = FormatChar)) do begin WorkChar# := WorkString [J + 1]; WorkString [J] := WorkChar; write (WorkChar); J := J + 1; end; WorkChar := FillChar (FormatChar); WorkString [J] := WorkChar; write (WorkChar); CsrLeft (J - I + 1); NumberMode := false; end else if ((WorkOrd = 08) (* ^H/^S - Move Cursor Left *) or (WorkOrd = 19) or (WorkChar = CsrLeftStr)) then if I > 1 then begin CsrLeft (1); I := I - 1; NumberMode := false; end else CRTBeep else if WorkOrd = 09 then (* ^I - Toggle Insert Mode *) begin InsertMode := not InsertMode; NumberMode := false; end else if WorkOrd = 16 then (* ^P - Insert Data at decimal point *) begin while ((I <= FormatLength) and (Format [I + 1] in DigitChars)) do begin I := I + 1; CsrRight (1); end; InsertMode := false; NumberMode := not NumberMode; end else if WorkOrd = 25 then (* ^Y - Clear Field *) begin WorkString := ''; for J := 1 to FormatLength do begin FormatChar := Format [J]; WorkString := WorkString + FillChar(FormatChar); end; CsrLeft (I - 1); Write (WorkString); CsrLeft (FormatLength); I := 1; NumberMode := false; end else CrtBeep; end else begin J := I; while ((J <= FormatLength) and (not FormatMatch (WorkChar, Format [J]))) do J := J + 1; if J <= FormatLength then begin CsrRight (J - I); I := J; FormatChar := Format [I]; if (FormatChar = '!') or (FormatChar = 'F') then WorkChar := upcase (WorkChar) else if ((FormatChar = '+') or (FormatChar = '-')) and (WorkChar <> FormatChar) then WorkChar := ' '; if WorkChar = '.' then NumberMode := false; if NumberMode then begin J := I; while ((J > 1) and (Format [J - 1] = Format [J])) do begin J := J - 1; CsrLeft (1); end; while J < I do begin WorkString [J] := WorkString [J + 1]; write (WorkString [J]); J := J + 1; end; end (* End Number Mode *) else if InsertMode then begin J := I; while ((J < FormatLength) and (Format [J + 1] = Format [J])) do begin J := J + 1; CsrRight (1); end; while J > I do begin  WorkString [J] := WorkString [J - 1]; write (WorkString [J]); CsrLeft (2); J := J - 1; end; end; (* End Insert Mode *) WorkString [I] := WorkChar; write (WorkChar); if ((NumberMode) or (I = FormatLength)) then CsrLeft (1) else I := I + 1; end else CrtBeep; end; ReadChar; end; (* user input ended by *) CsrRight (FormatLength - I); GetPic := WorkString; end;  J := J + 1; end; end (* End Number Mode *) else if InsertMode then begin J := I; while ((J < FormatLength) and (Format [J + 1] = Format [J])) do begin J := J + 1; CsrRight (1); end; while J > I do begin (* SayPic.Fnc *) (* Output: String formatted according to *) (* format defined by picture string. *) (* Input 1: String to be formatted. *) (* Input 2: String representing format *) (* picture. The characters found in *) (* this string will be interpreted *) (* according to the following table. *) (* # - Any digit. *) (* 9 - Same as #. *) (* $ - Replaces leading zeros. *) (* * - Replaces leading zeros. *) (* Z - Prints spaces instead of *) (* leading zeros. *) (* + - If the number is positive, *) (* then a plus sign is to *) (* appear in this position. *) (* - - If the number is negative, *) (* then a minus sign will *)$ (* appear in this position. *) (* X - Any character. *) (* A - Any letter in the alphabet, *) (* upper or lower case, or a *) (* space. *) (* ! - Any character. Lower case *) (* letters will be converted *) (* to upper. *) (* F - Any character other than *) (* <>.,;:=?*[]. (Any character*) (* legal in a file name.) *) (* Any other character will appear in*) (* the formatted string as is. *) function SayPic (InString: StringMax; Format: StringMax): StringMax; type Characters = set of char; const Digits: Characters = ['0'..'9', ' ']; Alpha: Characters = [' ','a'..'z','A'..'Z']; FileChars: Characters = [' '..'+','-','/'..'9','@'..'Z','\','^'..'z']; var WorkString: StringMax; WorkChar: char; FormatChar: char; FillChar: char; InChar: char; FormatSign: char; InStringSign: char; SignPosition: integer; I, J, K: integer; FormatLength: integer; InStringLength: integer; FormatDecPos: integer; InStringDecPos: integer; PicFound: boolean; PictureN: boolean; DigitFound: boolean; LeadingZeros: boolean; procedure GetInChar; begin InChar := InString [J]; if InChar in Digits then DigitFound := true else if (InChar = '+') or (InChar = '-') then InStringSign := InChar; end; procedure FormatN; begin if FormatDecPos = 0 then begin WorkString := ''; FormatDecPos := FormatLength + 1 end else WorkString := '.'; InStringDecPos := pos('.', InString);  if InStringDecPos = 0 then InStringDecPos := InStringLength + 1; InStringSign := '+'; (* Starting at decimal point, go left *) J := InStringDecPos - 1; for I := (FormatDecPos - 1) downto 1 do begin FormatChar := Format [I]; case FormatChar of '+', '-': WorkString := ' ' + WorkString; '$', '*', 'Z', '9', '#': begin DigitFound := false; while ((not DigitFound) and (J > 0)) do begin GetInChar; J := J - 1; end; if DigitFound then begin if InChar = ' ' then InChar := '0'; WorkString := InChar + WorkString end else WorkString := '0' + WorkString; end; else WorkString := FormatChar + WorkString; end end; (* End of Format string on left *) while J > 0 do  begin GetInChar; J := J - 1; end; (* work from decimal point right *) J := InStringDecPos + 1; for I := (FormatDecPos + 1) to FormatLength do begin FormatChar := Format [I]; case FormatChar of '+', '-': WorkString := WorkString + ' '; '$', '*', 'Z', '9', '#': begin DigitFound := false; while ((not DigitFound) and (J <= InStringLength)) do begin GetInChar; J := J + 1; end; if DigitFound then begin if InChar = ' ' then InChar := '0'; WorkString := WorkString + InChar end else WorkString := WorkString + '0'; end; else WorkString := WorkString + FormatChar; end (* End of case FormatChar *) end; (* End of Format string on right *) (* Move in Sign *)  if (InStringSign = FormatSign) and (FormatSign <> ' ') then WorkString [SignPosition] := InStringSign; (* Suppress leading zeros *) I := 1; LeadingZeros := true; while (LeadingZeros) and (I <= FormatLength) do begin FormatChar := Format [I]; case FormatChar of '+', '-': ; '#', '9': LeadingZeros := false; ',': WorkString [I] := FillChar; 'Z', '$', '*': begin if FormatChar = 'Z' then FillChar := ' ' else FillChar := FormatChar; WorkChar := WorkString [I]; if WorkChar = '0' then WorkString [I] := FillChar else LeadingZeros := false; end; end; (* End of case FormatChar *) I := I +1; end (* End of while LeadingZeros *) end; (* End of procedure FormatN *) procedure WorkPad; begin case FormatChar of % '*', '$', 'Z', '9', '#': WorkString := WorkString + '0'; 'X', 'A', 'F', '!': WorkString := WorkString + ' '; else WorkString := WorkString + FormatChar; end; end; procedure FormatX; begin WorkString := ''; J := 1; for I := 1 to InStringLength do begin WorkChar := InString [I]; PicFound := false; K := J; while ((not PicFound) and (J <= FormatLength)) do begin FormatChar := Format [J]; J := J + 1; case FormatChar of 'X', '!': PicFound := true; '*', '$', 'Z', '9', '#': if WorkChar in digits then PicFound := true; 'A': if WorkChar in Alpha then PicFound := true; 'F': if WorkChar in FileChars then PicFound := true; else if WorkChar = FormatChar then  PicFound := true end; if not PicFound then WorkPad; end; (* End of search for picture char *) if PicFound then begin if (FormatChar = '!') or (FormatChar = 'F') then WorkChar := upcase(WorkChar); WorkString := WorkString + WorkChar; end else begin J := K; WorkString := copy(WorkString, 1, J) end end; (* End of InString *) while J <= FormatLength do begin FormatChar := Format [J]; J := J + 1; WorkPad; end end; begin I := 1; PictureN := true; FormatDecPos := 0; SignPosition := 0; FormatSign := ' '; FormatLength := length(Format); InStringLength := length(InString); while ((PictureN) and (I <= FormatLength)) do begin FormatChar := Format [I]; if ((FormatChar = '.') and (FormatDecPos = 0)) then FormatDecPos := I else if ((FormatChar = ',') and (FormatDecPos = 0)) then else if ((FormatChar in ['+', '-']) and ((I = 1) or (I = FormatLength)) and (FormatSign = ' ')) then begin SignPosition := I; FormatSign := FormatChar end else if FormatChar in ['$', '*', 'Z', '#', '9'] then else PictureN := false; I := I + 1 end; if PictureN then FormatN else FormatX; SayPic := WorkString; end;  end; begin I := 1; PictureN := true; FormatDecPos := 0; SignPosition := 0; FormatSign := ' '; FormatLength := length(Format); InStringLength := length(InString); while ((PictureN) and (I <= FormatLength)) do begin FormatChar := Format [I]; if ((FormatChar = '.') and (FormatDecPos = 0)) then FormatDecPos  This is the release date of the disk. !K"Kÿÿ$K%K&K'K(K)Kÿÿ+K,K-K.K/Kÿÿÿÿ2K3K4K5K6K7K8K9K:K;KK?K@KAKBKCKDKEKFKGKHKIKJKKKLKMKNKOKPKQKRKSKTKUKVKWKXKYKZK[K\K]K^K_K`KaKbKcKdKeKfKgKhKiKjKkKlKmKnKoKpKqKrKsKtKuKvKwKxKyKzK{K|K}K~KK€K�K‚KƒK„K…K†K‡KˆK‰KŠK‹KŒK�KŽK�K�K‘K’K“K”K•K–K—K˜K™KšK›KœK�KžKŸK K¡K¢K£K¤K¥K¦K§K¨K©KªK«K¬K­K®K¯K°K±K²K³K´KµK¶K·K¸K¹KºK»K¼K½K¾K¿KÀKÁKÂKÃKÄKÅKÆKÇKÈKÉKÊKËKÌKÍKÎKÏKÿÿÑKÒKÓKÔKÕKÖK×KØKÙKÚKÛKÜKÝKÞKßKàKáKâKãKäKåKæKçKèKéKêKëKìKÿÿîKïKðKñKòKóKôKÿÿöK÷KøKùKúKûKüKýKþKÿKLCRT .PRC 4C 0D 2048 16 DISKFILE.FNC 6A D3 640 5 HEXTOCHR.FNC C8 71 1152 9 LCRJUST .FNC 14 74 1664 13 LST .PRC F9 D3 768 6 MANYCHAR.FNC A5 FA 640 5 REPLACE .FNC 46 47 1152 9 SAYBOOL .FNC 57 D2 512 4 SQUEEZE .FNC E9 D9 1152 9 SYSINIT .PRC AD 51 1536 12 TRIM .FNC 24 43 1152 9 WAIT .PRC 99 2F 384 3 FOGSTORE Fog Library Disk FOG-CPM.028 Copyright (1986) by Fog International Computer Users Group to the extent not copyrighted by the original author for the exclusive use and enjoyment of its members. Any reproduction or distribution for profit or personal gain is strictly forbidden. For information, contact FOG, P. O. Box 3474, Daly City, CA. 94015-0474. as part of the description of a file indicates that the program is distributed on a "try first, pay if you like it" basis. If you find the program(s) meet your need, please refer to the author's documentation for information on becoming a registered user. Only by registering and paying for the programs you like and use will the authors of such programs continue development. Often, more complete documentation, additional modules, and new releases are available only to registered users. Disk 2 of 2. Turbo Pascal programs. Filename Description -02-00 .86 This is the release date of the disk. & -CPM028 .DOC This is the description of the disk contents. SLIST .PAS 1B83 12K ver. 1.00A [SLIST 9 of 29] SLIST1 .INC 3A9E 7K ver. 1.00A [SLIST 10 of 29] SLIST2 .INC 1ED1 6K ver. 1.00A [SLIST 11 of 29] SLIST3 .INC 1CED 6K ver. 1.00A [SLIST 12 of 29] SYSCONST.CON 65AD 1K ver. 1.00A [SLIST 13 of 29] SYSTYPE .TYP ECDC 1K ver. 1.00A [SLIST 14 of 29] SYSVAR .VAR E1C4 1K ver. 1.00A [SLIST 15 of 29] CENTER .FNC 6380 2K ver. 1.00A [SLIST 16 of 29] CPM .PRC 9D7E 5K ver. 1.00A [SLIST 17 of 29] CRT .PRC 4C0D 2K ver. 1.00A [SLIST 18 of 29] DISKFILE.FNC 6AD3 1K ver. 1.00A [SLIST 19 of 29] HEXTOCHR.FNC C871 2K ver. 1.00A [SLIST 20 of 29] LCRJUST .FNC 1474 2K ver. 1.00A [SLIST 21 of 29] LST .PRC F9D3 1K ver. 1.00A [SLIST 22 of 29] MANYCHAR.FNC A5FA 1K ver. 1.00A [SLIST 23 of 29] REPLACE .FNC 4647 2K ver. 1.00A [SLIST 24 of 29] SAYBOOL .FNC 57D2 1K ver. 1.00A [SLIST 25 of 29] SQUEEZE .FNC E9D9 2K ver. 1.00A [SLIST 26 of 29] SYSINIT .PRC AD51 2K ver. 1.00A [SLIST 27 of 29] TRIM .FNC 2443 2K ver. 1.00A [SLIST 28 of 29] WAIT .PRC 992F 1K ver. 1.00A [SLIST 29 of 29] FOGSTORE.COM 2E92 12K [FOGSTORE 1 of 3] This is a Turbo Pascal tutorial, which uses a "store" as a demo. Documentation and Pascal source code are included. FOGSTORE.DOC 2E08 6K [FOGSTORE 2 of 3] FOGSTORE.PAS 41E7 6K [FOGSTORE 3 of 3] MONEY2 .COM 742F 15K ver. 2 [MONEY 1 of 3] This program calculates IRA's, Savings, or loan payments. Pascal Source code is included. MONEY2 .DOC 875D 3K ver. 2 [MONEY 2 of 3] MONEY2 .PAS E494 12K ver. 2 [MONEY 3 of 3] SORTS .COM CD41 12K [SORTS 1 of 3] This program does a comparison of different sorting algorithms. Bubble, sount, insert, select, tree, shell, heap, quick1, and quick2. Pascal source code and documentation is included. SORTS .DOC 5C98 3K [SORTS 2 of 3] SORTS .PAS BEC6 15K [SORTS 3 of 3] PICTURE .DOC E1A0 6K [Picture 1 of 4] This set contains a discussion and demo of Getpic and Saypic. The Demo source code in Pascal is included. PICTURE .PAS 5D7C 2K [Picture 2 of 4] GETPIC .FNC C183 9K [Picture 3 of 4] SAYPIC .FNC 81D4 9K [Picture 4 of 4] .FNC 6AD3 1K ver. 1.00A [SLIST 19 of 29] HEXTOCHR.FNC C871 2K ver. 1.00A [SLIST 20 of 29] LCRJUST .FNC 1474 2K ver. 1.00A [SLIST 21 of 29] LST .PRC F9D3 1K ver. 1.00A [SLIST 22 of 29] MANYCHAR.FNC A5FA 1K ver. 1.00A [SLIåå'ååååå