Bizarre List Behavior - Solved - User Error!

This simple code within an App generates a totally unexpected result.

def listStyles(){
	def list = []
	list.add("apple")"list is: ${list}")

	def list2 = []
	list2.add("apple")"list2 is: ${list2}")

	def mylist = []
	mylist.add ["one"]
	mylist.add ["apple"]"mylist is: ${mylist}")
	def thislist = []
	thislist.add ["one"]
	thislist.add ["apple"]"thislist is: ${thislist}")

Gets this output.

thislist is: []
mylist is: []
list2 is: [one, apple]
list is: [one, apple]

The conclusion is that a list[] must be named with the word list leading the name. But I've got plenty of other driver code where that is not the case.

And in case anyone asks there are no settings or state by this name.

Any comments?

1 Like

Could it be because you are using square brackets with the add on mylist and thislist? Change them to the round brackets and It should work.


I'm an idiot. I stared at that a while before posting and didn't see it. Bracket blindness must be a real thing.

Thanks from your neighbor in Minnesota.


Can't you just walk over to his house next time you don't have to bother all of us?

:wink: :rofl:


If I leave now I could be there by Thanksgiving. :turkey: :beers:


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.