Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.GetResponse
Retrieves and Checks a multiple line IMAP4 server response.

function GetResponse(const ATag: String; const AAllowedResponses: array of SmallInt): SmallInt; overload;
function GetResponse(const AAllowedResponses: array of SmallInt): SmallInt; overload;
Parameters
const AAllowedResponses: array of SmallInt
Array of allowed server response codes.

Returns
SmallInt - Response code from the server.

Description
GetResponse is an overloaded SmallInt function in TIdIMAP4 that retrieves one or more IMAP4 server response lines, and determines the response code based on the tagged or untagged response content. Untagged response codes, indicated by "*" in the initial position of the response, always set the return value to True. Otherwise, the command tag name in ATag is expected in the server response, and the return value is based on the presence of "OK", "NO", or "BAD" in the response line.

GetResponse clears the contents of CmdResultDetails prior to retreiving a response from the server using the ReadLnWait method, and adding the line to CmdResultDetails.

When the response line is an untagged server response, GetResponse will continue to read response lines until the tagged response containing the ATag value is received. If a tagged response is received that does not match ATag, an EIdException will be raised. The ResultNo property is set to the value determined by examing the reponse line.

GetResponse calls the inherited CheckResponse method, and sets the return value to the ResultNo from CheckResponse.