-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScriptRT.cls
61 lines (51 loc) · 1.5 KB
/
ScriptRT.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ScriptRT"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public SC As Object
Private Sub Class_Initialize()
Set SC = New MSScriptControl.ScriptControl
End Sub
Public Function CheckSyntax(ResCode As String) As String
On Error GoTo ERRT
CheckSyntax = ""
Dim a As New ScriptRT
a.SetScriptLanguage "VBS"
a.SC.ExecuteStatement ResCode
Exit Function
ERRT:
CheckSyntax = a.SC.Error.Number & " ' " & a.SC.Error.Description & vbCrLf & "错误出现在第" & a.SC.Error.Line & "poi行、" & vbCrLf & vbCrLf & " 再出错就poi掉你= =、"
End Function
Public Sub SetScriptLanguage(Script_Name As String)
SC.Language = Script_Name
End Sub
Public Sub AddCode(Function_ As String)
Debug.Print Function_
SC.AddCode Function_