A List of a String Array?

Monkey Forums/Monkey Programming/A List of a String Array?

Chroma(Posted 2013) [#1]
For some reason I can't get this working. Basically I need a List or Stack of a String Array.

Local str_array:String[2] = ["hello", "goodbye"]
Local list:List = new List
list.AddLast(str_array)


I think I need a nap...


marksibly(Posted 2013) [#2]
A few approaches...

Function Main()

	'List of String arrays...
	Local list:=New List<String[]>
	
	list.AddLast( ["Yes","No"] )
	list.AddLast( ["Ok","Cancel"] )
	
	For Local i:=Eachin list
		For Local j:=Eachin i
			Print j
		Next
	Next
	
	'Stack of StringStacks...
	Local stack:=New Stack<StringStack>
	
	stack.Push New StringStack
	stack.Top().Push "Yes"
	stack.Top().Push "No"
	stack.Push New StringStack
	stack.Top().Push "Ok"
	stack.Top().Push "Cancel"
	
	For Local i:=Eachin stack
		For Local j:=Eachin i
			Print j
		Next
	Next
End



Chroma(Posted 2013) [#3]
Much appreciated. The first one is what I was trying to do. I had a space in between the String and []. Thanks again.