home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $PROJECT: HyperText-DataType-System
- **
- ** $VER: searchxref.rexx 40.2 (31.03.97)
- **
- ** $AUTHOR: Stefan Ruppert , Windthorststrasse 5 , 65439 Floersheim , GERMANY
- **
- ** $COPYRIGHT: (C) Copyright 1997 by Stefan Ruppert, All Rights Reserved!
- **
- ** $EMAIL: Stefan.Ruppert@informatik.fh-wiesbaden.de
- **
- ** $HISTORY:
- **
- ** 31.03.97 : 040.002 : added PUBSCREEN support
- ** 21.02.97 : 040.001 : initial
- **
- */
-
- /* --------------------------- needed libraries --------------------------- */
-
- Call AddLib('rexxsupport.library',0,-30,0)
- Call AddLib('rexxdossupport.library',0,-30,0)
- Call AddLib('rexxxref.library',0,-30,0)
- Call Addlib("rexxreqtools.library", 0, -30, 0)
-
- Signal On Syntax
- Parse Arg args
-
- rxport = ''
- stem.search = ''
- stem.max = 32767
- stem.pubscreen= ''
- stem.verbose = 0
- stem.prompt = 0
-
- reqtags = ''
-
- 'GETATTR OBJECT=APPLICATION FIELD=SCREEN VAR=STEM.PUBSCREEN'
-
- lang = GetEnv('LANGUAGE')
- If lang = 'deutsch' Then Do
- reqgadgets = '_Suchen|_Abbrechen'
- reqtitle = 'HTDS XRef Abfrage'
- doctitle = 'XRef Abfrage Ergebnis für : '
- End
- Else
- Do
- reqgadgets = '_Search|_Cancel'
- reqtitle = 'HTDS XRef Query'
- doctitle = 'XRef Query Result for : '
- End
-
- template = 'SEARCH,MAX/N,PUBSCREEN/K,PROMPT/S,VERBOSE/S'
-
- If ReadArgs(args,template,'STEM.') Then Do
- If stem.pubscreen ~= '' Then
- reqtags = reqtags || ' rt_pubscrname=' || stem.pubscreen
-
- If stem.search = '' | stem.prompt Then
- stem.search = RTGetString(stem.search,,reqtitle, reqgadgets, reqtags)
-
- If stem.search = '' Then
- Exit 0
-
- If stem.verbose Then
- Say 'Searching for : "' || stem.search || '"'
-
- If FindXRef(stem.search,,stem.max) Then Do
- If stem.verbose Then
- Say 'Found ' || xref.count || ' matches.'
-
- If xref.count = 1 Then
- link = MakeLink(1)
- Else
- Do
- /* try to flush old files */
- link = 'T:xref.hguide'
- i = 0
- old = 0
- Do While Exists(link)
- If old == i Then Do
- 'FLUSH DOCUMENT="' || link || '"'
- Delete(link)
- old = old + 1
- End
- Else
- Do
- i = i + 1
- link = 'T:xref' || i || '.hguide'
- End
- End
-
- If Open('fh',link,'w') Then Do
- WriteLn('fh','@hyperguide xref-query.hguide')
- WriteLn('fh','@node main "' || doctitle || '`' || stem.search || '''"')
- Do i = 1 To xref.count
- Call WriteLn('fh','@{"' || xref.i.Name || '" link "' || MakeLink(i) || '"}@{tab}')
- END
- WriteLn('fh','@endnode')
- Call Close('fh')
- End
- End
-
- If stem.verbose Then
- Say 'Link To "' || link || '"'
- 'LINK ' || link
- End
- End
-
- Exit 0
-
- MakeLink:
- xrefnumber = arg(1)
- return AddPart(xref.xrefnumber.path,AddPart(xref.xrefnumber.file,xref.xrefnumber.nodename))
-
- Syntax:
- If stem.verbose & SIGL = 52 Then
- Say 'Nothing found for : "' || stem.search || '"'
- If stem.verbose Then
- Say 'Error: ' || SIGL || ': ' || ERRORTEXT(RC)
- Exit 0
-