home *** CD-ROM | disk | FTP | other *** search
- /* $VER: GoFetchRexx.ged 1.2 (24.2.96)
- **
- ** ARexx script to invoke FetchRefs from GoldED.
- */
-
- /* Static part of the ARexx port name of the editor. That is, the name before
- * any suffixes (like '.1') are appended.
- */
- editorname = 'GOLDED'
-
- /* Set some options of ARexx */
- OPTIONS RESULTS
- OPTIONS FAILAT 21
- SIGNAL ON SYNTAX
-
- /* Get the name of the ARexx port of the caller and return an error if it
- * is not like the 'editorname' variable above.
- */
- caller = ADDRESS()
- IF (LEFT(caller, LENGTH(editorname)) ~= editorname) THEN
- EXIT 10
-
- /* Get the current line and cursor position from the editor. */
- 'Lock Current'
- IF (rc ~= 0) THEN
- EXIT 0
- 'Query Buffer'
- line = result
- 'Query Column'
- position = result
-
- /* Isolate the actual word */
- function = line
- function = RIGHT(function, LENGTH(function) - position + 1)
- cutat = VERIFY(function, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_")
- IF cutat > 0 THEN
- function = LEFT(function, cutat - 1)
-
- /* Define a temporary filename to put the reference into */
- filename = 'T:FR_' function
-
- /* 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
- gotoline = rc2
-
- /* Address editor again to load the file */
- ADDRESS VALUE caller
-
- IF rc ~= 0 THEN DO
- /* Some kind of error happend. Report it. This may be a simple
- * "Aborted" or "No reference" message.
- */
- Request Status '"'RC2'"'
-
- /* Return to editor. */
- 'Unlock'
- EXIT 0
- END
- ELSE DO
- /* Make the editor open a new window and load the reference into it. */
- 'Open New Name' filename
-
- /* If FetchRefs provided us with a goto line then we jump to that line. */
- IF gotoline ~= 0 THEN
- 'Goto' gotoline
- 'Unlock'
-
- /* Delete the temporary file */
- ADDRESS COMMAND 'Run >NIL: C:Delete >NIL:' filename
-
- EXIT 0
- END
-
- SYNTAX:
- ADDRESS VALUE caller
- 'Unlock'
- EXIT 0
-
-