[Gambas-user] Removing / Modifying IsXXXX() functions in Gambas3
Benoît Minisini
gambas at ...1...
Tue Nov 30 12:58:27 CET 2010
> >>> Mail.module: IF IsString(Main.GlobalVar["Minute"]) THEN
> >>> Main.GlobalVar["Minute"] = Val(Main.GlobalVar["Minute"])
> >>
> >> Just seems to be checks to see if the variant value from that collection
> >> isn't empty, to prevent errors.
> >
> > So use 'Not IsNull()' instead.
>
> I get when I do If Not IsNull(Main.GlobalVar["Minute"]) Then ....
>
> Error: Type Mismatch wanted string, got integer.
>
> Main.GlobalVar["Minute"] 's value is 34
>
> Main.GlobalVar[] is a Collection with Variants , so contains all types
> of values.
>
> Sometimes, (don't know why) Main.GlobalVar["Minute"] contained a string
> so "34" instead of an integer, then further down my program things went
> wrong, so therefor this stupid check and correction posted above was used..
>
> Regards,
> Ron_2nd.
>
Then you must do "If TypeOf(Main.GlobalVar["Minute"]) = gb.String" if you
really need a string.
Regardsn
--
Benoît Minisini
More information about the User
mailing list