home *** CD-ROM | disk | FTP | other *** search
- /* Autodoc Function Finder II */
-
- /* Notes:
- 1. We need to make sure that the autodoc we want is not already loaded.
- If it is, then we can just go to it.
- */
-
- OPTIONS RESULTS
-
- 'GetWord'
-
- /* Note: from here on down, both FindAutoDoc.ttx and FindAutoDocWord.ttx
- are identical.
- */
-
- if (RC > 0) then do
- exit
- end
- funcname = result
-
- hostname = address()
- portname = 'Index Finder'
-
- if ~show('p',portname) then do
- address COMMAND 'RUN >NIL: <NIL: FindDoc s:autodocs.index s:includes.index'
-
- do i = 1 to 8
- if ~show('p',portname) then do
- address COMMAND 'wait 1'
- end
- end
-
- if ~show('p',portname) then do
- 'SetStatusBar "Index Finder port not found!"'
- quit
- end
- end
-
- address value portname
- 'find ('funcname')'
- if ~RC then do
- entries = result
-
- address value hostname
-
- if LENGTH(entries) <= 0 then do
- 'SetStatusBar "Not Found!"'
- exit /* if a NULL line, the do nothing... */
- end
-
- Parse var entries '"' docfile '"' docline . entries
-
- docname = docfile
- lastslash = lastpos(":",docname)
- if lastslash > 0 then do
- docname = substr(docname,lastslash+1)
- end
- lastslash = LastPos("/",docname)
- if lastslash > 0 then do
- docname = substr(docname,lastslash+1)
- end
-
- GetPort name docname
- fileport = RESULT
-
- if (RC > 0) then do /* If the source file was not found... */
- OpenDoc name docfile
- fileport = RESULT /* get the port */
- if RC > 0 then do /* if not there, then error */
- 'SetStatusBar "Error: error opening doc file."'
- address command "Wait 6"
- exit
- end
- end
-
- address value fileport
- IconifyWindow OFF
- Window2front
- ActivateWindow
- MoveEOF
- Move docline 0
- exit
- end
- else do
- address value hostname
- 'SetStatusBar "Error: Index Finder Error"'
- end
-