Warning, /frameworks/syntax-highlighting/autotests/folding/highlight.asp.fold is written in an unsupported language. File is not indexed.
0001 <beginfold id='1'><%</beginfold id='1'> 'kate: hl ASP; 0002 <beginfold id='2'>if</beginfold id='2'> ( 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 0003 Session("originalRequestedPage") = Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING") 0004 <endfold id='2'>end if</endfold id='2'> 0005 0006 <beginfold id='3'>function</beginfold id='3'> countRecords( rsToCount ) 0007 numRecs = 0 0008 0009 <beginfold id='4'>do</beginfold id='4'> until rsToCount.eof 0010 numRecs = numRecs + 1 0011 0012 rsToCount.movenext 0013 <endfold id='4'>loop</endfold id='4'> 0014 0015 rsToCount.close ' just to make sure nobody 0016 ' tries to operate on the recordset, 0017 ' which has already reached eof 0018 0019 countRecords = numRecs 0020 <endfold id='3'>end function</endfold id='3'> 0021 0022 <beginfold id='3'>function</beginfold id='3'> unique( rs, sortColumn ) ' return unique instances of text in sortColumn within rs 0023 dim sorted() 0024 0025 redim sorted(1) 0026 dim i 0027 i = 0 0028 <beginfold id='4'>do</beginfold id='4'> until rs.eof 0029 <beginfold id='2'>if</beginfold id='2'> (not find( rs(sortColumn), sorted )) then 0030 redim preserve sorted(i+1) 0031 sorted(i) = rs(sortColumn) 0032 i = i + 1 0033 <endfold id='2'>end if</endfold id='2'> 0034 rs.MoveNext 0035 <endfold id='4'>loop</endfold id='4'> 0036 0037 redim preserve sorted(i-1) ' the function will add an extra blank entry to the array 0038 0039 rs.Close ' close the recordset - we'll be using it again - and reset i - well be using it again, too 0040 0041 unique = sorted 0042 <endfold id='3'>end function</endfold id='3'> 0043 0044 <beginfold id='5'>sub</beginfold id='5'> testSub( variable ) ' do nothing impressive... 0045 dim newVar 0046 0047 newVar = variable 0048 0049 <beginfold id='2'>if</beginfold id='2'> ( variable = true ) 0050 response.end 0051 <endfold id='2'></endfold id='2'><beginfold id='2'>else</beginfold id='2'> <endfold id='1'>%></endfold id='1'> 0052 0053 <p>We are writing text.</p> 0054 <p class="stuff"><beginfold id='1'><%</beginfold id='1'>=newVar<endfold id='1'>%></endfold id='1'></p> 0055 <p>We have written text and outputted a variable.</p> 0056 0057 <beginfold id='1'><%</beginfold id='1'> <endfold id='2'>end if</endfold id='2'> 0058 <endfold id='5'>end sub</endfold id='5'> <endfold id='1'>%></endfold id='1'>