Inconsistent Behavior of Lists
Dan Shafer
revdan at danshafer.com
Wed Sep 15 12:15:10 EDT 2004
OK, I think I've uncovered an anomaly in the way Rev handles/parses
list items that cost me about four hours of work last night. I want to
confirm that: (a) I'm right; and (b) this is a bug before I go any
further.
Here's a recipe that demonstrates the anomaly. Create a card with three
fields and a button. Put this script into the button:
on mouseUp
put field 1 into list1
put field 2 into list2
put item 2 of list1 into temp
put item 2 of list2 into temp1
put temp && len(temp) into field 3
put return & temp1 && len(temp1) after field 3
end mouseUp
In field 1, put this list:
a="1",b="2",c="3"
In field 2, put the same list, but separate the elements by spaces:
a="1", b="2", c="3"
(I used fields for the test so I could try different formats; you
probably get the same results from stuffing lists into the variables
directly, but that's not relevant in my situaton anyway.)
Now run the script.
You'll see that in parsing the script in field 2, Rev takes the space
between the comma and the first value in the name-value pair as
significant. This should not be the case based on my long experience
with lists in other languages. That is, the two lists in the two fields
above should parse identically.
No?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Revolutionary
Author of "Revolution: Software at the Speed of Thought"
http://www.revolutionpros.com for more info
Available at Runtime Revolution Store (http://www.runrev.com/RevPress)
More information about the use-livecode
mailing list