void nullObjectException(RexxThreadContext *c, CSTRING name, size_t pos) { char buffer[256]; if ( pos == 0 ) { _snprintf(buffer, RXITEMCOUNT(buffer), "The %s object must not be null", name); } else { _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d, the %s object, must not be null", pos, name); } userDefinedMsgException(c, buffer); }
void wrongObjInArrayException(RexxThreadContext *c, size_t argPos, size_t index, CSTRING obj, RexxObjectPtr actual) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Index %d of the array, argument %d, must be %s; found \"%s\"", index, argPos, obj, c->ObjectToStringValue(actual)); userDefinedMsgException(c, buffer); }
oodControl_t control2controlType(HWND hControl) { oodControl_t type = winUnknown; TCHAR buf[64]; if ( RealGetWindowClass(hControl, buf, RXITEMCOUNT(buf)) ) { type = winName2controlType(buf); if ( type == winPushButton ) { BUTTONTYPE buttonType = getButtonInfo(hControl, NULL, NULL); if ( buttonType == check ) { type = winCheckBox; } else if ( buttonType == radio ) { type = winRadioButton; } else if ( buttonType == group ) { type = winGroupBox; } } } return type; }
/** * Argument <argPos> must be a whole number greater than <min>; found <actual> * * Argument 10 must be a whole number greater than 5; found 0 * * Raises 88.900 * * @param c Thread context we are executing in. * @param pos Argumet position * @param min Minimum - 1 * @param actual Actual Rexx object */ void numberTooSmallException(RexxThreadContext *c, int pos, int min, RexxObjectPtr actual) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d must be a whole number greater than %d; actual %s", pos, min, c->ObjectToStringValue(actual)); userDefinedMsgException(c, buffer); }
/** * Argument <argPos> must be less than <len> characters in length; length is * <realLen> * * Argument 2 must be less than 255 characters in length; length is 260 * * Raises 88.900 * * @param c Thread context we are executing in. * @param pos Argumet position * @param len Fixed length * @param realLen Actual length */ void stringTooLongException(RexxThreadContext *c, int pos, size_t len, size_t realLen) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d must be less than %d characters in length; length is %d", pos, len, realLen); userDefinedMsgException(c, buffer); }
/** * Argument 'argument' is not a valid'msg' * * Argument 3 is not a valid menu handle * * Raises 88.900 * * @param c Thread context we are executing in. * @param pos Argumet position * @param msg "Some message" * * @note There is no space after 'valid' the caller must provide it in msg if * it is needed */ RexxObjectPtr invalidTypeException(RexxThreadContext *c, size_t pos, const char *type) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d is not a valid%s", pos, type); userDefinedMsgException(c, buffer); return NULLOBJECT; }
void wrongObjInDirectoryException(RexxThreadContext *c, int argPos, CSTRING index, CSTRING needed, RexxObjectPtr actual) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Index, %s, of argument %d, must be %s; found \"%s\"", index, argPos, needed, c->ObjectToStringValue(actual)); userDefinedMsgException(c, buffer); }
/** * Index, <index>, of argument <pos> <msg>; found "<actual>" * * Index, PART, of argument 1 must contain one or more of the keywords calendar, * next, prev, or none; found "today" * * @param c * @param pos * @param index * @param list * @param actual * * @return RexxObjectPtr */ void directoryIndexException(RexxThreadContext *c, size_t pos, CSTRING index, CSTRING msg, RexxObjectPtr actual) { char buffer[512]; _snprintf(buffer, RXITEMCOUNT(buffer), "Index, %s, of argument %d, must be one of %s; found \"%s\"", index, pos, msg, c->ObjectToStringValue(actual)); userDefinedMsgException(c, buffer); }
/** * Argument <argPos> must be true or false; found "<actual>" * * Argument 5 must be true or fals; found "an Array" * * Similar to: * * 88.904 * Argument argument must be zero or a positive whole number; found "value" * * Raises 88.900 * * @param c Thread context we are executing in. * @param pos Argumet position * @param actual Actual Rexx object */ RexxObjectPtr notBooleanException(RexxThreadContext *c, size_t pos, RexxObjectPtr actual) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d must be true or false; found \"%s\"", pos, c->ObjectToStringValue(actual)); userDefinedMsgException(c, buffer); return NULLOBJECT; }
void missingIndexInDirectoryException(RexxThreadContext *c, int argPos, CSTRING index) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Index, %s, of argument %d, is required", index, argPos); userDefinedMsgException(c, buffer); }
/** * Similar to 93.915 and 93.914 (actually a combination of the two.) * * Method argument <pos>, option must be one of <list>; found "<actual>" * * Method argument 2 must be one of [P]artially, or [E]ntirely; found "G" * * @param c * @param pos * @param list * @param actual * * @return RexxObjectPtr */ RexxObjectPtr wrongArgOptionException(RexxThreadContext *c, size_t pos, CSTRING list, CSTRING actual) { char buffer[512]; _snprintf(buffer, RXITEMCOUNT(buffer), "Method argument %d, option must be one of %s; found \"%s\"", pos, list, actual); userDefinedMsgException(c, buffer); return NULLOBJECT; }
/** * Error 98.900 * * Produces a message: * * Could not retrieve the "value" information for "object" * * Could not retrive the window handle information for a PlainBaseDialog object. * * similar to old 98.921 * * @param c Method context we are operating in. * @param item What was to be retrieved * @param source The object it was being retrieved from. */ void failedToRetrieveException(RexxThreadContext *c, CSTRING item, RexxObjectPtr source) { char buf[128]; RexxObjectPtr name = c->SendMessage0(source, "OBJECTNAME"); _snprintf(buf, RXITEMCOUNT(buf), "Could not retrieve the %s information for %s", item, c->ObjectToStringValue(name)); c->RaiseException1(Rexx_Error_Execution_user_defined, c->String(buf)); }
void systemServiceException(RexxThreadContext *context, char *msg, const char *sub) { if ( sub != NULL ) { char buffer[128]; _snprintf(buffer, RXITEMCOUNT(buffer), msg, sub); systemServiceException(context, buffer); } else { systemServiceException(context, msg); } }
/** * Determine if a dialog control belongs to the specified dialog control class. * * @param hControl Handle to the control. * @param control One of the oodControl types specifying the class to check * for. * * @return True if the dialog control is the type specified, otherwise false. */ bool isControlMatch(HWND hControl, oodControl_t control) { rxcharT buf[64]; const rxcharT *pClass = controlType2winName(control); if ( ! RealGetWindowClass(hControl, buf, RXITEMCOUNT(buf)) || _tcscmp(buf, pClass) != 0 ) { return false; } if ( control == winCheckBox || control == winRadioButton || control == winGroupBox ) { BUTTONTYPE type = getButtonInfo(hControl, NULL, NULL); switch ( control ) { case winCheckBox : if ( type != check ) { return false; } break; case winRadioButton : if ( type != radio ) { return false; } break; case winGroupBox : if ( type != group ) { return false; } break; } } return true; }
/** * Argument 'argument' 'message' * * Argument 2 must be a whole number greater than 100; actual 100.5 * * Raises 88.900 * * @param *c Thread context we are executing in. * @param pos Argument position. * @param msg "Some message" */ void userDefinedMsgException(RexxThreadContext *c, int pos, CSTRING msg) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d %s", pos, msg); userDefinedMsgException(c, buffer); }
/** * Some kind of %d message * * The number of property sheet dialogs being concurrently created has reached * the maximum (5) allowed. * * Raises 88.900 * * @param *c Thread context we are executing in. * @param formatStr Format string with 1 %d contained in it. * @param number Replacement arg. */ void userDefinedMsgException(RexxThreadContext *c, CSTRING formatStr, int number) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), formatStr, number); userDefinedMsgException(c, buffer); }
void invalidImageException(RexxThreadContext *c, size_t pos, CSTRING type, CSTRING actual) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d must be a %s image; found %s", pos, type, actual); userDefinedMsgException(c, buffer); }
void sparseArrayException(RexxThreadContext *c, size_t argPos, size_t index) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d must be a non-sparse array, index %d is missing", argPos, index); userDefinedMsgException(c, buffer); }
void emptyArrayException(RexxThreadContext *c, int argPos) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Argument %d must be a non-empty array", argPos); userDefinedMsgException(c, buffer); }
/** * Method argument 'argument' 'message' * * Method argument 2 is not a handle * * Raises 93.900 * * @param c Method context we are executing in. * @param msg "Some message" */ void userDefinedMsgException(RexxMethodContext *c, size_t pos, CSTRING msg) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Method argument %d %s", pos, msg); userDefinedMsgException(c, buffer); }
void systemServiceExceptionComCode(RexxThreadContext *context, const char *msg, const char *arg1, HRESULT hr) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), msg, arg1, hr); systemServiceException(context, buffer); }
void wrongObjInArrayException(RexxThreadContext *c, size_t argPos, size_t index, CSTRING obj) { char buffer[256]; _snprintf(buffer, RXITEMCOUNT(buffer), "Index %d of the array, argument %d, must be %s", index, argPos, obj); userDefinedMsgException(c, buffer); }