THandlerResult
THandlerResult is a record type which provides a return type for executor functions which is able to not only return error codes, but also to store additional information (data).
ErrorCode: Integer;
An errorcode which provides basic information about the return value of the executor function (was it successful or did and fail; and if it failed: what happened?). Pre-defined error codes are as follows:
HR_SUCCESSFUL
Operation was performed successfully
HR_PARAMS_INVALID
The validator function noticed invalid parameters
HR_NO_HANDLER_FOUND
No command handler could be found to deal with the given command
HR_TOO_MANY_PARAMS
The validator function noticed too many parameters
HR_TOO_LESS_PARAMS
The validator function noticed that there are not enough parameters
HR_REQUIRES_EXIT
Caused by the ExitCommandHandler; notifies the TCustomConsole.FPost_Execute function that the program should be terminated
HR_REQUIRES_STATUS_CHANGE
Notifies the TPrintableConsole.FPost_Execute function that the current state of the console should be updated. The DataFormat flag will be DF_STATUS_INFORMATION in this case and the AdditionalData field will contain a pointer to a string.
_Result: String;
Contains printable information of the ErrorCode field (p.e. "Invalid parameters"). Can be used by classes which react on a THandlerResult to print this information out onto the console.
AdditionalData: PChar;
Contains a pointer to additional data. The format of the data the pointer refers to is specified in the DataFormat field; fot the "cd" and the "cs" command, the PChar can be interpreted as a PChar.
DataFormat: Integer;
Specifies the format of the AdditionalData field. There are two pre-defined formats:
DF_NO_DATA
No additional data is returned in this result (AdditionalData is nil or can be ignored)
DF_STATUS_INFORMATION
The executor function of the Command Handler has returned a HR_REQUIRES_STATUS_CHANGE error code; the AdditionalData pointer will point to a string where the new status information is stored.