Listing: 1 IMPLEMENTATION MODULE PMIGlobals; 2 (* 3 * ModBase 4 * Release 3.0 5 * (c) Copyright 1986 - 1991 PMI 6 * P.O. Box 8402 7 * Green Bay Wi 53308 8 * All Rights Reserved 9 * by Ed Ross 10 *) 11 12 FROM EnvironUtils IMPORT GetDate; 13 FROM DateFunctions IMPORT DatePlusDays,DateToStr,DayOfWeek,DaysSince1900; 14 FROM PosUtils IMPORT Equal; 15 FROM HandleIO IMPORT CreateFile,OpenFile,BlockRead,BlockWrite,FileExists; 16 FROM ScrnTypes IMPORT DisplayFrame,InitDisplayFrame; 17 FROM DspFiles IMPORT ReadDisplayFrame; 18 FROM ScrnUtl2 IMPORT CloseDisplayFrame; 19 FROM LowLevel IMPORT Fill; 20 FROM StrEdit IMPORT CrunchBlanks,Center,AssignStr; 21 FROM FramePainter IMPORT ShowDisplayFrame; 22 FROM ControlUtils IMPORT ChangeField,ReadInput,Control; 23 FROM DBUtils IMPORT ChangeCardField,ChangeRealField, 24 ReadCardField,ReadRealField; 25 FROM VWindows IMPORT CurrentWindow; 26 FROM StringIO IMPORT ErrorMessage; 27 FROM SYSTEM IMPORT ADR,SIZE; 28 FROM HandleIO IMPORT BlockRead, BlockWrite, CloseHandle, CreateFile, ***** ^ duplicate identifier ***** ^ duplicate identifier ***** ^ duplicate identifier ***** ^ duplicate identifier 29 FileExists, FileOffSet, OpenFile, SetFilePtr; ***** ^ duplicate identifier ***** ^ duplicate identifier 30 FROM DBUtils IMPORT PrintTitle; ***** ^ duplicate identifier 31 PROCEDURE EditConfig(); 32 VAR 33 DF : DisplayFrame; 34 H : CARDINAL; 35 NextInvNbr : CARDINAL; (* updated only for display and reset *) 36 NextCustNbr : CARDINAL; 37 NextPONbr : CARDINAL; 38 EM : ErrorMessage; 39 BEGIN 40 InitDisplayFrame(DF,CurrentWindow); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 41 ReadDisplayFrame(PMIScreens,DF,'PMIConfig'); ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 42 EM := OpenFile(H,'Inseq'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 43 EM := BlockRead(H,ADR(NextInvNbr),SIZE(NextInvNbr)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 44 EM := CloseHandle(H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 45 46 EM := OpenFile(H,'Cuseq'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 47 EM := BlockRead(H,ADR(NextCustNbr),SIZE(NextCustNbr)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 48 EM := CloseHandle(H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 49 50 EM := OpenFile(H,'POseq'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 51 EM := BlockRead(H,ADR(NextPONbr),SIZE(NextPONbr)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 52 EM := CloseHandle(H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 53 54 55 WITH Config DO ***** ^ undeclared identifier 56 ChangeField(DF,CompanyName,'CompanyName',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 57 ChangeField(DF,CompanyAddr1,'Address1',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 58 ChangeField(DF,CompanyAddr2,'Address2',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 59 ChangeField(DF,Phone,'Phone',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 60 ChangeField(DF,InvoicePrt,'invprn',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 61 ChangeField(DF,PksSlipPrt,'pkgprn',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 62 ChangeField(DF,ReportPrt,'rptprn',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 63 ChangeField(DF,LabelPrt,'labprn',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 64 ChangeField(DF,InvoicePre,'PreInvoice',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 65 ChangeField(DF,PurchOrdPre,'PrePONbr',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 66 ChangeField(DF,CustNbrPre,'PreCust',TRUE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 67 ChangeRealField(DF,TaxRate,'TaxRate'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 68 ChangeCardField(DF,NextInvNbr,'NxtInvoice'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 69 ChangeCardField(DF,NextCustNbr,'NxtCust'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 70 ChangeCardField(DF,NextPONbr,'NxtPONbr'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 71 ChangeRealField(DF,OvertimeCharge,'GasChg'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 72 ChangeCardField(DF,KeepPaymentHist,'KeepDays'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 73 ShowDisplayFrame(DF,0,0,0,0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 74 Control(DF); ***** ^ not supported yet ***** ^ not supported yet 75 76 ReadInput(DF,CompanyName,'CompanyName'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 77 ReadInput(DF,CompanyAddr1,'Address1'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 78 ReadInput(DF,CompanyAddr2,'Address2'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 79 ReadInput(DF,Phone,'Phone'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 80 ReadInput(DF,InvoicePrt,'invprn'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 81 ReadInput(DF,PksSlipPrt,'pkgprn'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 82 ReadInput(DF,ReportPrt,'rptprn'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 83 ReadInput(DF,LabelPrt,'labprn'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 84 ReadInput(DF,InvoicePre,'PreInvoice'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 85 ReadInput(DF,CustNbrPre,'PreCust'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 86 ReadInput(DF,PurchOrdPre,'PrePONbr'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 87 ReadRealField(DF,TaxRate,'TaxRate'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 88 ReadCardField(DF,NextInvNbr,'NxtInvoice'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 89 ReadCardField(DF,NextPONbr,'NxtPONbr'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 90 ReadCardField(DF,NextCustNbr,'NxtCust'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 91 ReadCardField(DF,KeepPaymentHist,'KeepDays'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 92 ReadRealField(DF,OvertimeCharge,'GasChg'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 93 94 END; (* end with *) ***** ^ not supported yet 95 EM := OpenFile(H,'PMI.cfg'); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 96 EM := BlockWrite(H,ADR(Config),SIZE(Config)); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 97 EM := CloseHandle(H); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 98 99 EM := OpenFile(H,'Inseq'); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 100 EM := BlockWrite(H,ADR(NextInvNbr),SIZE(NextInvNbr)); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 101 EM := CloseHandle(H); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 102 103 EM := OpenFile(H,'POSeq'); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 104 EM := BlockWrite(H,ADR(NextPONbr),SIZE(NextPONbr)); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 105 EM := CloseHandle(H); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 106 107 108 109 EM := OpenFile(H,'Cuseq'); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 110 EM := BlockWrite(H,ADR(NextCustNbr),SIZE(NextCustNbr)); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 111 EM := CloseHandle(H); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 112 113 CloseDisplayFrame(DF); ***** ^ not supported yet ***** ^ undeclared identifier 114 END EditConfig; ***** ^ not supported yet 115 116 PROCEDURE NormalTitle(VAR LastLine : ARRAY OF CHAR); ***** ^ not supported yet 117 VAR 118 J : CARDINAL; 119 BEGIN 120 AssignStr(PrintTitle[0], Config.CompanyName); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 121 AssignStr(PrintTitle[1], Config.CompanyAddr1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 122 AssignStr(PrintTitle[2], Config.CompanyAddr2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 123 AssignStr(PrintTitle[3], Config.Phone); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 124 PrintTitle[4,0] := CHR(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 125 AssignStr(PrintTitle[5], TodayStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 126 AssignStr(PrintTitle[6], LastLine); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 127 FOR J := 0 TO 6 DO 128 CrunchBlanks(PrintTitle[J]); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 129 Center(PrintTitle[J],79); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 130 END; 131 END NormalTitle; ***** ^ not supported yet 132 133 PROCEDURE OpenReportDevice() : CARDINAL; 134 VAR EM : CARDINAL; 135 Handle : CARDINAL; 136 BEGIN 137 138 EM := OpenFile(Handle,Config.ReportPrt); ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 139 IF EM = 0 140 THEN RETURN Handle; 141 ELSE RETURN 0; 142 END; 143 END OpenReportDevice; ***** ^ not supported yet 144 145 PROCEDURE CloseReportDevice(Device : CARDINAL); 146 VAR 147 EM : CARDINAL; 148 BEGIN 149 EM := CloseHandle(Device); ***** ^ not supported yet ***** ^ not supported yet 150 END CloseReportDevice; ***** ^ not supported yet 151 152 PROCEDURE GlobalInit(); 153 VAR 154 Str1,Str2 : ARRAY[0..15] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 155 B : BOOLEAN; 156 EM : CARDINAL; 157 H : CARDINAL; 158 BEGIN 159 IF FileExists('PMI.CFG') ***** ^ not supported yet ***** ^ not supported yet 160 THEN 161 EM := OpenFile(H,'PMI.cfg'); ***** ^ not supported yet ***** ^ not supported yet 162 EM := BlockRead(H,ADR(Config),SIZE(Config)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 163 164 ELSE 165 Fill(ADR(Config),SIZE(Config),0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 166 EM := CreateFile(H,'PMI.CFG'); ***** ^ not supported yet ***** ^ not supported yet 167 EM := BlockWrite(H,ADR(Config),SIZE(Config)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 168 END; 169 EM := CloseHandle(H); ***** ^ not supported yet ***** ^ not supported yet 170 GetDate(Today.mo,Today.day,Today.yr,Str2,TodayStr); ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 171 DateToStr(Today,TodayStr,B); ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ not supported yet 172 TodayP30 := Today; ***** ^ undeclared identifier ***** ^ undeclared identifier 173 TodayDays := DaysSince1900(Today); ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier 174 DatePlusDays(TodayP30,30,B); (* today plus 30 *) ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 175 DayOfWeek(TodayP30,Str1); ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 176 IF Equal(Str1,'SATURDAY') ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 177 THEN DatePlusDays(TodayP30,2,B); (* make due date a weekday *) ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 178 ELSIF Equal(Str2,'SUNDAY') ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 179 THEN DatePlusDays(TodayP30,1,B); ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 180 END; 181 END GlobalInit; ***** ^ not supported yet 182 183 END PMIGlobals. ***** ^ not supported yet 369 errors