File indexing completed on 2024-05-12 04:02:06

0001 <!DOCTYPE html>
0002 <html><head>
0003 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
0004 <title>highlight.asp</title>
0005 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (ASP) - Theme (Breeze Dark)"/>
0006 </head><body style="background-color:#232629;color:#cfcfc2"><pre>
0007 <span style="color:#2980b9;font-weight:bold">&lt;%</span> <span style="color:#7a7c7d">'</span><span style="color:#3f8058">kate:</span><span style="color:#7a7c7d"> </span><span style="color:#7f8c8d">hl</span><span style="color:#f44f4f"> ASP</span><span style="color:#7f8c8d">;</span>
0008 <span style="color:#fdbc4b;font-weight:bold">if</span> <span style="color:#27ae60">(</span> <span style="color:#8e44ad">instr</span><span style="color:#27ae60">(</span><span style="color:#8e44ad">request</span>.<span style="color:#8e44ad">servervariables</span><span style="color:#27ae60">(</span><span style="color:#f44f4f">"PATH_INFO"</span><span style="color:#27ae60">),</span><span style="color:#f44f4f">"login.asp"</span><span style="color:#27ae60">)</span> &lt;= <span style="color:#f67400">0</span> <span style="font-weight:bold">and</span> <span style="color:#8e44ad">instr</span><span style="color:#27ae60">(</span><span style="color:#8e44ad">request</span>.<span style="color:#8e44ad">servervariables</span><span style="color:#27ae60">(</span><span style="color:#f44f4f">"PATH_INFO"</span><span style="color:#27ae60">),</span><span style="color:#f44f4f">"inset"</span><span style="color:#27ae60">)</span> &lt;= <span style="color:#f67400">0</span> <span style="font-weight:bold">and</span> <span style="color:#8e44ad">instr</span><span style="color:#27ae60">(</span><span style="color:#8e44ad">request</span>.<span style="color:#8e44ad">servervariables</span><span style="color:#27ae60">(</span><span style="color:#f44f4f">"PATH_INFO"</span><span style="color:#27ae60">),</span><span style="color:#f44f4f">"Data"</span><span style="color:#27ae60">)</span> &lt;= <span style="color:#f67400">0</span> <span style="font-weight:bold">and</span> <span style="color:#8e44ad">instr</span><span style="color:#27ae60">(</span><span style="color:#8e44ad">request</span>.<span style="color:#8e44ad">servervariables</span><span style="color:#27ae60">(</span><span style="color:#f44f4f">"PATH_INFO"</span><span style="color:#27ae60">),</span><span style="color:#f44f4f">"dropDown"</span><span style="color:#27ae60">)</span> &lt;= <span style="color:#f67400">0</span> <span style="color:#27ae60">)</span> <span style="color:#fdbc4b;font-weight:bold">then</span>
0009     <span style="color:#8e44ad">Session</span><span style="color:#27ae60">(</span><span style="color:#f44f4f">"originalRequestedPage"</span><span style="color:#27ae60">)</span> = <span style="color:#8e44ad">Request</span>.<span style="color:#8e44ad">ServerVariables</span><span style="color:#27ae60">(</span><span style="color:#f44f4f">"PATH_INFO"</span><span style="color:#27ae60">)</span> <span style="font-weight:bold">&amp;</span> <span style="color:#f44f4f">"?"</span> <span style="font-weight:bold">&amp;</span> <span style="color:#8e44ad">Request</span>.<span style="color:#8e44ad">ServerVariables</span><span style="color:#27ae60">(</span><span style="color:#f44f4f">"QUERY_STRING"</span><span style="color:#27ae60">)</span>
0010 <span style="color:#fdbc4b;font-weight:bold">end if</span>
0011 
0012 <span style="font-weight:bold">function</span> countRecords<span style="color:#27ae60">(</span> rsToCount <span style="color:#27ae60">)</span>
0013     numRecs = <span style="color:#f67400">0</span>
0014 
0015     <span style="color:#fdbc4b;font-weight:bold">do</span> <span style="color:#fdbc4b;font-weight:bold">until</span> rsToCount.<span style="font-weight:bold">eof</span>
0016         numRecs = numRecs + <span style="color:#f67400">1</span>
0017 
0018         rsToCount.<span style="font-weight:bold">movenext</span>
0019     <span style="color:#fdbc4b;font-weight:bold">loop</span>
0020 
0021     rsToCount.<span style="font-weight:bold">close</span> <span style="color:#7a7c7d">' just to make sure nobody</span>
0022         <span style="color:#7a7c7d">' tries to operate on the recordset,</span>
0023         <span style="color:#7a7c7d">' which has already reached eof</span>
0024 
0025     countRecords = numRecs
0026 <span style="font-weight:bold">end function</span>
0027 
0028 <span style="font-weight:bold">function</span> unique<span style="color:#27ae60">(</span> rs<span style="color:#27ae60">,</span> sortColumn <span style="color:#27ae60">)</span> <span style="color:#7a7c7d">' return unique instances of text in sortColumn within rs</span>
0029     <span style="font-weight:bold">dim</span> sorted<span style="color:#27ae60">()</span>
0030 
0031     <span style="font-weight:bold">redim</span> sorted<span style="color:#27ae60">(</span><span style="color:#f67400">1</span><span style="color:#27ae60">)</span>
0032     <span style="font-weight:bold">dim</span> i
0033     i = <span style="color:#f67400">0</span>
0034     <span style="color:#fdbc4b;font-weight:bold">do</span> <span style="color:#fdbc4b;font-weight:bold">until</span> rs.<span style="font-weight:bold">eof</span>
0035         <span style="color:#fdbc4b;font-weight:bold">if</span> <span style="color:#27ae60">(</span><span style="font-weight:bold">not</span> find<span style="color:#27ae60">(</span> rs<span style="color:#27ae60">(</span>sortColumn<span style="color:#27ae60">),</span> sorted <span style="color:#27ae60">))</span> <span style="color:#fdbc4b;font-weight:bold">then</span>
0036             <span style="font-weight:bold">redim</span> <span style="font-weight:bold">preserve</span> sorted<span style="color:#27ae60">(</span>i+<span style="color:#f67400">1</span><span style="color:#27ae60">)</span>
0037             sorted<span style="color:#27ae60">(</span>i<span style="color:#27ae60">)</span> = rs<span style="color:#27ae60">(</span>sortColumn<span style="color:#27ae60">)</span>
0038             i = i + <span style="color:#f67400">1</span>
0039         <span style="color:#fdbc4b;font-weight:bold">end if</span>
0040         rs.<span style="font-weight:bold">MoveNext</span>
0041     <span style="color:#fdbc4b;font-weight:bold">loop</span>
0042 
0043     <span style="font-weight:bold">redim</span> <span style="font-weight:bold">preserve</span> sorted<span style="color:#27ae60">(</span>i-<span style="color:#f67400">1</span><span style="color:#27ae60">)</span> <span style="color:#7a7c7d">' the function will add an extra blank entry to the array</span>
0044 
0045     rs.<span style="font-weight:bold">Close</span>  <span style="color:#7a7c7d">' close the recordset - we'll be using it again - and reset i - well be using it again, too</span>
0046 
0047     unique = sorted
0048 <span style="font-weight:bold">end function</span>
0049 
0050 <span style="font-weight:bold">sub</span> testSub<span style="color:#27ae60">(</span> variable <span style="color:#27ae60">)</span> <span style="color:#7a7c7d">' do nothing impressive...</span>
0051     <span style="font-weight:bold">dim</span> newVar
0052 
0053     newVar = variable
0054 
0055     <span style="color:#fdbc4b;font-weight:bold">if</span> <span style="color:#27ae60">(</span> variable = <span style="font-weight:bold">true</span> <span style="color:#27ae60">)</span>
0056         <span style="color:#8e44ad">response</span>.<span style="color:#8e44ad">end</span>
0057     <span style="color:#fdbc4b;font-weight:bold">else</span> <span style="color:#2980b9;font-weight:bold">%></span>
0058 
0059 <span style="font-weight:bold">&lt;p></span>We are writing text.<span style="font-weight:bold">&lt;/p></span>
0060 <span style="font-weight:bold">&lt;p</span><span style="color:#27ae60"> class=</span><span style="color:#f44f4f">"stuff"</span><span style="font-weight:bold">></span><span style="color:#2980b9;font-weight:bold">&lt;%</span>=newVar<span style="color:#2980b9;font-weight:bold">%></span><span style="font-weight:bold">&lt;/p></span>
0061 <span style="font-weight:bold">&lt;p></span>We have written text and outputted a variable.<span style="font-weight:bold">&lt;/p></span>
0062 
0063 <span style="color:#2980b9;font-weight:bold">&lt;%</span>   <span style="color:#fdbc4b;font-weight:bold">end if</span>
0064 <span style="font-weight:bold">end sub</span> <span style="color:#2980b9;font-weight:bold">%></span>
0065 </pre></body></html>