|
The QMRespond() function responds to a request for input from a command executed on the server.
The function arguments are:
| Response | is the response to be sent. |
| Err | is an integer variable to receive status information. This argument is not present in all variants of the QMClient API. |
This function may only be used when an immediately preceding QMExecute() or QMRespond() function has returned a status of SV_PROMPT.
The QMRespond() function returns the given Response to the input request from the server command. Further output from this command is returned as a text string. If the command does not produce any output, the C API returns a null pointer.
If the command completes without requesting input, the Err variable is set to SV_OK.
If the command requests further input, any output up to that point is returned and the Err variable is set to SV_PROMPT. The client may respond to this using the QMRespond() function or abort the command using the QMEndCommand() function.
char * QMRespond(char * Cmnd, int * Err)
S = QMExecute("RUN MYPROG", &Err);
while(Err == SV_PROMPT)
{
...Process returned value and get new Response...
QMFree(S);
S = QMRespond(Response, &Err);
}
...Process final response...
Note that the returned string pointer from both QMExecute() and QMRespond() points to dynamically allocated memory that must be released using QMFree() when no longer required.
|
QMRespond(ByVal Cmnd as String, ByRef Err as Integer) as String
S = QMExecute("RUN MYPROG", Err)
While Err = SV_PROMPT
...Process returned value and get new Response...
S = QMRespond(Response, Err)
End While
...Process final response...
|
Respond(Cmnd, Err)
S = session->Execute("RUN MYPROG", Err)
loop
while Err = SV$PROMPT
...Process returned value and get new Response...
S = session->Respond("RUN MYPROG", Err)
repeat
...Process final response...
|
String Respond(String Cmnd)
S = QMExecute("RUN MYPROG");
while(qm.ServerError == SV_PROMPT)
{
...Process returned value and get new Response...
S = qm.Respond(Response);
}
...Process final response...
|
Respond(Cmnd)
S, Err = qm.Execute("RUN MYPROG")
while(qm.ServerError == SV$PROMPT):
...Process returned value and get new Response...
S, Err = qm.Respond(Response)
...Process final response...
|
|