/* EasySystem © TNE) 1998 GlobalHelp Online Manual Serving and archiving system for diversificated and localized System manuals. Preferred Languages automatically extracted from ENV:sys/locale.prefs Detailed config and description, see EASys!_rexx:Manual.config Referenced by: ${RefTable/ManualServer} and uses: ${RefTable/ManualServer-Config} */ PARSE ARG ChosenFiles OPTIONS RESULTS OPTIONS FAILAT 21 CALL Init IF ChosenFiles='??' THEN DO IF EXISTS('EASys!_bin:'Language'/man.help') THEN ADDRESS COMMAND 'type EASys!_bin:'Language'/man.help' ELSE ADDRESS COMMAND 'type EASys!_bin:english/man.help' EXIT 0 END IF EXISTS('ENV:EASys!/Manual.config') THEN ADDRESS COMMAND 'copy ENV:EASys!/Manual.config EASys!:Programs CLONE QUIET' IF ''=ChosenFiles THEN DO FOREVER DocFind_name='' ChosenFiles=ShowMessage('Manual.1',,,'',AppName) IF Action=0 THEN CALL ExitMe IF Action=1 THEN LEAVE IF Action=2 & ~(ChosenFiles='') THEN CALL GetNew IF Action=3 THEN DO ADDRESS COMMAND '${RefTable/Text-Editor-Sync} EASys!_rexx:Manual.config' 'copy ENV:EASys!/Manual.config EASys!:Programs CLONE QUIET' END IF Action=4 THEN ADDRESS COMMAND '${RefTable/Text-ViewGUIDE} EASys!:Help/'Language'/EASys!_GlobalHelp.guide' END CALL FileParser CALL ReadConfig CALL HandleDocs CALL ExitMe /* ---------------------- */ GetNew: GetNew=1 CALL ReadConfig FileName.1=ChosenFiles CALL GetDoc GetNew=0 RETURN /* ---------------------- */ HandleDocs: Search=1 uSuffix=UPPER(SUFFIX.1) DO SuffixCount=1 to SuffixNumber IF uSuffix=UPPER(DocSuffix.SuffixCount) THEN DO CALL MoveDocs Search=0 LEAVE END END IF Search=1 THEN CALL SearchDocs RETURN /*------------ move the document to the user-specified help directory */ MoveDocs: /* Presets */ DocSource=Files.1 uDocSource=UPPER(DocSource) DocDestination=Device.1'Help/' IconFile=DocSource'.info' DestFilePath=DocDestination''FileName.1 LocDestination='Help:' NoSubDirs=0 IF ~EXISTS(DocSource) THEN DO Action=ShowMessage('Manual.3',,,,AppName,FileName.1) IF ~(Action=0) THEN ADDRESS COMMAND 'EASys!_bin:IconDelete 'DocSource CALL ExitMe END DO count=1 to IdNumber IF ~(Identifier.count='') THEN DO IF POS(UPPER(Identifier.count),uDocSource) > 0 THEN DO DocDestination=IdPath.count IF UPPER(IdMultiLang.count)="NOFOLDERS" THEN NoSubDirs=1 LEAVE END END END CALL MakeDirs(DocDestination) DestNoSubDirs=DocDestination IF ~(DocFind_name='') THEN DO LocDestFilePath=LocDestination''DocFind_name'.loc' CALL StoreLocal IF GetNew=1 THEN RETURN END ELSE DO LocDestFilePath=LocDestination''Prefix.1'.loc' Action=ShowMessage('Manual.4',,,,AppName,FileName.1) IF Action=0 THEN CALL ExitMe Local=Action ReplaceImmediate=0 IF Local=1 THEN CALL StoreLocal IF Local=2 THEN CALL StoreCentral END IF GetNew=1 THEN RETURN ELSE CALL ExitMe /* ---------------------- */ StoreLocal: IF DocFindName='' THEN Do count=1 to LanguageNumber DestFilePath=DestNoSubDirs''Language.count'/'FileName.1 IF EXISTS(DestFilePath) THEN DO Action=ShowMessage('Manual.5',,,,AppName,FileName.1) IF Action=0 THEN CALL ExitMe IF Action=1 THEN LEAVE IF Action=2 THEN DO ADDRESS COMMAND 'EASys!_bin:IconDelete 'LocDestFilePath ReplaceImmediate=1 CALL StoreCentral RETURN END END END OldLocation=DestNoSubDirs''Prefix.1'.loc' IF EXISTS(OldLocation) THEN ADDRESS COMMAND 'delete >NIL: 'OldLocation' FORCE QUIET' IF EXISTS(LocDestFilePath) & ReplaceImmediate=0 THEN DO Action=ShowMessage('Manual.6',,,,AppName,FileName.1) IF ~(Action=1) THEN CALL ExitMe END uSuffix=UPPER(SUFFIX.1) DO count=1 to 10 IF uSuffix=UPPER(DocSuffix.count) THEN Viewer=SfxCommand.count END ADDRESS COMMAND 'echo >'LocDestFilePath '"; ManualServer Script_Link to a locally stored manual."' 'echo >>'LocDestFilePath '"if exists *"'DocSource'*""' 'echo >>'LocDestFilePath '" 'Viewer '*"'DocSource'*""' 'echo >>'LocDestFilePath '"else"' 'echo >>'LocDestFilePath '" 'EasyRequester' *" Manuals:*" *" 'DocSource'\n is not available anymore!\n\n The link will be removed now.*" *"Hm.. !*""' 'echo >>'LocDestFilePath '" delete >NIL: "'LocDestFilePath'" QUIET"' 'echo >>'LocDestFilePath '"endif"' IF ~(GetNew=1) & ~(DocFind_name='') THEN ADDRESS COMMAND '${RefTable/File-Presentate} "'DocSource'"' RETURN /*-------- Not Local, move Docs to DEVICE:Help/ --------------------*/ StoreCentral: /* Get the language of the document, the computer cannot deterine that. */ Gadgets=language.1' | ' IF LanguageNumber > 1 THEN DO count=2 to LanguageNumber Gadgets=Gadgets''language.count' | ' END DO UNTIL ~(Action=LanguageNumber+1) /* repeat as long user wants to read again */ Action=ShowMessage('Manual.2',,,,AppName,Gadgets) IF Action=LanguageNumber+1 THEN /* read again */ DO count=1 to SuffixNumber IF SUFFIX.1=UPPER(DocSuffix.count) THEN ADDRESS COMMAND SfxCommand.count '"'DocSource'"' END END IF Action=0 THEN CALL ExitMe Sprache=Action IF Sprache=1 THEN DocDestination=DocDestination''language.1'/' IF Sprache=2 THEN DocDestination=DocDestination''language.2'/' IF Sprache=3 THEN DocDestination=DocDestination''language.3'/' IF Sprache=4 THEN DocDestination=DocDestination''language.4'/' IF Sprache=5 THEN DocDestination=DocDestination''language.5'/' IF NoSubDirs=1 THEN DestFilePath=DestNoSubDirs''FileName.1 ELSE DestFilePath=DocDestination''FileName.1 IF EXISTS(LocDestFilePath) THEN DO Action=ShowMessage('Manual.7',,,,AppName,FileName.1) IF Action=0 THEN CALL ExitMe IF Action=2 THEN DO ADDRESS COMMAND 'EASys!_bin:IconDelete 'DestFilePath ReplaceImmediate=1 CALL StoreLocal RETURN END END ADDRESS COMMAND 'EASys!_bin:IconDelete 'LocDestFilePath IF EXISTS(DestFilePath) & ReplaceImmediate=0 THEN DO Action=ShowMessage('Manual.8',,,,AppName) IF Action=0 THEN CALL ExitMe END ADDRESS COMMAND 'EASys!_bin:move "'DocSource'" "'DocDestination'" CLONE QUIET' 'EASys!_bin:IconDelete 'IconFile IF SUFFIX.1="DOC" | SUFFIX.1="DOK" | SUFFIX.1="MAN" THEN ADDRESS COMMAND xPacker DestFilePath xPackerMethod xPackerSize RETURN /* ---------------------- */ SearchDocs: IF SUFFIX.1='' THEN SUFFIX.1='NO_SUFFIX' File=0 DO PathCount=1 to PathNumber NextPathCount=PathCount+1 TheName=SearchPath.PathCount''FileName.1 CALL FindDocs(TheName) /* Something found, break searches ? */ IF File='found' & Break.NextPathCount=1 THEN LEAVE END DO PathCount=1 to IdNumber /* Searching by external search scripts such as for Libs and Datatypes Docs */ IF SUFFIX.1=UPPER(Identifier.PathCount) & ~(SearchScript.PathCount='') THEN DO ADDRESS COMMAND SearchScript.PathCount FileName.1 IdPath.PathCount File='found' END END IF File='found' & Break.NextPathCount=1 THEN CALL ExitMe /* Now try to find Docs inside other preset Directories to search for */ DO VarPathCount=1 to VarPathNumber TheName=OtherSearch.VarPathCount''FileName.1 CALL SearchnViewDoc(TheName) END /* If not even now anything was found: Try a pattern search? */ IF File=0 THEN DO Action=ShowMessage('Manual.9',,,,AppName,FileName.1) IF Action=1 THEN DO ThePattern='#?'FileName.1'#?' CALL SearchByPattern(ThePattern) END IF Action=2 THEN ADDRESS COMMAND '${RefTable/Text-Editor} EASys!_rexx:Manual.config' IF Action=3 THEN CALL GetDoc END CALL ExitMe /* ---------------------- */ GetDoc: DocFind_name=FileName.1 File=ShowMessage('Manual.11','Help:',FileName.1,,' 'FileName.1'.#?') IF File='' THEN CALL ExitMe drop Files i=1 Files.1=File Files.count=1 CALL Analyze CALL HandleDocs RETURN /* ---------------------- */ FindDocs: PARSE ARG SearchName /* Normal Directories search */ CALL SearchnViewDoc(SearchName) /* Now try to find Docs in Language related Helpdrawer's subdirs */ IF ~(UPPER(MultiLang.PathCount)='NOFOLDERS') THEN DO LanguageCount=1 to LanguageNumber SearchName=SearchPath.PathCount''Language.LanguageCount"/"FileName.1 CALL SearchnViewDoc(SearchName) /* Something found, break searches ! */ IF File='found' THEN LEAVE END RETURN 0 /* ---------------------- */ SearchnViewDoc: PARSE ARG ViewDoc DO SuffixCount=1 to SuffixNumber TheFile=ViewDoc'.'DocSuffix.SuffixCount IF EXISTS(TheFile) THEN DO File='found' ADDRESS COMMAND SfxCommand.SuffixCount TheFile IF Break.NextPathCount=1 THEN LEAVE END END IF File='found' THEN RETURN 1 ELSE RETURN 0 /* ---------------------- */ SearchByPattern: PARSE ARG PatternName SearchPath.0='' DO PathCount=1 to PathNumber IF Break.PathCount=1 THEN LEAVE Before=PathCount-1 IF ~(SearchPath.PathCount=SearchPath.Before) THEN DO LanguageCount=1 to LanguageNumber SearchIn=SearchPath.PathCount''Language.LanguageCount'/'PatternName CALL SearchPattern(SearchIn) END END Action=ShowMessage('Manual.10',,,,AppName) IF Action=0 THEN CALL ExitMe ELSE DO VarPathCount=1 to VarPathNumber SearchIn=OtherSearch.VarPathCount''PatternName CALL SearchPattern(SearchIn) END RETURN 0 /* ---------------------- */ SearchPattern: PARSE ARG SearchInDir tmpscript='T:GH_Pattern'ProcessNumber ADDRESS COMMAND 'list ' SearchInDir ' >'tmpscript' LFORMAT "${RefTable/View-Master} %s%s*n"' 'execute 'tmpscript 'delete >NIL: 'tmpscript' QUIET' RETURN 0 /* ------------------------- */ ShowMessage: PARSE ARG Mesg,ReqPath,ReqFile,PresetString,Parameter1,Parameter2,Parameter3,Parameter4,Parameter5,Parameter6 drop Action ReqType='' MsgFile='EASys!_rexx:'Language'/'Mesg IF ~Open(fTMP,MsgFile,'read') THEN CALL Err_ShowMessage ELSE DO ReqType=ReadLn(fTMP) /* read Requester-Type */ Line=ReadLn(fTMP) /* read Title-Line */ CALL Substitutions ReqTitle=Line Line=ReadLn(fTMP) /* free line after Title */ Message='' DO UNTIL EOF(fTMP) Line=ReadLn(fTMP) CALL Substitutions IF POS(">>>",Line) > 0 THEN DO rtBtns=STRIP(Line,'L','>') LEAVE END ELSE Message=Message''CR''Line END r=Close(fTMP) END uReqType=UPPER(ReqType) pubname=getpubscreen() IF ~(pubname='') THEN r=setpubscreen(pubname' Default') SELECT WHEN uReqType='MULTI REQUEST' THEN DO r=rtezrequest(Message,rtBtns,ReqTitle,PosTags) RETURN r END WHEN uReqType='GET ONE FILE' THEN DO r=rtfilerequest(ReqPath,ReqFile,ReqTitle,rtBtns,ONEFILE_TAG,Files) RETURN r END WHEN uReqType='GETFILES' THEN DO r=rtfilerequest(ReqPath,ReqFile,ReqTitle,rtBtns,FILE_TAGS,Files) RETURN r END WHEN uReqType='GETPATH' THEN DO r=rtfilerequest(ReqPath,,ReqTitle,rtBtns,DIR_TAGS) RETURN r END WHEN uReqType='GETSTRING' THEN DO r=rtgetstring(PresetString,Message,ReqTitle,rtBtns,GStags,Action) RETURN r END WHEN uReqType='GETSTRING SIMPLE' THEN DO r=rtgetstring(PresetString,Message,ReqTitle,,GStags,Action) RETURN r END WHEN uReqType='CONSOLE' THEN DO ShowConsole='CON:'ReqLE'/'ReqTE'/'ConW'/'ConH'/'ReqTitle'/NOCLOSE' IF ~Open(Con,ShowConsole,'write') THEN DO MsgFile=ThisConsole CALL Err_ShowMessage ConStat=0 END ConStat=1 r=WriteLn(Con,Message) RETURN 1 END OTHERWISE CALL Err_ShowMessage /* Error if arrived here */ END /* SELECT */ RETURN /* ---------------------- */ Substitutions: IF POS("%1",Line) > 0 THEN /* substitution parameters for each message */ DO UNTIL POS("%1",Line)=0 /* and per line */ parse var Line part1 '%1' part2 Line=part1''parameter1''part2 END IF POS("%2",Line) > 0 THEN DO UNTIL POS("%2",Line)=0 parse var Line part1 '%2' part2 Line=part1''parameter2''part2 END IF POS("%3",Line) > 0 THEN DO UNTIL POS("%3",Line)=0 parse var Line part1 '%3' part2 Line=part1''parameter3''part2 END IF POS("%4",Line) > 0 THEN DO UNTIL POS("%4",Line)=0 parse var Line part1 '%4' part2 Line=part1''parameter4''part2 END RETURN /* ---------------------- */ Err_ShowMessage: Message=AppName':' CR CR "Sorry, an error has occured reading the MessageFile" CR CR " "MsgFile CR CR "... exiting." rtBtns='Oh no!' Action=rtezrequest(Message,rtBtns,ReqTitle,PosTags) CALL ExitMe RETURN /* ---------------------- */ FileParser: IF Files.1='FILES.1' | POS(':',ChosenFiles)=0 THEN DO i=0 DO FOREVER i=i+1 Files.i='' PrognameBegPos=0 DevicePos=0 DirPos=0 SfxBegin=0 IF POS('"',ChosenFiles)=0 THEN PARSE VAR ChosenFiles Files.i ChosenFiles ELSE PARSE VAR ChosenFiles Files.i '"' ChosenFiles /* parse the line */ IF Files.i=' ' THEN DO IF POS('"',ChosenFiles)=0 THEN PARSE VAR ChosenFiles Files.i ChosenFiles ELSE PARSE VAR ChosenFiles Files.i '"' ChosenFiles /* parse the line */ END Files.i=strip(Files.i,T,' ') Files.i=strip(Files.i,B,'"') IF Files.i='' THEN DO /* Break if end of Command-line */ Files.count=i-1 LEAVE END DevicePos=LASTPOS(':',Files.i) IF DevicePos=0 THEN DO ADDRESS COMMAND 'cd >ENV:'TempPath Path.i=MyGetENV(TempPath) IF RIGHT(Path.i,1)=':' THEN Files.i=Path.i''Files.i ELSE Files.i=Path.i'/'Files.i END CALL Analyze END END ELSE DO i=1 TO Files.count PrognameBegPos=0 DevicePos=0 DirPos=0 SfxBegin=0 CALL Analyze END i=Files.count /* set last path to Actual path */ Path=Path.i RETURN 1 /* ---------------------- */ Analyze: Laenge=LENGTH(Files.i) DevicePos=LASTPOS(':',Files.i) DirPos=LASTPOS('/',Files.i) IF DirPos>1 THEN DO PrognameBegPos=DirPos Path1=LEFT(Files.i,DirPos) Path.i=strip(Path1,T,'/') END ELSE DO PrognameBegPos=DevicePos Path.i=LEFT(Files.i,DevicePos) Path1=Path.i END Numchars=Laenge - PrognameBegPos Device.i=LEFT(Files.i,Devicepos) FileName.i=RIGHT(Files.i,Laenge-PrognameBegPos) SfxBegin=LASTPOS('.',FileName.i) IF SfxBegin=0 THEN DO Prefix.i=FileName.i Suffix.i='' END ELSE DO Prefix.i=LEFT(FileName.i,SfxBegin-1) Suffix.i=UPPER(RIGHT(Files.i,NumChars-SfxBegin)) END RETURN 1 /* ---------------------- */ ReadConfig: IF Open(fTMP,ConfigFile,'read') THEN DO /* First read the Header (fix) */ LineCount=0 CALL ReadConfigLine IF ~(LEFT(TheLine,22)="--- © TNE ManualServer") THEN CALL MessageErr("Wrong HeadLine in Manual.config !") DO UNTIL EOF(fTMP) CALL ReadConfigLine DUMMY=LEFT(TheLine,11) IF LEFT(DUMMY,3)="@@@" THEN LEAVE IF ~(DUMMY="***** Docum" | DUMMY="***** MainP" | DUMMY="***** Break" | DUMMY="***** Vario" | DUMMY="@" | DUMMY=";" | DUMMY="@@@") THEN CALL MessageErr("Missing ***** Declaration !") IF DUMMY="***** Docum" THEN DO SuffixNumber=0 DO items=1 to 24 UNTIL EOF(fTMP) CALL ReadConfigLine IF LEFT(TheLine,1)="@" THEN LEAVE SuffixNumber=SuffixNumber+1 DocSuffix.SuffixNumber=Word(TheLine,1) SfxCommand.SuffixNumber=Word(TheLine,2)' 'Word(TheLine,3) END IF SuffixNumber=0 THEN CALL MessageErr("No Suffixes declared"CR"in Suffix section.") IF ~(LEFT(TheLine,1)="@") THEN CALL MessageErr("Missing End-Sign '@'"CR"in Suffixes declaration.") END IF DUMMY="***** MainP" THEN DO IdNumber=0 PathNumber=0 DO items=1 TO 32 UNTIL EOF(fTMP) CALL ReadConfigLine IF LEFT(TheLine,1)="@" THEN LEAVE PathNumber=PathNumber+1 MultiLang.PathNumber='' SearchPath.PathNumber='' SearchScript.PathNumber='' IF LEFT(TheLine,11)='***** Break' THEN Break.PathNumber=1 ELSE DO IF LEFT(TheLine,2)="->" THEN DO SearchPath.PathNumber=Word(TheLine,2) MultiLang.PathNumber=Word(TheLine,3) SearchScript.PathNumber=Word(TheLine,4)' 'Word(TheLine,5) END ELSE DO SearchPath.Pathnumber=Word(TheLine,1) MultiLang.PathNumber=Word(TheLine,2) SearchScript.PathNumber=Word(TheLine,3)' 'Word(TheLine,4) IF LEFT(TheLine,1)='.' THEN DO MultiLang.PathNumber='NOFOLDERS' SearchScript.PathNumber=Word(TheLine,2)' 'Word(TheLine,3) IF ~(Path.1='PATH1') THEN SearchPath.PathNumber=Path1 ELSE SearchPath.PathNumber='' END END END DO count=0 to 16 UNTIL EOF(fTMP) CALL ReadConfigLine IF LEFT(TheLine,1)=";" THEN LEAVE IdNumber=IdNumber+1 Identifier.IdNumber=Word(TheLine,1) IdPath.IdNumber=SearchPath.PathNumber IdMultiLang.IdNumber=MultiLang.PathNumber END IF ~(LEFT(TheLine,1)=";") THEN CALL MessageErr("Missing End-Sign ';'"CR"in Section MainPathSearch.") END IF PathNumber=0 THEN CALL MessageErr("No Path declared"CR"in MainPath section.") IF ~(LEFT(TheLine,1)="@") THEN CALL MessageErr("Missing End-Sign '@'"CR"in MainPath section.") END IF DUMMY="***** Vario" THEN DO VarPathNumber=0 DO items=1 to 48 UNTIL (OtherSearch.VarPathNumber="@" | EOF(fTMP)) CALL ReadConfigLine IF LEFT(TheLine,1)="@" THEN LEAVE VarPathNumber=VarPathNumber + 1 OtherSearch.VarPathNumber=Word(TheLine,1) END IF VarPathNumber=0 THEN CALL MessageErr("No Search-Path declared"CR"in Various Pathes section.") IF ~(LEFT(TheLine,1)="@") THEN CALL MessageErr("Missing End-Sign '@'"CR"in Section Various Pathes") END END IF ~(LEFT(DUMMY,3)="@@@") THEN CALL MessageErr("Missing Config-End Sign '@@@'") END CALL Close(fTMP) /* Get pathes of all mounted devices on system as additional pathes */ ADDRESS COMMAND 'C:info >T:DevList'ProcessNumber drop device dev=0 CALL Open(fTMP,'T:DevList'ProcessNumber,'R') DO FOREVER r=READLN(fTMP) IF EOF(fTMP) THEN LEAVE posi=POS(' [Mounted]',r) IF posi>1 THEN DO PathNumber=PathNumber+1 SearchPath.PathNumber=LEFT(r,posi-1)':Help/' MultiLang.PathNumber='' SearchScript.PathNumber='' Break.PathNumber=1 END END CALL Close(fTMP) ADDRESS COMMAND 'delete >NIL: T:DevList'ProcessNumber' FORCE QUIET' RETURN /* ---------------------- */ ReadConfigLine: TheLine='' DO UNTIL (~(LEFT(TheLine,3)='###' | TheLine='') | EOF(fTMP)) TheLine=READLN(fTMP) LineCount=LineCount + 1 END RETURN /* ---------------------- */ MessageErr: PARSE ARG Message rtText=CR''Message CR CR'... Line 'LineCount CR'in 'ConfigFile CR CR'(Perhaps, see also: EASys!_rexx:Manual.config)'CR r=rtezrequest(rtText," _Ok ",ReqTitle,ezTags) r=Close(fTMP) CALL ExitMe RETURN /* ---------------------- */ MakeDirs: PARSE ARG thisPath MakePath=Strip(ThisPath,'T','/') IF ~EXISTS(MakePath) THEN ADDRESS COMMAND 'makedir' MakePath IF NoSubDirs=0 THEN DO count=1 to LanguageNumber DestDir=thisPath''Language.count IF ~EXISTS(DestDir) THEN ADDRESS COMMAND 'makedir' DestDir END RETURN /* ---------------------- */ MyGetENV: PROCEDURE PARSE ARG name TheFile='ENV:'name IF Open(fTMP,TheFile,'read') THEN DO ENVvalue=ReadLn(fTMP) r=Close(fTMP) END ELSE ENVvalue='' RETURN ENVvalue /* ---------------------- */ GetLanguage: LanguageNumber=1 /* Presets */ Language='' IF Open(fTMP,'ENV:sys/locale.prefs','read') THEN DO DO i=1 to 50 r=READCH(fTMP) END Land='' i=0 DO UNTIL EOF(fTMP) i=i+1 Char=ReadCh(fTMP) IF C2D(Char)=0 THEN LEAVE ELSE Land=Land''Char END /* 32 characters from begin of Lang_x to begin of Lang_y */ DO j=i to 31 UNTIL EOF(fTMP) r=READCH(fTMP) END en=0 n_lang=3 DO LanguageNumber=1 to n_lang Language.LanguageNumber=ReadLanguage() IF Language.LanguageNumber='' THEN DO IF LanguageNumber>1 THEN LanguageNumber=LanguageNumber-1 LEAVE END IF Language.LanguageNumber='english' THEN en=1 END r=Close(fTMP) END IF LanguageNumber>n_lang THEN LanguageNumber=n_lang IF en=0 THEN DO LanguageNumber=LanguageNumber+1 Language.LanguageNumber='english' END Language=Language.1 drop Char drop r ADDRESS COMMAND 'setenv LANGUAGE 'Language IF ~EXISTS('EASys!_rexx:'Language'/Manual.1') THEN Language='english' RETURN /* ---------------------- */ ReadLanguage: Langua='' Langua=ReadCh(fTMP) IF C2D(Langua)=0 THEN RETURN '' i=1 DO UNTIL EOF(fTMP) i=i+1 Char=ReadCh(fTMP) IF C2D(Char)=0 THEN LEAVE ELSE Langua=Langua''Char END /* 30 characters from begin of Lang_x to begin of Lang_y */ DO j=i to 29 UNTIL EOF(fTMP) r=READCH(fTMP) END RETURN Langua /* ---------------------- */ Init: ReqTitle=MyGetEnv("DocManTitle") AppName="© TNE) Document-Manager" ReqTitle=AppName CR='0a'x CALL GetLanguage IF ~show('L','rexxreqtools.library') THEN r=ADDLIB('rexxreqtools.library',0,-30,0) IF ~show('L','rexxsupport.library') THEN r=ADDLIB('rexxsupport.library',0,-30,0) IF ~show('L','rexxMOOS.library') THEN DO r=ADDLIB('rexxMOOS.library',100,-30,0) setpubscreen('Modes Pop Sh') END MaxTitleChars=MyGetENV("RefTable/GUI-ShellTitleChars") ConsoleType=MyGetENV("RefTable/GUI-ConsoleType") ConsoleSize=MyGetENV("SHELLsize") IF ConsoleSize='' THEN ConsoleSize="40/50/600/200" ReqLE=MyGetENV("RefTable/GUI-ReqLE") /* Main Window */ ReqTE=MyGetENV("RefTable/GUI-ReqTE") ReqHeight=MyGetENV("RefTable/GUI-ReqHeight") PosTags="rt_reqpos=reqpos_topleftscr rt_leftoffset=" ReqLE " rt_topoffset=" ReqTE EZtags=PosTags GLtags=PosTags"rtgl_min=0 rtgl_max=1500 rtgl_backfill=true " GStags=PosTags" rtgs_backfill=false rtgs_width=300" POINTER_TAGS="rt_reqpos=reqpos_pointer" DIR_TAGS=PosTags" rtfi_flags=freqf_nofiles|freqf_save rtfi_height=" ReqHeight FILE_TAGS=PosTags" rtfi_flags=freqf_multiselect|freqf_selectdirs rtfi_height=" ReqHeight ONEFILE_TAG=PosTags" rtfi_height=" ReqHeight Console='>"'ConsoleType''ConsoleSize'/'AppName' Messages.../AUTO/CLOSE/WAIT"' /* --------- pathes -------- */ r=PRAGMA('DIRECTORY','T:') ConfigFile='EASys!_rexx:Manual.config' xPacker=MyGetENV("RefTable/Archive-xPack") xPackerMethod="QUIET METHOD NUKE" xPackerSize="MINSIZE 1024" EasyRequester=MyGetENV("RefTable/GUI-ReqMsg") RETURN /* ---------------------- */ ExitMe: drop ChosenFiles drop Files drop FileName drop Suffix drop Prefix drop Path drop Console ADDRESS COMMAND 'delete >NIL: ENV:'TempPath 'QUIET' r=setpubscreen('Workbench Default') EXIT 0