Debian Codegraph @

autotests/html/highlight.asp.dark.html

raw
1 <!DOCTYPE html>
2 <html><head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <title>highlight.asp</title>
5 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (ASP) - Theme (Breeze Dark)"/>
6 </head><body style="background-color:#232629;color:#cfcfc2"><pre>
7 <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>
8 <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;">&quot;PATH_INFO&quot;</span><span style="color:#27ae60;">),</span><span style="color:#f44f4f;">&quot;login.asp&quot;</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;">&quot;PATH_INFO&quot;</span><span style="color:#27ae60;">),</span><span style="color:#f44f4f;">&quot;inset&quot;</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;">&quot;PATH_INFO&quot;</span><span style="color:#27ae60;">),</span><span style="color:#f44f4f;">&quot;Data&quot;</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;">&quot;PATH_INFO&quot;</span><span style="color:#27ae60;">),</span><span style="color:#f44f4f;">&quot;dropDown&quot;</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>
9 <span style="color:#8e44ad;">Session</span><span style="color:#27ae60;">(</span><span style="color:#f44f4f;">&quot;originalRequestedPage&quot;</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;">&quot;PATH_INFO&quot;</span><span style="color:#27ae60;">)</span> <span style="font-weight:bold;">&amp;</span> <span style="color:#f44f4f;">&quot;?&quot;</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;">&quot;QUERY_STRING&quot;</span><span style="color:#27ae60;">)</span>
10 <span style="color:#fdbc4b;font-weight:bold;">end if</span>
11
12 <span style="font-weight:bold;">function</span> countRecords<span style="color:#27ae60;">(</span> rsToCount <span style="color:#27ae60;">)</span>
13 numRecs = <span style="color:#f67400;">0</span>
14
15 <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>
16 numRecs = numRecs + <span style="color:#f67400;">1</span>
17
18 rsToCount.<span style="font-weight:bold;">movenext</span>
19 <span style="color:#fdbc4b;font-weight:bold;">loop</span>
20
21 rsToCount.<span style="font-weight:bold;">close</span> <span style="color:#7a7c7d;">' just to make sure nobody</span>
22 <span style="color:#7a7c7d;">' tries to operate on the recordset,</span>
23 <span style="color:#7a7c7d;">' which has already reached eof</span>
24
25 countRecords = numRecs
26 <span style="font-weight:bold;">end function</span>
27
28 <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>
29 <span style="font-weight:bold;">dim</span> sorted<span style="color:#27ae60;">()</span>
30
31 <span style="font-weight:bold;">redim</span> sorted<span style="color:#27ae60;">(</span><span style="color:#f67400;">1</span><span style="color:#27ae60;">)</span>
32 <span style="font-weight:bold;">dim</span> i
33 i = <span style="color:#f67400;">0</span>
34 <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>
35 <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>
36 <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>
37 sorted<span style="color:#27ae60;">(</span>i<span style="color:#27ae60;">)</span> = rs<span style="color:#27ae60;">(</span>sortColumn<span style="color:#27ae60;">)</span>
38 i = i + <span style="color:#f67400;">1</span>
39 <span style="color:#fdbc4b;font-weight:bold;">end if</span>
40 rs.<span style="font-weight:bold;">MoveNext</span>
41 <span style="color:#fdbc4b;font-weight:bold;">loop</span>
42
43 <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>
44
45 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>
46
47 unique = sorted
48 <span style="font-weight:bold;">end function</span>
49
50 <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>
51 <span style="font-weight:bold;">dim</span> newVar
52
53 newVar = variable
54
55 <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>
56 <span style="color:#8e44ad;">response</span>.<span style="color:#8e44ad;">end</span>
57 <span style="color:#fdbc4b;font-weight:bold;">else</span> <span style="color:#2980b9;font-weight:bold;">%&gt;</span>
58
59 <span style="font-weight:bold;">&lt;p&gt;</span>We are writing text.<span style="font-weight:bold;">&lt;/p&gt;</span>
60 <span style="font-weight:bold;">&lt;p</span><span style="color:#27ae60;"> class=</span><span style="color:#f44f4f;">&quot;stuff&quot;</span><span style="font-weight:bold;">&gt;</span><span style="color:#2980b9;font-weight:bold;">&lt;%</span>=newVar<span style="color:#2980b9;font-weight:bold;">%&gt;</span><span style="font-weight:bold;">&lt;/p&gt;</span>
61 <span style="font-weight:bold;">&lt;p&gt;</span>We have written text and outputted a variable.<span style="font-weight:bold;">&lt;/p&gt;</span>
62
63 <span style="color:#2980b9;font-weight:bold;">&lt;%</span> <span style="color:#fdbc4b;font-weight:bold;">end if</span>
64 <span style="font-weight:bold;">end sub</span> <span style="color:#2980b9;font-weight:bold;">%&gt;</span>
65 </pre></body></html>