WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Examples

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

; the tech support search engine
turl="http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web"
surl="http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsrch.web"
iurl="http://techsupt.winbatch.com/gif/"

WebOut("Content-type: text/html", 2)

DirChange("TECHSUPT\TECH SUPPORT")
orgdir=DirGet()
orglen=strlen(orgdir)


WebOut("<HTML>",1)
WebOut("<HEAD>",1)
WebOut("<TITLE>",1)
WebOut("WebBatch Search Results",1)
WebOut("</TITLE>",1)
WebOut("</HEAD>",1)
WebOut("<BODY>",1)
ParseData(WebCmdData())
if param0>0 then levxx=param1
            else levxx="xx"
level=levxx
if level=="xx" then level=""            
if param0>1 then headxx=param2
            else headxx=""                                    
heading=strreplace(headxx,"~"," ")            
keywords=strtrim(WebParamData("keywords"))
scope=WebparamData("scope")
if scope=="all"
   scopeall="CHECKED"
   scopearea=""
   scope=""
else
   scopeall=""
   scopearea="CHECKED"
endif
anyall=WebParamData("anyall")
if anyall=="all"
   aaall="CHECKED"
   aaany=""
else
   aaall=""
   aaany="CHECKED"
endif   
;matchcase=WebParamData("matchcase")
;wholeword=WebParamData("wholeword")
gosub topsy
;WebOut("Keywords %keywords% <br>",1)
;WebOut("Scope %scope% <br>",1)
;WebOut("AnyAll %anyall% <br>",1)
;WebOut("Heading %heading% <br>",1)
;WebOut("Headxx %headxx% <br>",1)
;WebOut("Level %level% <br>",1)
;WebOut("Levxx %levxx% <br>",1)
;WebOut("MatchCase %matchcase% <br>",1)
;WebOut("wholeword %wholeword % <br>",1)
gosub dosrch
gosub bottom
WebOut("</BODY>",1)
WebOut("</HTML>",1)
exit

:Hmmm
WebOut("<HTML>",1)
   WebOut("<HEAD>",1)
      WebOut("<TITLE>",1)
         WebOut(errtit,1)
      WebOut("</TITLE>",1)
   WebOut("</HEAD>",1)
   WebOut("<BODY>",1)
      WebOut(errmsg,1)
   WebOut("</BODY>",1)
WebOut("</HTML>",1)
return


:topsy
WebOut(`<IMG SRC="%iurl%gr-techsupport.GIF" BORDER="0" WIDTH="174" HEIGHT="191" HSPACE="24" VSPACE="0" ALIGN="right" ALT="Our (nearly) psychic tech support">`,1)

WebOut(`<IMG SRC="%iurl%main-logo.GIF" BORDER="0" WIDTH="348" HEIGHT="36" HSPACE="0" VSPACE="12" ALT="[logo] Wilson WindowWare"><p>`,1)     

return


:bottom
WebOut(`<HR>If you're trying to find specific info and don't know where to start, try typing some keywords into our handy Search Engine.<P>`,1)
WebOut(`<Form method=POST action="%surl%+%levxx%+%headxx%">`,1)
WebOut(`Keyword(s) to <Strong>search</Strong> for:<BR>`,1)
WebOut(`<Input TYPE="text" NAME="keywords" SIZE=60 VALUE="%keywords%"><P>`,1)
WebOut(`<Input TYPE="radio" NAME="scope" VALUE="all" %scopeall%>`,1)
WebOut(`Search in all areas<BR>`,1)
WebOut(`<Input TYPE="radio" NAME="scope" VALUE="%level%" %scopearea%>`,1)
WebOut(`Search in '%heading%'<P>`,1)
WebOut(`<Input TYPE="radio" NAME="anyall" VALUE="any" %aaany%>`,1)
WebOut(`Match <Strong>any</Strong> of the specified keywords<BR>`,1)
WebOut(`<Input TYPE="radio" NAME="anyall" VALUE="all" %aaall%>`,1)
WebOut(`Match <Strong>all</Strong> of the specified keywords<P>`,1)
;WebOut(`<Input TYPE="checkbox" NAME="matchcase" VALUE="Yes">`,1)
;WebOut(`Case-sensitive search<BR>`,1)
;WebOut(`<Input TYPE="checkbox" NAME="wholeword" VALUE="Yes">`,1)
;WebOut(`Match whole words<P>`,1)
WebOut(`<Input TYPE="submit" VALUE="Start search">`,1)
WebOut(`<Input TYPE="reset" VALUE="Reset form"><P>`,1)
WebOut(`</Form>`,1)
WebOut(`<HR>Or, if you can't find the information you want anywhere, you can try emailing <A HREF="mailto:support@windowware.com">support@windowware.com</a>`,1)
return

:dosrch
; chdir to goto desired level
if keywords==""
    WebOut("Error:  No keywords specified.  Try Again.",1)
    return
endif


headtit=""           
if scope!=""
   levc=strlen(scope)
   for x=1 to levc by 2
      a=strsub(level,x,2)
      dd=DirItemize("*.*")
      ddx=ItemExtract(a,dd,@tab)
      DirChange(ddx)
   next
endif

; da search
kc=ItemCount(keywords," ")
bb=BinaryAlloc(100000)
depth=0
sub0=""
index0=1
gosub dodadir
sub1 = DirItemize("*.*")
totdir=0
depth=1
dir1=DirGet()
numdir1 = ItemCount(sub1, @tab)
index1 = 0

while 1
If index%depth% == numdir%depth%
   drop(dir%depth%,sub%depth%,index%depth%,numdir%depth%)
   depth=depth-1
   if depth==0 then break
   continue
endif        
index%depth% = index%depth% + 1
DirChange(StrCat(dir%depth%, ItemExtract(index%depth%, sub%depth%, @tab)))
gosub dodadir
depth = depth + 1
dir%depth% = DirGet()
sub%depth% = DirItemize("*.*")
numdir%depth% = ItemCount(sub%depth%, @tab)
index%depth% = 0
endwhile
BinaryFree(bb)

return

:dodadir
fff=FileItemize("*.*")
ffc=ItemCount(fff,@tab)
for ffi=1 to ffc
   BinaryEodSet(bb,0)
   fn=ItemExtract(ffi,fff,@tab)
   BinaryRead(bb,fn)
   fndc=0
   for kci=1 to kc
      kw=ItemExtract(kci,keywords," ")
      a=BinaryIndexNC(bb,0,kw,@fwdscan)
      if a 
         fndc=fndc+1
         if anyall=="any" then break
      endif
   next
   if anyall=="all" && fndc!=kc then fndc=0
   if fndc
      charge=scope
         for xyz=1 to depth
            xxzz=index%xyz%
            if xxzz<10 then xxzzs="0%xxzz%"
                      else xxzzs=xxzz
            charge=strcat(charge,xxzzs)
         next
      if charge=="" then charge="xx"
      fnx=strreplace(fn," ","~")
      WebOut(strcat(`<A HREF="%turl%+%charge%+%fnx%">`,fn,`</a><br>`),1)
   endif
   
next

return

Article ID:   W12471
Filename:   Example Part 2 techsrch.web.txt
File Created: 2017:08:29:10:33:18
Last Updated: 2017:08:29:10:33:18