Debian Codegraph @

autotests/input/highlight.asp

raw
1 <% 'kate: hl ASP;
2 if ( instr(request.servervariables("PATH_INFO"),"login.asp") <= 0 and instr(request.servervariables("PATH_INFO"),"inset") <= 0 and instr(request.servervariables("PATH_INFO"),"Data") <= 0 and instr(request.servervariables("PATH_INFO"),"dropDown") <= 0 ) then
3 Session("originalRequestedPage") = Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")
4 end if
5
6 function countRecords( rsToCount )
7 numRecs = 0
8
9 do until rsToCount.eof
10 numRecs = numRecs + 1
11
12 rsToCount.movenext
13 loop
14
15 rsToCount.close ' just to make sure nobody
16 ' tries to operate on the recordset,
17 ' which has already reached eof
18
19 countRecords = numRecs
20 end function
21
22 function unique( rs, sortColumn ) ' return unique instances of text in sortColumn within rs
23 dim sorted()
24
25 redim sorted(1)
26 dim i
27 i = 0
28 do until rs.eof
29 if (not find( rs(sortColumn), sorted )) then
30 redim preserve sorted(i+1)
31 sorted(i) = rs(sortColumn)
32 i = i + 1
33 end if
34 rs.MoveNext
35 loop
36
37 redim preserve sorted(i-1) ' the function will add an extra blank entry to the array
38
39 rs.Close ' close the recordset - we'll be using it again - and reset i - well be using it again, too
40
41 unique = sorted
42 end function
43
44 sub testSub( variable ) ' do nothing impressive...
45 dim newVar
46
47 newVar = variable
48
49 if ( variable = true )
50 response.end
51 else %>
52
53 <p>We are writing text.</p>
54 <p class="stuff"><%=newVar%></p>
55 <p>We have written text and outputted a variable.</p>
56
57 <% end if
58 end sub %>