home *** CD-ROM | disk | FTP | other *** search
-
- /*
- ** $VER: AutoDocHelp.edge 1.3 (Sunday 08-Aug-93 02:28:27)
- **
- ** Get autodoc help on the function currently under the cursor.
- **
- ** NOTE: this script assumes that you have autodocs in amigaguide format and
- ** that the amigaguide PATH environment variable is correctly set so
- ** the autodocs can be found.
- **
- ** Written by Thomas liljetoft, based on GetXRef by David N. Junod
- */
-
-
- options results
-
- /* get name of the screen we're on */
- 'getenvvar' _ge_screenname
- screenname = result
-
- /* load amigaguide.library if not loaded */
- if ~show('l','amigaguide.library') then
- call addlib('amigaguide.library',0,-30,33)
-
- /* get word under the cursor */
- 'position' eow
- 'cursor' right 1
- 'copy' word back rb
- func = result
-
- if func = '0a'X | func = '09'X then /* no word under cursor */
- do
- requeststring title '"Help on what?"'
- if RC ~= 0 then exit(rc)
- func = result
- end
-
- /* load the Autodoc cross-reference if not loaded */
- retval = getxref("insert()")
- if retval = 10 then
- do
- 'windowtitle' '"Loading Autodoc cross-reference table..."'
- call loadxref(autodoc.xref)
- end
-
- /* try to find the function in the cross-reference table */
- retval = getxref(func"()")
- if retval = 10 then
- do
- retval = getxref(func) /* may be it's not a function */
- if retval = 10 then
- do
- 'beepscreen'
- 'windowtitle' '"'"Sorry, no help available on '"func"'."'"'
- exit(10)
- end
- end
- else func = func||"()"
-
- 'windowtitle' '"'"Loading "func"..."'"'
-
- /* find out what version of amigaguide we're using */
- address command 'version >nil: amigaguide.library version 39'
-
- parse var retval '"'node'" "'base'" 'type' 'line
-
- if RC = 0 then
- do
- call shownode(screenname,base,node,line,0)
- end
- else
- do
- /* if we're allready running, don't start a new amigaguide */
- if ~show('p','AUTODOCS') then
- address command "run >nil: amigaguide document "func" line "line" portname AUTODOCS pubscreen "screenname
- else
- do
- address autodocs "link "func" line "line
- address autodocs "windowtofront"
- end
- end
-
- exit(0)
-