我正在使用函数 send() ,我想知道除了期望它要采取的行动之外,是否有任何方法可以确认它是否有效。
下面是指示我如何利用函数 send 发送数组中保存的指令的代码。
Switch $ch
Case "A"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[1])
;$myvar = $userconfigasarray[1]
Send("{"& $userconfigasarray[1] &"}")
MsgBox (0, "SEND STATUS", "SEND HAS BEEN CALLED")
;Exit
Case "B"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[2])
$myvar = $userconfigasarray[2]
;send("{LEFT}")
send("{"& $myvar &"}")
Case "C"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[3])
$myvar = $userconfigasarray[3]
send("{"& $myvar &"}")
Case "D"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[4])
$myvar = $userconfigasarray[4]
send("{"& $myvar &"}")
Case "E"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[5])
$myvar = $userconfigasarray[5]
send("{"& $myvar &"}")
Case "F"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[6])
$myvar = $userconfigasarray[6]
send("{"& $myvar &"}")
;loggit("SEND STATUS - SEND HAS BEEN CALLED")
Case "G"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[7])
$myvar = $userconfigasarray[7]
send("{"& $myvar &"}")
Case "H"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[8])
$myvar = $userconfigasarray[8]
send("{"& $myvar &"}")
Case "1"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[9])
$myvar = $userconfigasarray[9]
send("{"& $myvar &"}")
Case "2"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[10])
$myvar = $userconfigasarray[10]
send("{"& $myvar &"}")
Case "3"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[11])
$myvar = $userconfigasarray[11]
send("{"& $myvar &"}")
Case "4"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[12])
$myvar = $userconfigasarray[12]
send("{"& $myvar &"}")
Case "5"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[13])
$myvar = $userconfigasarray[13]
Send("{"& $myvar &"}")
Case "6"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[14])
$myvar = $userconfigasarray[14]
send("{"& $myvar &"}")
Case "7"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[15])
$myvar = $userconfigasarray[15]
send("{"& $myvar &"}")
Case "8"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[16])
$myvar = $userconfigasarray[16]
send("{"& $myvar &"}")
Case "9"
MsgBox (0, "SWITCH STATEMENT", $userconfigasarray[17])
$myvar = $userconfigasarray[17]
send("{"& $myvar &"}")
Case Else
MsgBox (0, "SWITCH STATEMENT", "Can't handle '" & $ch & "' <0x" & Hex(Asc($ch), 2) & ">")
;loggit("Can't handle '" & $ch & "' <0x" & Hex(Asc($ch), 2) & ">")
EndSwitch
我可以确认指令的正确语法保存在数组中,准备通过函数 send() 发送,即
- $userconfigasarray[1] 持有 ESCAPE
- $userconfigasarray[2] 持有 APPSKEY 等
谢谢。