VBS, ASP code syntax highlighted class (1)

Source: Internet
Author: User
Tags abs date exit empty
Display | syntax <% Class cbuffer
Private objFSO, objfile, objdict
Private M_strpathtofile, M_tablebgcolor, M_starttime
Private M_endtime, M_linecount, M_intkeymin, M_intkeymax
Private M_codecolor, M_commentcolor, M_stringcolor, m_tabspaces

Private Sub Class_Initialize ()
Tablebgcolor = "White"
Codecolor = "Blue"
Commentcolor = "Green"
Stringcolor = "Gray"
Tabspaces = ""
PathToFile = ""

M_starttime = 0
M_endtime = 0
M_linecount = 0

Keymin = 2
Keymax = 8

Set objdict = server. CreateObject ("Scripting.Dictionary")
Objdict.comparemode = 1

Createkeywords

Set objFSO = server. CreateObject ("Scripting.FileSystemObject")
End Sub

Private Sub Class_Terminate ()
Set objdict = Nothing
Set objFSO = Nothing
End Sub


Public Property Let Codecolor (Incolor)
M_codecolor = "<font color=" & Incolor & "><Strong>"
End Property
Private Property Get Codecolor ()
Codecolor = M_codecolor
End Property

Public Property Let Commentcolor (Incolor)
M_commentcolor = "<font color=" & Incolor & ">"
End Property
Private Property Get Commentcolor ()
Commentcolor = M_commentcolor
End Property

Public Property Let Stringcolor (Incolor)
M_stringcolor = "<font color=" & Incolor & ">"
End Property
Private Property Get Stringcolor ()
Stringcolor = M_stringcolor
End Property

Public Property Let Tabspaces (Inspaces)
M_tabspaces = inspaces
End Property
Private Property Get Tabspaces ()
Tabspaces = m_tabspaces
End Property

Public Property Let Tablebgcolor (Incolor)
M_tablebgcolor = Incolor
End Property

Private Property Get Tablebgcolor ()
Tablebgcolor = M_tablebgcolor
End Property

Public Property Get Processingtime ()
Processingtime = Second (m_endtime-m_starttime)
End Property

Public Property Get LineCount ()
LineCount = M_linecount
End Property

Public Property Get PathToFile ()
PathToFile = M_strpathtofile
End Property
Public Property Let PathToFile (Inpath)
M_strpathtofile = Inpath
End Property

Private Property Let Keymin (Inmin)
M_intkeymin = Inmin
End Property
Private Property Get Keymin ()
Keymin = M_intkeymin
End Property
Private Property Let Keymax (Inmax)
M_intkeymax = Inmax
End Property
Private Property Get Keymax ()
Keymax = M_intkeymax
End Property

Private Sub createkeywords ()
Objdict.add "ABS", "ABS"
Objdict.add "and", "and"
Objdict.add "Array", "array"
Objdict.add "Call" and "call"
Objdict.add "CBool", "CBool"
Objdict.add "CByte", "CByte"
Objdict.add "CCur", "CCur"
Objdict.add "CDate", "CDate"
Objdict.add "CDbl", "CDbl"
Objdict.add "CInt", "CInt"
Objdict.add "Class", "Class"
Objdict.add "CLng", "CLng"
Objdict.add "Const", "const"
Objdict.add "CSng", "CSng"
Objdict.add "CStr", "CStr"
Objdict.add "Date", "date"
Objdict.add "Dim", "Dim"
Objdict.add "Do" and "do"
Objdict.add "Loop", "Loop"
Objdict.add "Empty", "empty"
Objdict.add "Eqv", "Eqv"
Objdict.add "Erase", "erase"
Objdict.add "Exit", "Exit"
Objdict.add "false", "false"
Objdict.add "fix", "fix"
Objdict.add ' for ', ' for '
Objdict.add "Next", "Next"
Objdict.add "Each" and "each"
Objdict.add "function", "function"
Objdict.add "Global", "global"
Objdict.add "If", "if"
Objdict.add "Then", "then"
Objdict.add "Else", "Else"
Objdict.add "ElseIf", "ElseIf"
Objdict.add "Imp", "IMP"
Objdict.add "Int&quo



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.