Im working on a game in Silver Creator that uses Arrays. I can't get the arrays to work. When I use a string array it says that string arrays are not supported. Also I was wondering how to use the data from the array once it is set. And I would like to know how to let a variable decide what piece of data is selected. And final if you have some example code of arrays being used properly that would be good. Thanks.
EDIT: Here is how I use arrays in SilverCreator v2.0b3.1
// ARRAY
DIM arrayOne(5)
DIM stringArray$(3)
// SET THE VALUE
LET arrayOne(1) = 7
LET stringArray$(1) = "Silver Creator Rocks"
// VIEW ARRAY VALUE
PRINT STR$(arrayOne(1))
PRINT stringArray$(1)
Ah! You must use the unofficial latest SilverCreator release. I've attached it to this post.
Here we go:
DIM myArray$(0) //Create the array
//Now fill it with greatness
APPENDARRAY myArray$, "We're no strangers to love"
APPENDARRAY myArray$, "You know the rules and so do I"
APPENDARRAY myArray$, "A full commitment's what I'm thinking of"
APPENDARRAY myArray$, "You wouldn't get this from any other guy"
APPENDARRAY myArray$, " "
APPENDARRAY myArray$, "I just wanna tell you how I'm feeling"
APPENDARRAY myArray$, "Gotta make you understand"
APPENDARRAY myArray$, " "
APPENDARRAY myArray$, "Never gonna give you up"
APPENDARRAY myArray$, "Never gonna let you down"
APPENDARRAY myArray$, "Never gonna let you down, Never gonna run around and desert you"
APPENDARRAY myArray$, "Never gonna make you cry"
APPENDARRAY myArray$, "Never gonna say goodbye"
APPENDARRAY myArray$, "Never gonna tell a lie and hurt you"
//Now loop over what's in it
FOR i = 1 to COUNTARRAY(myArray$)
//Print off the greatness
PRINT STR$(i) + " " + myArray$(i)
NEXT
//Cheat sheet
// - DIM myArray$(0) // Creates a string array with 0 items
// - COUNTARRAY(myArray$) : Gets the length of the array
// - myArray$(i) : Gets the stuff out of the array as index i
// - APPENDARRAY myArray$, "Stuff" : Adds a string into the array
// - STR$(i) : Converts a number to a string
// Hint: $ at the end of the variable means it is a string variable
Hope that satisfied what you need! And welcome to the GMG! ;D