Subject | Re: [IBO] IB_EditEnh. Own error handling, how ? |
---|---|
Author | Rita Lavoie |
Post date | 2000-12-14T15:41:25Z |
Monsieur Nagy,
You may try this.
There are five error messages that can be generated;
{: Validation Error Code: Insert/Replace character invalid for position.}
E_MASKENH_CHAR_INVALID = 1;
{: Validation Error Code: Input string was too long for mask.}
E_MASKENH_TRUNCATED = 2;
{: Validation Error Code: Input string does not fit mask requirements.}
E_MASKENH_INVALID = 3;
{: Validation Error Code: Input string was truncated, or some characters
ignored due to invalid mask match.}
E_MASKENH_INVALIDTRUNC = 4;
{: Validation Error Code: Insert/Replace attempted beyond end of mask.}
E_MASKENH_CHAR_TRUNCATED = 5;
If you wish to override the Exception Error Code than go as follows :
procedure TYourForm.EditZipCodeValidateError(Sender:
TObject;//ValidationError
ErrCode: Integer; var RaiseExc: Boolean);
begin
case ErrCode of
1:
begin
if (Sender = EditZipCode) then ShowMessage('Invalide ZipCode etc.');
end;
2:
3:
4:
5:
end;
RaiseExc := False;
end;
Rita
----- Message d'origine -----
De : "Sándor Nagy" <nagy.sandor@...>
À : <IBObjects@egroups.com>
Envoyé : 14 déc. 2000 05:42
Objet : [IBO] IB_EditEnh. Own error handling, how ?
You may try this.
There are five error messages that can be generated;
{: Validation Error Code: Insert/Replace character invalid for position.}
E_MASKENH_CHAR_INVALID = 1;
{: Validation Error Code: Input string was too long for mask.}
E_MASKENH_TRUNCATED = 2;
{: Validation Error Code: Input string does not fit mask requirements.}
E_MASKENH_INVALID = 3;
{: Validation Error Code: Input string was truncated, or some characters
ignored due to invalid mask match.}
E_MASKENH_INVALIDTRUNC = 4;
{: Validation Error Code: Insert/Replace attempted beyond end of mask.}
E_MASKENH_CHAR_TRUNCATED = 5;
If you wish to override the Exception Error Code than go as follows :
procedure TYourForm.EditZipCodeValidateError(Sender:
TObject;//ValidationError
ErrCode: Integer; var RaiseExc: Boolean);
begin
case ErrCode of
1:
begin
if (Sender = EditZipCode) then ShowMessage('Invalide ZipCode etc.');
end;
2:
3:
4:
5:
end;
RaiseExc := False;
end;
Rita
----- Message d'origine -----
De : "Sándor Nagy" <nagy.sandor@...>
À : <IBObjects@egroups.com>
Envoyé : 14 déc. 2000 05:42
Objet : [IBO] IB_EditEnh. Own error handling, how ?
> HI,
>
> I have a form with many fields, there are some date fields on it also.
> I can not switch off the built in error handling in the IB_EditEnh
> component. I don't want to get the English message if the filled
> date is invalid, and I have to make some other chekings (range cheks)
> on every date field.
> How can I disable the built in error handling in IB_EditEnh ?
>
> " OnValidateError -> RaiseExc := False; " doesn't works.
>
> I tried to catch the errors on the IB_Query s BeforePost event.
> I made my own error handling (try-except) code there.
> Maybe on wrong place ?
>
> Thx
>
> Alex
>
>
>
>
>