The first word is the key (eg. dispel magic) the second word is the value (eg. 15) and so on, until the list of keys/values is exhausted.
It is an error if the number of keys/values is not even (that is, there should be one value for each key).
The list may be the empty string, in which case nothing is imported.
You may import on top of an existing array (ie. add to it). The new values are slotted in with the existing values. If the new values have the same key as existing values the existing values are overwritten. The return value from this function tells you if this happens.
You specify the delimiter (eg. a comma) so that you can use different delimiters if you want to. If you want to use the delimiter inside the key or value data, then you must precede it (escape it) with a backslash. Also, if you want to have backslashes in the keys or values, use a double-backslash.
The delimiter is optional, and defaults to the "," character.
As an optional extension you can supply a Lua table as the second argument,
instead of a delimited string. (In this case there is no third argument).
eg.
t = {
['dispel magic'] = 15,
dragonskin = 45,
['galvanic whip'] = 30
}
ArrayImport ("spells", t)
This effectively lets you import into Lua tables with ArrayImport, and then
export later on with ArrayList.
Returns
eBadArrayName: Name cannot be empty
eArrayDoesNotExist: Array does not exist
eArrayNotEvenNumberOfValues: There is not an even number of keys/values
eImportedWithDuplicates: Imported successfully, however there were duplicates which were overwritten
eCannotImport: The data to be imported contains the "escaped delimiter" sequence, and there is no unused character (eg. hex 01) to temporarily convert it to internally for importing purposes.