home *** CD-ROM | disk | FTP | other *** search
- /* $VER: DICEHelp 1.0 (25.5.95) Doguet Emmanuel
- **
- ** DICEHelp help system for GoldED
- **
- ** ARexx script by Doguet Emmanuel
- */
- OPTIONS RESULTS
-
- /* Datas */
- hostname = address()
- portname = 'DICEHELP'
- tempname = 't:DICEHelp.temp'
- Title = 'DICEHelp'
-
- 'LOCK CURRENT' /* Lock GUI, gain access */
- OPTIONS FAILAT 10 /* ignore warnings */
-
- /* We take the current word */
- 'QUERY WORD VAR MOT'
-
- /* If no word, we enter it ? */
- if MOT='' then do
- 'REQUEST TITLE='Title' BODY="Enter expression to search:" STRING'
- IF RC=5 THEN DO
- 'UNLOCK'
- EXIT
- END
- MOT = result
- end
-
- /* We search the port of DICE HELP */
- if ~show('p',portname) then do
- address COMMAND 'RUN >NIL: <NIL: DCC:BIN/DICEHelp REXXSTARTUP'
-
- do i = 1 to 6
- if ~show('p',portname) then do
- address COMMAND 'wait 1'
- end
- end
-
- if ~show('p',portname) then do
- 'REQUEST BODY="DICEHelp program not found!"'
- 'UNLOCK'
- exit
- end
- end
-
- /* We have the port of DICE HELP */
- address VALUE portname
-
- /* We send the command to DICE Help for search... */
- T MOT
-
- /* GoldED port become the current port */
- address VALUE hostname
-
- IF RC=0 THEN DO
- if WORD( RESULT, 1) = 'E' THEN /* If DICE Help return an error */
- DO
- 'REQUEST TITLE='Title' BODY="Item '"'"MOT"'"' not found!"'
- END
- ELSE DO
- 'OPEN NEW t:DICEHelp.temp'
- 'WINDOW ARRANGE 0'
- END
- END
-
- ELSE
- IF RC=1 THEN do
- 'REQUEST TITLE='Title' BODY="Not found !"'
- END
- ELSE do
- 'REQUEST TITLE='Title' BODY="Error code: 'RC'."'
- END
-
- address value hostname
- 'UNLOCK'
-
- EXIT
- /* End of script */
-
-
-
- SYNTAX:
-
- SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
- address value hostname
- 'UNLOCK'
- EXIT
-