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
%>