String or number?
Jim Ault
JimAultWins at yahoo.com
Mon Jun 18 10:17:41 EDT 2007
Seems like a bug to me.
But if you use this form it works as expected.
> put 123456.7890 into a
> put 123456.7890 + 0 into b
split a using cr and "."
split b using cr and "."
-- or
split b using tab and "."
split b using null and "."
Jim Ault
Las Vegas
On 6/18/07 6:45 AM, "Torbjörn Nordlindh" <tn at nul.se> wrote:
>
> If I do this:
>
> put 123456.7890 into a
> put 123456.7890 + 0 into b
> split a by "."
> split b by "."
>
> The result is:
>
> a = empty
> a[1] = 123456
> a[2] = 7890
>
> Exactly what I was expectiing, but:
>
> b = 123456.7890
> b[1] = empty
> b[2] = empty
>
> I thought Revolution would convert b into a string before splitting
> it into an array.
>
> This doesn't make sense either:
>
> a is a number = false
> b is a number = true
>
> I thought a number without quotes would be interpreted as a number.
>
> Section 6.2.3 in the manual states:
> "A value is a number if it consists of digits, optional leading minus
> sign, optional decimal
> point, and optional "E" or "e" (scientific notation)"
>
> Is the manual wrong or is this a undocumented "feature"?
More information about the use-livecode
mailing list