Notifications
Clear all

[Closed] Text Load/Save

Hi everyone;

I have a little question but i couldnt find my answer in help document…

I’m planning to create a pose control menu to save and load poses for my character.
In this case i need to learn how can i save and load the items of a listbox as a .txt file?

Best regards…

3 Replies
 lo1
--save:
(dotnetClass "System.IO.File").writeAllLines [I]<filePathAsString> <yourListBox>[/I].items

--load:
[I]<yourListBox>[/I].items = (dotnetClass "System.IO.File").readAllLines [I]<filePathAsString>[/I]

Note that ideally you would want more error checking than this.

Thank you so much! thats really what im looking for…

but isnt there a way to save it without using dot.net commands?

 lo1

yes, look into ‘filestream’ objects in the help file. Though the code is longer.