String or number?

Torbjörn Nordlindh tn at nul.se
Mon Jun 18 09:45:01 EDT 2007


Hi all!

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"?

Torbjörn






More information about the use-livecode mailing list