If you download IanM's matrix1utility plugin pack, it's possible to write a function to work on ANY UDT array.
First, write out the size of the array to the file (the value returned by 'array count').
Then, loop through each item in the array, and use 'get array item ptr' to get a pointer to each one. Inside this loop, have another loop which goes from 1 to the value returned by 'get array field count'.
This lets you loop through each field in the UDT of the array element. You can use 'get array field offset' for each of these fields, and add it to the item pointer found earlier. This gives you a pointer to the actual field.
Then use 'get array field type', and make a select statement to check for each type. The values returned are shown below:
0 = Integer
1 = Float
2 = String
3 = Boolean
4 = Byte
5 = Word
6 = Dword
7 = Double float
8 = Double integer
Depending on the value returned, use 'peek XXX' (XXX = the name of the data type from the above list). And pass in the field pointer. Then write out this value to the file. The only exception is if it returns '2' (string). For strings, use 'peek string(peek integer(pointer))' instead of 'peek string(pointer)'.
When you have done all that, your code will be able to save any array to a file. To read it back in do the following:
First, read in the first integer (the array size) and resize the array to that value. Then do exactly the same as before, but instead of writing to the file, read the values from the file, and instead of using 'peek XXX' use 'poke XXX'.
For strings, use 'free peek integer(pointer)' to free the old string, and then use 'poke integer pointer,alloc string(value))' to set the new value.