[Gambas-user] Val function changed behaviour, porting gambas2 to gambas3
Richard Welch
richardpa608 at ...626...
Wed Nov 2 16:18:17 CET 2016
This is just noting the change in case it might help someone else - not
a plea for a change.
In g2, the Val function would ignore that part of its input string after
the first space, so that, for instance Val("12 3 5") would return the
integer value 12.
Here and there, I use this feature when parsing a string into discrete
numbers.
Converting to g3 (specifically g3.8.2) this no longer works as before;
Val now returns Null on such a string.
The solution is obvious: append a space to the string (to guarantee
there is one!) and then extract up to the first space before using Val.
More information about the User
mailing list