a=ItemSelect("Select Help File",strlower(KeyValues),"|")
if a=="" then goto DONE
b = FileLocate(strcat(DirHome(),"HELP\%a%"))
if b=="" then b=FileLocate(a)
if b=="" then Message("Helpfile %a% not found","Edit %TheFile%%CR%[HelpAll] section to%CR%point to help file location%CR%or put helpfile on DOS path.")
; uses the TAGS.EXE program to generate WINEDIT.MRK file
; that the next function uses to look up function names
; in your source
RunWait("TAGS.EXE","-om -tWINEDIT.MRK *.c")
Message("Tags","Processing complete")
Go to tag ; Jump to function definition
; looks up the current word in WINEDIT.MRK, loads the file,
; and moves the cursor to the correct line
;DEBUG(1)
goto START
:GETWORD
a = AskLine("Go to tag", "Enter function definition to jump to:", "")
strupper(a)
len = strlen(a)
if len==0 then goto NOWORD
goto START2
:START
a=WEdGetWord()
strupper(a)
len = strlen(a)
if len==0 then goto GETWORD
:START2
b=FileLocate("winedit.mrk")
WFileOpen(b)
WFind(a,@TRUE,@FALSE)
WEdHome()
WEdStartSel()
WEdEnd()
WEdEndSel()
WEdCopy()
WWinClose()
line=ClipGet()
line2=strupper(line)
c=StrIndex(line2,a,0,@FWDSCAN)
d=StrIndex(line2," ",c,@FWDSCAN)
e=StrIndex(line2,"(",d,@FWDSCAN)
filename=StrSub(line2,d,e-d)
lineno=StrSub(line2,e+1,strlen(line2)-e-1)
WFileOpen(filename)
WEdGoToLine(lineno)
WEdHome()
Drop(len,b,line,line2,c,d,e,filename,lineno)
:NOWORD
Drop(a)
;
Grep \ ^G ; Run fgrep
a = "fgrep.com"
b = FileLocate(strcat(DirHome(),a))
if b=="" then b=FileLocate(a)
if b=="" then Message("Error","Fgrep utility not found. You can download fgrep.com from our Web site http://www.windowware.com/wwwftp/wilson/fgrep.zip")
then goto DONE
GrepWord = wEdGetWord() ; Get Selected word if any
command = AskLine("Grep","Enter the grep commmand to run:","tee.com %b% -M %GrepWord% *.c")
wRunCommand(command,@TRUE,@TRUE)
:DONE
Drop(command,GrepWord,a,b);
;Multifile grep command. Expects to find unix-compatable grep AND gres
;commands in the path! It parses the result into an error file so that