Wish IsNumber function

yeroen

Member
Licensed User
Longtime User
The IsNumber function returns TRUE by "1f" and "1d".
So IsNumber gives unexpected results if you are not aware of this.
Can the IsNumber function be changed in a next update?
 

Daestrum

Expert
Licensed User
Longtime User
1f and 1d are valid numbers (java syntax for 1 as a float and 1 as a double)
 

Sandman

Expert
Licensed User
Longtime User
1f and 1d are valid numbers (java syntax for 1 as a float and 1 as a double)

Counterpoint:

It's well known that Anywhere Software works hard to make B4X available for beginners and shield them (and all of its users, really) from many of the complexities with developing applications. I think it's entirely fair to assume that the current behaviour of IsNumber simply is an oversight.

Further, it can be expected that exceptionally few users have actually used values such as 1f and 1d when they've used the function in their B4X code. Thus the risk of breaking backward compatibility should be close to none.
 

Daestrum

Expert
Licensed User
Longtime User
@Sandman I don't disagree, with the addition of the "(1).As()" syntax they become obsolete.
 
Top