<%@ LANGUAGE="VBScript" EnableSessionState=False%> <% response.buffer=TRUE %> <% ' Win NT 4.0 IIS 3.0 ASP script to 'convert from boolean logic to ' webinator set notation ' ' routine to write a patron log is on the bottom ' ' Author: Larry Rudner, rudner#064;cua.edu ' January 19, 1997 ' vdb=Request("db") varg= Request("arg") vdisp=Request("disp") vlmt=Request("lmt") vnsz=Request("nsz") vexpa=Request("expa") vprox=Request("proximity") 'vdef=Request.form("defcmd") 'vgrsz=Request.form("grsz") 'vcmd=Request.form("cmd") 'vsuff=Request.form("suffixproc") 'vthes=Request.form("thesaurus") %><% if vlmt= "ERIC Digests (073)" then vdb="edo" ' clean up varg varg=ltrim(rtrim(varg)) varg=Replace(varg," "," ") varg=Replace( varg," )",")") varg=Replace( varg,"( ","(") varg=Replace( varg,", ",",") ' find first OR and put parens in fronT of the word i=instr(lcase(varg)," or ") while i varg=left(varg,i-1) & "%2C" & mid(varg,i+4) if mid(varg,i-1,1)=chr(34) then ' look for quote k=InstrRev(varg, chr(34),i-2) ' look for preceeding quote if k=0 then ' not there- strange k=instrRev(varg, " ", i-1) else k=instrrev(varg," ", k) end if else k=instrRev(varg, " ", i-1) end if if mid(varg,k+1,1)<>"(" then needr=-1 varg=left(varg,k) & "(" & mid(varg,k+1) i=i+1 else needr=0 end if ' %2C is at i while needr ' find end of next word or phrase, is it an OR or something else i=i+3 if mid(varg,i,1) = chr(34) then ' look for next quote k=Instr(i+1, varg, chr(34)) if k=0 then ' not there- strange k=instr(i+1,varg, " ") else k=instr(k,varg," ") end if else k=instr(i, varg, " ") end if if k=0 then k=len(varg)+1 if lcase(mid(varg,k,4))=" or " then varg=left(varg,k-1) & "%2C" & mid(varg,k+2) i=k else ' add ")" if mid(varg,k-1,1)<>")" then varg=left(varg,k-1) & ")" & mid(varg,k) needr =0 end if wend i=instr(lcase(varg)," or ") wend ' take care of AND, And, anD, and etc i=instr(lcase(varg)," and ") while i varg=left(varg,i)+ mid(varg,i+5) i=instr(lcase(varg)," and ") wend 'cmd = "db=" & vdb & "&arg=" & varg & "&proximity=" & vprox & "&defcmd=" & vdef 'cmd = cmd & "&disp=" & vdisp & "&cmd=" & vcmd & "&abs=" & vabs 'cmd = cmd & "&suffixproc=" & vsuff & "&lmt=" & vlmt & "&nsz=" & vnsz & "&asz=" & vasz cmd = "db=" & vdb & "&expa=" & vexpa & "&disp=" & vdisp & "&proximity=" & vprox cmd = cmd & "&lmt=" & vlmt & "&nsz=" & vnsz & "&arg=" & varg ' Take care of the Hex stuff c2="" for i=1 to len(cmd) c=mid(cmd,i,1) select case c case " " c="+" case chr(34) c="%22" case "(" c="%28" case ")" c="%29" case "," c="%2C" end select c2=c2 & c next %> <% if vdb="redir_inprog" then ' response.redirect "/scripts/texis.exe/scripts/sinprog?"&c2 response.redirect "/scripts/inprog/sinprog.asp?arg="&varg ' if vdb="inprog" then ' response.redirect "/scripts/texis.exe/scripts/sinprog?"&c2 else %><% response.redirect "/scripts/texis.exe/scripts/searchw4ex?"&c2 end if Response.end %>