home *** CD-ROM | disk | FTP | other *** search
- /* $VER: GoFetchRexx.dme 1.1 (28.10.94)
- **
- ** ARexx script for DME to invoke FetchRefs.
- */
-
- /* Static part of the editor's ARexx port name. That is, the name before any
- * suffixes (like '.1') are appended.
- */
- editorname = 'DME'
-
- OPTIONS RESULTS
- OPTIONS FAILAT 11
-
- /* Quit if we're not called from the editor. */
- caller = ADDRESS()
- IF (LEFT(caller, LENGTH(editorname)) ~= editorname) then
- EXIT 10
-
- /* Get the function name from editor (get current word). */
- "scanf '%[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_#?]s'"
- "setenv func $scanf"
-
- ok = OPEN('Env', 'ENV:func')
- function = READLN('Env')
- ok = CLOSE('Env')
- "unsetenv func"
-
- /* Define a temporary filename to put the reference into */
- cutat = VERIFY(function, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_")
- if cutat > 0 THEN
- basename = LEFT(function, cutat - 1)
- ELSE
- basename = function
-
- filename = 'T:FR_'basename
-
- /* It doesn't matter whether we want a taglist, varargs og whatever function */
- IF RIGHT(function, 7) = "TagList" THEN
- function = LEFT(function, LENGTH(function) - 7)
- ELSE IF RIGHT(function, 4) = "Tags" THEN
- function = LEFT(function, LENGTH(function) - 4)
- ELSE IF RIGHT(function, 1) = "A" THEN
- function = LEFT(function, LENGTH(function) - 1)
-
- /* Now actually get the reference */
- ADDRESS 'FETCHREFS'
- FR_GET function || '(%|Tags|TagList|A)' filename CASE FILEREF
- gotoline = rc2
-
- /* Address editor again to load the file */
- ADDRESS VALUE caller
-
- IF rc~=0 THEN DO
- /* Skip if the error was '...!' (actually 'Aborted!'). This occours
- * whenever the 'select from what file' window is closed, which is
- * not really an error.
- */
- IF RIGHT(rc2, 1)='!' THEN
- EXIT 0
-
- /* Report the error (obtained from FetchRefs) in the editor. */
- Title '('RC2')'
-
- EXIT 0
- END
- ELSE DO
- /* Make the editor open a new window and load the autodoc into it. */
- "NewWindow"
- "NewFile" filename
-
- /* If FetchRefs provided us with a goto line (it does for .h files
- * only - as it only makes sense for them) then we jump to that line.
- */
- IF gotoline ~= 0 THEN
- Goto gotoline
-
- /* Delete the autodoc file */
- ADDRESS COMMAND 'C:Delete >NIL:' filename
-
- EXIT 0
- END
-
-