MODULE PMI; FROM Drectory IMPORT SetDefaultDrive,GetCurrentDir; FROM EnvironUtils IMPORT ReadEnvironment; FROM ModBase3 IMPORT UpdateDBFile,WriteDBRec,DeleteRecord,ReadDBRec, AppendBlank; (*FROM Dos IMPORT SetMaxFH;(* for os2 Dos< jpi DosCalls< Stn*)*) FROM StrEdit IMPORT CrunchBlanks,CAPstr,DeleteRightJustified; FROM StringIO IMPORT PrintMessage; FROM M2Strings IMPORT Length; FROM Scrn2DBF IMPORT FrameToDBF, DBFToFrame; FROM PosUtils IMPORT Equal; FROM PMIGlobals IMPORT PMIScreens,GlobalInit,EditConfig; FROM SmartScreen IMPORT ClearScreen; FROM VWindows IMPORT ClearPart, CurrentWindow, SetCursorHeight; FROM ScrnTypes IMPORT DisplayFrame,InitDisplayFrame,AFrameName; FROM FramePainter IMPORT ShowDisplayFrame; FROM InputManager IMPORT ControlFrame; FROM FrameManager IMPORT EraseFrame; FROM Prompts IMPORT Prompt,PromptStr; FROM PMIRpt IMPORT ControlReports; FROM DBStuff IMPORT MakeKey; FROM SYSTEM IMPORT ADR,SIZE; FROM ControlUtils IMPORT ControlSeparately, LoadFrameList,Control; FROM DspFiles IMPORT OpenDisplayFile,ReadDisplayFrame; FROM HandleIO IMPORT FileExists; FROM Prompts IMPORT Prompt; FROM LowLevel IMPORT Fill; FROM GenLists IMPORT GenList, NewList,ListLength,GetElmt; FROM ScrnTypes IMPORT AFrameName, InitDisplayFrame,DisplayFile; FROM DBFCustomer IMPORT CustomerDBF, OpenCustomerDBF, CloseCustomerDBF,FindCustomerByCin,FindCustomerByName, NextCustomer,PrevCustomer,FirstCustomer,LastCustomer; FROM DBFInvtry IMPORT OpenInvtryDBF,CloseInvtryDBF; FROM Invtry IMPORT ControlInvtry; FROM Customer IMPORT ControlCustomer; FROM PriceTable IMPORT InitializePrice,DefinePriceTbl; FROM PMIMaint IMPORT Maintain; IMPORT InitCompilerMods; IMPORT Locks; VAR Status : INTEGER; J : CARDINAL; Environ : ARRAY[0..80] OF CHAR; TopMenu : GenList; FirstTime: BOOLEAN; NextFrame,EndingFrame : AFrameName; SelChar : CHAR; NoData : BOOLEAN; (* true when no data is on the screen *) CustomerDF : DisplayFrame; DSPFile : DisplayFile; PullDnMenu : GenList; BEGIN ReadEnvironment('M2TEST', Environ); (*Locks.ExclusiveOnly:=TRUE; (* jpi's extenders api does not lock properly*)*) CrunchBlanks(Environ); GlobalInit(); IF NOT OpenDisplayFile(PMIScreens,'PMI.DSP') THEN Prompt('Could not open PMI Display file'); HALT; END; (* J := SetMaxFH(30); (*os2 only *)*) InitDisplayFrame(CustomerDF,CurrentWindow); NewList(PullDnMenu); NoData := TRUE; InitializePrice(); REPEAT ClearScreen(); ReadDisplayFrame(PMIScreens,CustomerDF,'MainMenu'); (*Clear out any of the fields *) ShowDisplayFrame(CustomerDF,0,0,0,0); ControlFrame(CustomerDF,1,'',FALSE,NextFrame); (* alow user input *) OpenCustomerDBF(TRUE); OpenInvtryDBF(TRUE); IF Equal(NextFrame,'Customer') THEN ControlCustomer();; ELSIF Equal(NextFrame,'Inventory') THEN ControlInvtry(); ELSIF Equal(NextFrame,'Reports') THEN ControlReports(); ELSIF Equal(NextFrame,'Maint') THEN Maintain(); ELSIF Equal(NextFrame,'PriceTable') THEN DefinePriceTbl(); ELSIF Equal(NextFrame,'EditConfig') THEN EditConfig(); END; CloseInvtryDBF(); CloseCustomerDBF(); ClearScreen(); UNTIL Equal(NextFrame,'Exit'); END PMI.