[Gambas-user] Replace (Internal) Error Message

Benoit Minisini benoit.minisini at gambas-basic.org
Thu May 25 12:22:53 CEST 2023


Le 23/05/2023 à 13:26, Hans Lehmann a écrit :
> Hello.
> 
> When I use the following procedure:
> 
> Public Sub dcFlowername_Validate(Value As Variant)
> 
>       If IsNull(Value) Then
>      '-- Message.Warning(Subst("&1<br>&2<b> &3 </b>&4", ("No flower name 
> was entered!"), ("The data set is"), ("not"), ("saved!")))
>      '-- An *internal* error message is displayed!
>          Return
>       Endif
> 
> End
> 
> the same meaningless error message "Invalid value" is always displayed.
> 
> Is there a way to replace this internal error message with a meaningful 
> error message of my own?
> 
> With kind regards
> 
> Hans
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

Hi,

Commit 
https://gitlab.com/gambas/gambas/-/commit/d5910b61411eeeb8552163b290756a98be47ce4e 
should fulfill your needs:

DataSource now raises an 'Invalid' event when the value entered for a 
specific field is invalid.

The event handler takes the name of the invalid field as argument.

If that event is stopped, the default warning message is not displayed.

Regards,

-- 
Benoît Minisini.



More information about the User mailing list