/* GetClient.rexx - DB PlugIn : Sets DB to start of Client entries (c) 1996 Karl Mottram - Bifrost Industries Started 2230 hrs - 03-12-96 Last Updated $VER: v1.3_(23-12-96) - Prompter added... */ Init: CLS = "{0;0H" /* Clearscreen command */ Signal on BREAK_C /* Break trapping */ SpyFile = "LOGS:Bioware.log" /* For Expansion */ CFile = "DB:Files/JobBase.db" /* Target DB file */ CallDB = "DB:DB" /* Shell call */ BasePort = "TFJOB" /* What port to link to*/ Parse Arg CDat Flag Flag = strip(Flag) CheckDB: If Index(Show('P'),BasePort) = 0 then do Address Command "c:RunBack" CallDB CFile end SetPort: Address(BasePort||'.1') If Flag = "-d" then Debug = 1 /* Set debug mode on */ If Flag = '-p' then Signal Prompt /* Get CDat via WB */ If Flag = '-c' then Signal GetByName /* Client Number search bypass */ CheckData: /* Check if client number */ If Datatype(CDat,W) = 1 then signal GetByNum GetByName: Open(CList,CFile,R) CDat = upper(CDat) If Debug = 1 then Say CDat Count = 0 Feilds = Readln(CList) Do until EOF(CList) RLine = upper(Readln(CList)) If index(RLine,'@RFF=') > 0 then Iterate Count = Count + 1 If index(RLine,CDat) > 0 then do If Debug = 1 then Say Count ":::" RLine SCREENTOFRONT ; WINDOWTOFRONT ; ACTIVATEWINDOW CURRENTRECORD Count Signal Exzit end end Signal NoSuch GetByNum: Open(CList,CFile,R) Count = 0 Feilds = Readln(CList) Do until EOF(CList) RLine = Readln(CList) If index(RLine,'@RFF=') > 0 then Iterate Count = Count + 1 If Left(RLine,2) = CDat then do If Debug = 1 then Say Count ":::" RLine SCREENTOFRONT ; WINDOWTOFRONT ; ACTIVATEWINDOW CURRENTRECORD Count Signal Exzit end end NoSuch: SCREENTOFRONT Okay1 "This number is not currently assigned to any clients." BREAK_C: Exzit: Close(CList) Exit Prompt: Call Open(Prompter,"CON:100/100/500/20/Enter Search String...") PLine = Readln(Prompter) If PLine = '' then Signal Exzit Parse Var PLine CDat Flag Flag = strip(Flag) Signal CheckDB