Page 1 of 1

Question: Save stuff to file and read the infomation?

Posted: Sun May 01, 2016 12:43 pm
by ScriptKid
Hey Guys i have a question
i Need to save informations from one micromacro to disk (like .ini files) to read out from another micromacro
a direct com with one to the other is not solving my request the data must be readable after restart from os or other reasons

have browse the wiki but not found something usefull Information

a short example for read/write data in style of .ini/hashtable is all i Need

hope you can help me
sorry for my bad english

Re: Question: Save stuff to file and read the infomation?

Posted: Sun May 01, 2016 2:06 pm
by beanybabe
you might look at this it is way to write some data.
viewtopic.php?f=27&t=6049&p=63935&hilit=log#p63935

Re: Question: Save stuff to file and read the infomation?

Posted: Sun May 01, 2016 11:25 pm
by lisa
well you have the file *****.lua and the info as a table.

inside the file would look like this

Code: Select all

return { "socks", "shoes", "hats"}
So the code to save it would be something like

Code: Select all

local file = io.open("filename.lua", "w")
file:write('return { "socks", "shoes", "hats"}')
file:close();
then you get the info from the file using include.

Code: Select all

tableinfo = {}
tableinfo  = include("filename.lua")
table.print(tableinfo)

That is the most basic way I can think of for what you said you wanted.

Question Save stuff to file and read the infomation

Posted: Mon Jan 14, 2019 3:51 pm
by WarnerDop
In the same way that Word can save an amended version of the document it has open.

Question Save stuff to file and read the infomation

Posted: Mon Jun 10, 2019 9:40 pm
by Jososyhet
How to save all the GEAR parameters to a file. So next time I can just load the gear data file.

I know how to load gear data file. But I cannot find the place/menu/button to save gear data file.

Any help will be appreciated.