Anyway I've done what you ask manually before. Make a function called SaveType and output each field properly. The loop through your array and call the function for each item in the array. The make a LoadType function too. simple, just a bit time consuming depending on how many fields you've got.