Hello, I have a little question about arrays on which I am quite stuck on. I have an array. #("BoxA", "BoxB") I manage to save this array in an external file, a txt file. My array in here will then look like this : BoxA,BoxB, Here now my issue. I want to reload this array back into my script, but for now I only succed to…
Hi, this should do the trick. I suggest to make a function out of it. ( -- Open the FileStream to read from disc local theFileStream = openFile "C:/test.txt" -- Initialize an empty Array to store the result local asWords = #() -- Enter a while loop that terminates once the full file has been read while ((eof theFileStream)…
Another method would be to save your array to the file like this:format "%\n" (MyArray as string) to:MyFile Then load it like this:MyArray = execute(readline MyFile)
For splitting text strings into Arrays, I usually use the character ¦ as seperator, since it never seem to be used for anything normally, and not something you would use in for example a filename. a = filterString "bibot¦Tiktika¦string1¦23¦true" print a[3] -- gives "string1"
monster : Looks like an even more simple solution for me, So if I understand well my array will be save just as it is as a string, then to load it I wont have anymore to do any loop in the file, just execute it as it is. (I will test all that very soon :] ). McGreed : those ini files looks very interesting indeed, thanks…
maxscript's text handling is a bit weak but there's no reason on earth why you couldn't do this have another look through the textstream/parsing stuff in the reference - there'll be something you can use
You could also try saving the file as a INI file instead. :) Look up INI save load in the documentation. You can make sections as well. I'm currently using INI files for storing a lot of data.