Methods and keys in E!B
Methods and keys in E!B
(OP)
Hello, I was wondering if there was a way to wait for certain keys to be pressed while the macro is running. For example, while the macro is running, is it possible to wait for a key to be pressed, so i could exit macro, mid-run? Also, i would like to know if i can wait for two different keys at once, i have tried something, but it didnt work as well as i wanted, this is what i tried
CODE
While (K <> " " and K <> "`")
K = Sess0.Screen.WaitForKeys()
If (K <> " " and K <> "`") Then
'nothing goes here, but this way of testing only works if i put in this if statement
End If
WEnd
MsgBox F
K = Sess0.Screen.WaitForKeys()
If (K <> " " and K <> "`") Then
'nothing goes here, but this way of testing only works if i put in this if statement
End If
WEnd
MsgBox F
RE: Methods and keys in E!B
RE: Methods and keys in E!B
CODE
K = Sess.Screen.WaitForKeys()
Loop While (K <> " " and K <> "`")
Msgbox K
Exit Sub ' exits macro
Do While(1)
Loop
Functions and Subs
CODE
Declare Sub Wait() ' Sub Prototype
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) ' Sleep API
GLOBAL Sys as Object
GLOBAL Sess as Object
Sub Main
Dim message as String
If Session_Open (message) <> 1 Then
Msgbox message
Exit Sub
End If
End Sub
' Function Declaration
Function Session_Open(ByRef message As String) As Integer
Dim sess_open As Integer
sess_open = 1
Set Sys = CreateObject("Extra.System")
Set Sess = Sys.ActiveSession
If Sys Is Nothing Then
message = "Could not create Extra.System...is E!PC installed on this machine?"
sess_open = 0
End If
If Sess Is Nothing Then
message = "No session available...stopping macro playback."
sess_open = 0
End If
Session_Open = sess_open
End Function
' Sub Declaration
Sub Wait()
Do While Sess.Screen.OIA.Xstatus <> 0
DoEvents
Loop
End Sub
Note, if you declare your subs and functions before Sub Main, you don't need the prototypes.
RE: Methods and keys in E!B