Guest: may I first suggest that you make an account? It will only take a moment, and then I'll know for sure that I helped you out, and you'll know when there are updates to this and other threads you post in.
To answer your question, there are many ways you could set this up.
To do exactly what you're asking for you could use one of these methods:
Make a delimited list and use SA_ConvertDelimited:
Code:
array := SA_ConvertDelimited("8,1500|9,3000|1,1500|3,1500|7,1500", "|,")
Push it manually:
Code:
array := SA_Set(array, SA_Set(SA_Set("", 8), 1500))
array := SA_Set(array, SA_Set(SA_Set("", 9), 3000))
array := SA_Set(array, SA_Set(SA_Set("", 1), 1500))
array := SA_Set(array, SA_Set(SA_Set("", 3), 1500))
array := SA_Set(array, SA_Set(SA_Set("", 7), 1500))
I have a suggestion though. Based on the information you gave, you might want to use the index
as the seat number, like this:
Code:
array := SA_Set(array, 1500, 8)
array := SA_Set(array, 3000, 9)
array := SA_Set(array, 1500, 1)
array := SA_Set(array, 1500, 3)
array := SA_Set(array, 1500, 7)
; it automatically allocates blank elements if you set an element past the end of the array
This way whenever you want to see the number of chips seat number X has, just do something like this:
Code:
chips := SA_Get(array, 8) ;gets the number of chips of seat number 8