home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / utilities / hypertext / adtoht / rexx / autodoc.ced next >
Encoding:
Text File  |  1994-06-22  |  1.6 KB  |  53 lines

  1. /* AREXX-script for CygnusEd. Displays the autodoc entry for
  2.    the function the cursor is on.
  3.    Version 1.1, written 30.04.93 by Christian Stieber
  4.    This script is placed in the public domain.                */
  5.  
  6. /* Change this to reflect your system */
  7.  
  8. /* Name of the crossreference file */
  9. CrossReferenceFile='man:AutoDocs/.autodoc.xref'
  10.  
  11. /* The AmigaGuide executable */
  12. AmigaGuide='SYS:Utilities/AmigaGuide'
  13.  
  14. /* The name of the screen to open the AmigaGuide window on */
  15. PubScreenName='"`Work:MoreCommands/GetPubName`"'
  16.  
  17.  
  18. /****************************************************************************/
  19.  
  20. options results
  21. status 55   /* get current line */
  22. Name=Result
  23. status 87   /* get cursor column */
  24. x=Result+1
  25. do while x>0   /* find beginning of word */
  26.    Char=upper(substr(Name,x,1))
  27.    if ~((Char>='A' & Char<='Z') | (Char>='0' & Char<='9') | (Char='_') | (Char='.')) then break
  28.    x=x-1
  29. end
  30. Name=delstr(Name,1,x)   /* delete everything in front of the word */
  31. x=1
  32. do forever   /* find end of word */
  33.    Char=upper(substr(Name,x,1))
  34.    if ~((Char>='A' & Char<='Z') | (Char>='0' & Char<='9') | (Char='_')) then break
  35.    x=x+1
  36. end
  37. Name=delstr(Name,x)   /* delete everything after the word */
  38. if (Name~='')
  39.    then do
  40.       if ~show('l','amigaguide.library') then call addlib('amigaguide.library',0,-30)
  41.       Dummy=LoadXRef(CrossReferenceFile)
  42.       Node=GetXRef(Name)
  43.       if Node~=10
  44.          then do
  45.             parse VAR Node . DataBase Type Line
  46.             address 'COMMAND' 'run >NIL:' AmigaGuide DataBase 'DOCUMENT' Name 'PUBSCREEN' PubScreenName 'REQUESTER'
  47.          end
  48.          else do
  49.             okay1 'No information on "'Name'"'
  50.          end
  51.    end
  52. exit 0
  53.