home *** CD-ROM | disk | FTP | other *** search
- /* $VER: GoFetchRexx.rexx 1.1 (28.10.94)
- **
- ** ARexx script to invoke FetchRefs from Shell (using rx).
- */
-
- /* Set some options of ARexx */
- OPTIONS RESULTS
- OPTIONS FAILAT 21
-
- /* Get the search strings */
- PARSE ARG function
-
- /* 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:'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 FILEREF CASE
-
- /* Address editor again to load the file */
- ADDRESS VALUE caller
-
- IF rc ~= 0 THEN DO
- /* Skip if the error was '.....!'. This occours whenever the 'select
- * from what file' window is closed, which is not really an error, so
- * I don't want it reported.
- */
- IF RIGHT(rc2, 1) = '!' THEN
- EXIT 0
-
- /* Report the error (obtained from FetchRefs) */
- say RC2
-
- /* Return */
- EXIT 0
- END
- ELSE DO
- /* Print the reference */
- ADDRESS COMMAND 'Type' filename
-
- /* Delete the temporary file */
- ADDRESS COMMAND 'Run >NIL: C:Delete >NIL:' filename
-
- /* Return */
- EXIT 0
- END
-
-