VBS, ASP code syntax highlighted class (II)

Source: Internet
Author: User
Tags error handling
Show | Grammar <!--#include file= "token.asp"-->
<% ' *************************************************************************
' This are all test/example code showing the calling syntax of the
' Cbuffer class ... the interface to the Cbuffer object are quite simple.
'
' Use it for reference ... delete it ... whatever.
' *************************************************************************

REM This was a REM type comment just for testing purposes!

' This variable would hold an instance of the Cbuffer class
Dim Objbuffer

' Set up the ' error handling
On Error Resume Next

' Create the instance of the ' Cbuffer class
Set Objbuffer = New cbuffer

' Set the PathToFile property of the Cbuffer class
'
' Just for kicks we'll use the ASP file that we created
' In the last installment of this article series for testing purposes
Objbuffer.pathtofile = ".. /081899/random.asp "' This is the filename.

' Here's ' an example of the how to add a new keyword to the keyword array
' You could add a list of your own function names, variables or whatever...cool!
' Note:you can add different HTML formatting if you like, the <strong>
' attribute would applied to all keywords ... ' is likely to change
' In the near future.
'
' Objbuffer.addkeyword ' Response.Write ', ' <font color=red>response.write</font> '

' Here are examples of changing the table background color, code color,
' Comment color, string color and tab space properties
'
' Objbuffer.tablebgcolor = ' lightgrey ' or
' Objbuffer.tablebgcolor = ' #ffffdd ' simple right?
' Objbuffer.codecolor = ' Red '
' Objbuffer.commentcolor = ' Orange '
' Objbuffer.stringcolor = ' Purple '
' Objbuffer.tabspaces = ' "

' Call the Parsefile method of the ' Cbuffer class, pass it true if you want the
' HTML contained in ' page output or False if you don ' t
Objbuffer.parsefile False ' NOTE: The Response.Write of the display code is already in class. Here's how to call the method.




' Check for errors, have been raised and write them out
If err.number <> 0 Then
Response.Write Err.Number & ": & Err.Description &": & Err.Source & "<br>"
End If

' Output the processing time and number of lines processed by the script
Response.Write "<strong>processing time:</strong>" & Objbuffer.processingtime & "Seconds<br > "
Response.Write "<strong>lines processed:</strong>" & Objbuffer.linecount & "<br>"

' Destroy The instance of our Cbuffer class
Set Objbuffer = Nothing
%>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.