AI Object
 
Syntax
 
AI.GetStatus(Handle As Long) As AIStatus
 
Description
Returns the current status of a conversation handle. This is the method that drives the polling loop: call it repeatedly until it returns a value other than aiStatusBusy.
 
GetStatus contains an internal rate-limiter. However often the macro calls it, the object queries the server at most four times per second; surplus calls simply wait. A tight polling loop with only a DoEvents inside is therefore safe.
 
Parameter
Description
Handle
Long, a handle created with NewConversation.
 

Return values

Constant
Value
Meaning
aiStatusInvalid
0
The handle is unknown or has been closed.
aiStatusBusy
1
The question is being processed; keep polling.
aiStatusReady
2
The answer is available; read it with GetResultStr.
aiStatusError
3
Processing failed; read GetErrorCode and GetErrorMessage.
 
See Also
AskGetResultStrGetErrorMessageIsValidHandle.
Example
 
Do
    DoEvents
Loop Until AI.GetStatus(aiHnd) <> 1     ' 1 = aiStatusBusy