2011-05-22 42 views
1

我已經習慣了ClassicVB/VB.Net,但不VBScript和從應用程序調用腳本的時候在下面,我得到一個錯誤:UDT在VBScript中:「錯誤:預期標識符」

# $language = "VBScript" 
# $interface = "1.0" 

'Microsoft VBScript compilation error 
'Error: Expected identifier 
Public Type MyType 
    Caption As String 
    Dir As String 
End Type 

Sub Main 
    'Whatever 
End Sub 

我已經搜索了樣本,但沒有發現上述問題。

謝謝。


編輯:問題通過使用散列/字典代替解決:

Set hash = CreateObject ("Scripting.Dictionary") 

hash.add "MyDir", "cd /usr/src/mydir" 
hash.add "Linux", "cd /usr/src/linux" 

keys = hash.Keys 
for index = 0 to hash.Count - 1 
    Set tab = crt.session.ConnectInTab("/s 192.168.0.3") 
    tab.Caption = Keys(index) 
    Set tabscreen = tab.Screen 
    tabscreen.Send hash.item(Keys(index)) & vbcr 
Next 

回答