|
|
发表于 2008-5-29 00:01:00
|
显示全部楼层
Re: 有谁有脚本系统的调试功能的资料
给你写上一个啦~~
下面是源码和截图
Option Explicit
Dim command() As String, meCommand As String
Private Sub Command1_Click()
Dim i As Long, position As Long
Text2.Text = ""
If Text1.Text = "" Then
Text2.Text = Text2.Text & "没有输入脚本" & Chr(13) & Chr(10)
Else
command = Split(Text1.Text, Chr(13) & Chr(10))
For i = 0 To UBound(command)
If command(i) <> "" Then
position = InStr(command(i), "(")
If position < 1 Then
Text2.Text = Text2.Text & "没有指令符 错误在第" & (i + 1) & "行上" & Chr(13) & Chr(10)
Else
meCommand = Left(command(i), position - 1)
command(i) = Right(command(i), Len(command(i)) - position)
position = InStr(command(i), ")")
If position < 1 Then
Text2.Text = Text2.Text & "没有右边)括号 错误在第" & (i + 1) & "行上" & Chr(13) & Chr(10)
Else
If meCommand <> "print" Then
Text2.Text = Text2.Text & "未知的脚本指令 错误在第" & (i + 1) & "行上" & Chr(13) & Chr(10)
Else
Text2.Text = Text2.Text & Left(command(i), Len(command(i)) - 1) & Chr(13) & Chr(10)
End If
End If
End If
End If
Next i
End If
End Sub
|
-
|