|VBscript supports the functions JOIN() and SPLIT().|
JOIN takes an array and a delimiter (such as ",") and returns a delimited string which can be crammed into a MUSHclient variable with little problem
SPLIT takes a string and a delimiter and chops the string apart wherever it finds the delimiter, returning an array.
You could easily do the following:
'ArrayTest now contains "Foo:Bar:Baz:Gleep"
'I don't have to use a colon. I normally use a comma,
'but all the commas makes my example harder to read.
'You could choose a space, a tilde, the string " and ",
'or whatever you want to use to separate your array
'elements. You don't have to rigidly stick to the
Later in your script, you can get your array back like so:
For i = lbound(aArray) to Ubound(aArray)
World.Note "element " & i & " contains " & aArray(i)
Using JOIN and SPLIT to turn your arrays into strings and back means you don't have to *simulate* using arrays. You really can use actual arrays. You simply use MUSHclient variables to store the contents, and load them into arrays when you want to work with them.
If you work with multidimensional arrays, you'll have to use JOIN and SPLIT inside loops or something, and you'll use a different delimiter for each dimension. A two-dimensional array rendered as a string might look like this:
Split the string on : to get substrings. Split the substrings on , to get individual elements. Store the results in a two-dimensional array.