home *** CD-ROM | disk | FTP | other *** search
- /** $VER: GetM2XRef.ged 0.1 (20. Apr. '94)
- **
- ** Written by Fin Schuppenhauer
- **
- ** Displays the definition module where the word under the cursor
- ** was defined.
- ** This script uses the cross-reference table, created by "Def2AG".
- ** If you don't have that program, you can order it at the address
- ** given below. Please include some money for my expenses. "Def2AG"
- ** may also be available in the Aminet.
- **
- ** ***
- **
- ** Zeigt das Definitionsmodul an, in dem das Wort unter dem Cursor
- ** definiert wurde.
- ** Dieses Skript arbeitet mit der von "Def2AG" erzeugten Cross-
- ** Referenz-Tabelle. Das Programm kann, wenn nicht vorhanden, für
- ** einen Unkosten-Beitrag von 10 DM an der unten angegebenen Adresse
- ** bezogen werden. "Def2AG" kann auch im Aminet verfügbar sein.
- **
- **
- ** My address/Meine Adresse:
- **
- ** Fin Schuppenhauer
- ** Brausspark 10
- ** D-20537 Hamburg
- ** (Germany)
- **
- ** E-Mail: 1schuppe@rzdspc2.informatik.uni-hamburg.de
- **
- ** This script is FREEWARE.
- **
- ** Thanks to:
- ** Dietmar Eilert for his GoldED
- ** David N. Junod (this script is based on his "getxref.ttx")
- **/
-
- OPTIONS RESULTS /* enable return codes */
-
- if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
- address 'GOLDED.1'
-
- 'LOCK CURRENT' /* lock GUI, gain access */
- OPTIONS FAILAT 6 /* ignore warnings */
- SIGNAL ON SYNTAX /* ensure clean exit */
-
-
- /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
-
-
- 'QUERY CAT'
- isGerman = (result = "deutsch")
-
- /* amigaguide.library öffnen (falls dies noch nicht geschehen ist): */
- if ~show('L','amigaguide.library') then
- if ~addlib('amigaguide.library',0,-30) then do
- if isGerman then
- 'REQUEST BODY="Keine amigaguide.library vorhanden!" BUTTON=Abbrechen'
- else
- 'REQUEST BODY="amigaguide.library not available!" BUTTON=Cancel'
- 'UNLOCK'
- EXIT
- end
-
- /* Wort unter dem Cursor ermitteln: */
- 'QUERY WORD VAR WORT'
-
- if isGerman then
- 'REQUEST BODY="Informationen laden für:" OLD='wort' STRING VAR=WORT'
- else
- 'REQUEST BODY="Loading information for:" OLD='wort' STRING VAR=WORT'
- if rc ~= 0 then do
- 'UNLOCK'
- EXIT
- end
-
- /* Autodoc cross-reference table laden, wenn noch nicht vorhanden: */
- line = GetXRef("OpenWindow")
- if line = 10 then do
- if isGerman then
- 'REQUEST STATUS="Lade Cross-Reference Datei ..."'
- else
- 'REQUEST STATUS="Loading cross-reference file ..."'
- LoadXRef(modula.xref)
- end
-
- /* Gibt es das Wort in der cross-reference-table? */
- xrefinfo = GetXRef(wort)
- if xrefinfo = 10 then do
- /** Nein, aber vielleicht soll <wort> ein Modul (also eine
- ** Main-Node bezeichnen.
- **/
- modul = 1
- database = wort
- node = 'Main'
- end
- else do
- modul = 0
- database = strip(Word(xrefinfo, 2), 'B', '"')
- node = strip(Word(xrefinfo, 1), 'B', '"')
- line = Word(xrefinfo, 4)
- end
-
- if isGerman then
- 'REQUEST STATUS="Lade ' || database || '/' || node || ' ..."'
- else
- 'REQUEST STATUS="Loading ' || database || '/' || node || ' ..."'
-
- /* Haben wir schon ein Autodoc-Fenster geöffnet? */
- if ~show('P','MODULAXREF') then do
- if modul = 0 then
- /* Hyper-Quelltext laden und auf gewünschtes Wort plazieren: */
- cmd = "run >NIL: AmigaGuide " || database || " document Modul Line " || line || " portname MODULAXREF pubscreen GOLDED.1"
- else
- /* <wort> ist vermutlich der Name eines Moduls: */
- cmd = "run >NIL: AmigaGuide "||database||" portname MODULAXREF pubscreen GOLDED.1 requester"
-
- ADDRESS COMMAND cmd
- end
- else do
- link = "Link"
-
- if modul = 0 then
- /* Hyper-Quelltext anzeigen und auf <wort> platzieren: */
- cmd = link' 'database'/Modul 'line
- else
- cmd = link' 'database'/Main'
-
- OPTIONS FAILAT 21
- ADDRESS MODULAXREF cmd
- if rc = 20 then
- if isGerman then
- 'REQUEST BODY="Keine Information für|'''function''' vorhanden." BUTTON=Ok'
- else
- 'REQUEST BODY="No information for|'''function''' available." BUTTON=Ok'
- else
- ADDRESS MODULAXREF "windowtofront"
- end
-
-
- /* ---------------------------- END OF YOUR CODE --------------------- */
-
- 'UNLOCK' /* VERY important: unlock GUI */
- EXIT
-
- SYNTAX:
-
- SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
- 'UNLOCK'
- EXIT
-
-
-