Joelo
MIS
- Sep 27, 2003
- 61
I am run Win2000 server
Please could anyone tell me what I am doing wrong....I keep getting the following error message:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/maintenance/compliance/class_3D.asp, line 36
Public Default Function item ( k1,k2,k3)
-------------^
This is Code here:
<%
Class clsD3Dictionary
Private D3Dict
Private DebugFlag
' Initialize class
Private Sub Class_Initialize()
Set D3Dict = CreateObject("Scripting.Dictionary"
End Sub
' Add the key value "key" to given dictionary
Private Function addIndex(key,dict)
If Not dict.Exists(key) Then
dict.Add key, dict.Count
End if
End Function
Private Function getIndex(key,dict)
If Not dict.Exists(key) Then
dict.Add key, dict.Count
End If
getIndex = dict(key)
End Function
' Add to dictionary
Public Function Add( k1,k2,k3,v)
Dim i1,i2,i3,k
k = k1 & Chr(03) & k2 & Chr(03) & k3
If D3Dict.Exists(k) Then
D3Dict(k)= v
Else
D3Dict.Add k,v
End If
End Function
Public Default Function item ( k1,k2,k3)
Dim i1,i2,i3,k,v
k = k1 & Chr(03) & k2 & Chr(03) & k3
If D3Dict.Exists(k) Then
v=D3Dict(k)
Else
v=""
End If
Item = v
End Function
' Check if the key exists
Public Function Exists( k1,k2,k3)
Dim i1,i2,i3,k,v
k = k1 & Chr(03) & k2 & Chr(03) & k3
Exists = D3Dict.Exists(k)
End Function
' data inferred with key and key number
Public Function Keys(k1,n)
Dim v,ky
keys = D3Dict.Keys
For Each key In Keys
v = Null
ky = split(key,chr(03))
If isArray(ky) Then
If n = 1 Then
v = ky(0)
ElseIf ky(0) = k1 Then
if n = 2 And Ubound(ky) >= 2 Then
v = ky(1)
Else
If n = 3 And Ubound(ky) >= 2 Then
v = ky(2)
End If
End If
End If
End If
If Not IsNull(v) And Instr(1,kx & Chr(03), v & Chr(03),1) <= 0 Then
If kx <> "" Then kx = kx & Chr(03)
kx = kx & v
End If
Next
Keys = Split(kx, Chr(03))
End Function
End Class
%>
Please could anyone tell me what I am doing wrong....I keep getting the following error message:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/maintenance/compliance/class_3D.asp, line 36
Public Default Function item ( k1,k2,k3)
-------------^
This is Code here:
<%
Class clsD3Dictionary
Private D3Dict
Private DebugFlag
' Initialize class
Private Sub Class_Initialize()
Set D3Dict = CreateObject("Scripting.Dictionary"
End Sub
' Add the key value "key" to given dictionary
Private Function addIndex(key,dict)
If Not dict.Exists(key) Then
dict.Add key, dict.Count
End if
End Function
Private Function getIndex(key,dict)
If Not dict.Exists(key) Then
dict.Add key, dict.Count
End If
getIndex = dict(key)
End Function
' Add to dictionary
Public Function Add( k1,k2,k3,v)
Dim i1,i2,i3,k
k = k1 & Chr(03) & k2 & Chr(03) & k3
If D3Dict.Exists(k) Then
D3Dict(k)= v
Else
D3Dict.Add k,v
End If
End Function
Public Default Function item ( k1,k2,k3)
Dim i1,i2,i3,k,v
k = k1 & Chr(03) & k2 & Chr(03) & k3
If D3Dict.Exists(k) Then
v=D3Dict(k)
Else
v=""
End If
Item = v
End Function
' Check if the key exists
Public Function Exists( k1,k2,k3)
Dim i1,i2,i3,k,v
k = k1 & Chr(03) & k2 & Chr(03) & k3
Exists = D3Dict.Exists(k)
End Function
' data inferred with key and key number
Public Function Keys(k1,n)
Dim v,ky
keys = D3Dict.Keys
For Each key In Keys
v = Null
ky = split(key,chr(03))
If isArray(ky) Then
If n = 1 Then
v = ky(0)
ElseIf ky(0) = k1 Then
if n = 2 And Ubound(ky) >= 2 Then
v = ky(1)
Else
If n = 3 And Ubound(ky) >= 2 Then
v = ky(2)
End If
End If
End If
End If
If Not IsNull(v) And Instr(1,kx & Chr(03), v & Chr(03),1) <= 0 Then
If kx <> "" Then kx = kx & Chr(03)
kx = kx & v
End If
Next
Keys = Split(kx, Chr(03))
End Function
End Class
%>