[Gambas-user] isNull()

Benoît Minisini gambas at ...1...
Thu Nov 25 00:31:42 CET 2010


> I use IsNull extensively, is that going to be removed?
> 
> richard
> 

No. I use it extensively too.

Here is the result of my thought:

- You can know the datatype of a variant with the TypeOf() function. You don't 
have to use the current IsXXXX() functions.

- But you often need to know if a string can be converted to a number, an 
integer, a float, a date.

- You normally want to know that for localized strings get from the outside 
(i.e. the user). For non-localized strings, they are intern to your program, 
so you should know what you are doing.

So:

	IsNull(x) -> kept its behaviour.
	IsInteger(x) -> If Val(x) returns an integer
	IsFloat(x) -> If Val(x) returns a float
	IsDate(x) -> If Val(x) returns a date

They should be enough. But I could add:

	IsLong(x) -> If Val(x) returns a Long
	IsSingle(x) -> If Single(x) returns a Single.

Regards,

-- 
Benoît Minisini




More information about the User mailing list