home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
prog
/
c
/
ch134_e.lha
/
CHelp.ttx
< prev
next >
Wrap
Text File
|
1992-08-29
|
2KB
|
83 lines
/*
ARexx macro to load reference file generated by CHelp
920625: by Mikael BergLund
Could be very simple if only the GetWord command would return special
characters as '*' and '!' and so on. Oh well, could be solved anyway.
Not totally foolprof i guess. Could probably have a special variant of
this command that cannot do wildcard searches.
*/
/* Request results from our hosts */
options results
/* We don't want to see ARexx steeping about in our document, won't we? */
SetDisplayLock ON
/* Move to beginning of word */
MovePrevWord
/* Loop until we stumble upon a '(' or a ' '. Could look for several others
but these will suffice for the moment */
str = ''
do while 1 ~= 2
GetChar
c = result
if ( c ~= '(' ) & ( c ~= ' ' ) & ( c ~= '0a'x ) & ( c ~= ',' ) then
str = str||c
else
break
MoveRight
end
/* Make it upper case */
str = upper( str )
/* Get length */
l = length( str )
/* Search for TAGS string attached to end of argument. If present strip it or
CHelp won't find it */
lp = lastpos( 'TAGS', str )
if l - lp = 3 then str = delstr( str, l - 3 )
/* Remove display lock or we will have serious problems editing this
document again */
SetDisplayLock OFF
SetStatusBar 'Searching 4 'str
/* Pass argument to CHelp for it to look up */
address CHELP1 look str
/* CHelp returns all output in a file called ram:chelp.lup. No error checking
here, if this file is empty we load it anyway */
OpenDoc NAME 'ram:chelp.lup'
/* Port name of the newly opened document is returned, pick it up */
port = result
/* Set our host address to the new document... */
address VALUE port
/* ... and make it read-only */
SetReadOnly ON
/* We've done our thing so... exit. ARexx will exit this script anyway
regardless of the exit keyword or not, but for the sake of clarity */
exit