home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
e
/
epmmac2.zip
/
KWHELP.E
< prev
next >
Wrap
Text File
|
1992-08-18
|
3KB
|
112 lines
/* format of index file:
(Win*, view winhelp.inf ~)
(printf, view edchelp.inf printf)
*/
defc kwhelp= call pHelp_C_identifier()
defproc pHelp_C_identifier
universal helpindex_id
if not find_token(startcol, endcol) then
return
endif
identifier = substr(textline(.line), startcol, (endcol-startcol)+1)
getfileid CurrentFile /* save the ID of the current file */
if helpindex_id then
display -2
rc = 0
activatefile helpindex_id
display 2
if rc then -- File's gone?
helpindex_id = 0
endif
endif
if not helpindex_id then
helplist = Get_Env('HELPNDX')
if helplist='' then
compile if defined(KEYWORD_HELP_INDEX_FILE)
helplist = KEYWORD_HELP_INDEX_FILE
compile else
helplist = 'epmkwhlp.ndx'
compile endif
endif
ft = filetype()
savelist = helplist
do while helplist<>''
parse value helplist with helpindex '+' helplist
/* look for the help index file in current dir, EPMPATH, DPATH, and EPM.EXE's dir: */
findfile destfilename, helpindex, '','D'
if rc then
/* If that fails, try the standard path. */
findfile destfilename, helpindex, 'PATH'
if rc then
sayerror 'Help index 'helpindex' not found'
return
endif
endif
compile if EVERSION >='5.50'
if pos(' ',destfilename) then
destfilename = '"'destfilename'"'
endif
compile endif
if helpindex_id then
bottom
last = .last
'get' destfilename
line = upcase(textline(last+1))
if word(line,1)='EXTENSIONS:' & wordpos(ft, line) then -- Move to top
call psave_mark(savemark)
call pset_mark(last+1, .last, 1, MAXCOL, 'LINE', helpindex_id)
0
move_mark
call prestore_mark(savemark)
endif
else
'xcom e /d' destfilename
getfileid helpindex_id
.visible = 0
endif
enddo
helpindex_id.userstring = savelist
endif
top; .col = 1
display -2
getsearch savesearch
'xcom /('identifier',/' -- search for the exact match...
if rc then
do i = length(identifier) to 0 by -1
'xcom /('leftstr(identifier, i)'*,/'
if not rc then
leave
endif
enddo
endif
setsearch savesearch
display 2
if rc then
sayerror 'Unable to find entry for 'identifier' in 'helpindex_id.userstring'.'
else
parse value substr(textline(.line), .col) with ',' line ')'
/* substitute all occurrances of '~' with the original identifier */
loop
i = pos('~', line)
if not i then
leave
endif
line = leftstr(line, i-1)||identifier||substr(line, i+1)
endloop
if upcase(word(line,1))='VIEW' then
sayerror 'Invoking View ...'
endif
'dos 'line -- execute the command
endif
activatefile CurrentFile