[JW Lua] Serialize data (write to/read from file)

Bart Visser bartvisser at me.com
Fri Nov 15 12:59:27 CET 2013


Hi Jari,

Thanks for pointing me in the right direction. I’ve found some lua-examples which enable me to save data to disk and read it in another file/script. This is exiting stuff.

Cheers,


Bart


Op 15 nov. 2013, om 08:07 heeft Jari Williamsson <jari.williamsson at mailbox.swipnet.se> het volgende geschreven:

> Perhaps I should mentioned this again regarding save/restore to a file: a great way to save data is to save it to a Lua file that can later be executed. That way, you just need the code to save the file, and you get a file format that's readable.
> 
> 
> Best regards,
> 
> Jari Williamsson
> 
> 
> On 2013-11-14 22:53, Jari Williamsson wrote:
>> On 2013-11-14 21:00, Bart Visser wrote:
>> 
>>> I regularly have to ‘transfer' a song from one layout into another
>>> (say if one song has to be in two different hymnbooks). Because of
>>> all the power we now have with JW Lua, I’m looking into a way to
>>> transform the layout of a score. In order to do so, I need a
>>> way to save layout-data (such as fonts, system-margins and the
>>> placements of file-info texts). Is there a way to serialize
>>> JW Lua-data (or just a Lua table) for later retrieval?
>> 
>> Somewhere in the future, I hope to have save/retrieval both to/from temp
>> memory and a preference file.
>> 
>> For now, you can use the standard io library (included in JW Lua) to
>> read/write text or binary files.
>> 
>>> I’ve installed a few rocks (luajson, luayaml), but can’t
>>> seem to use those from within JW Lua.
>> 
>> LuaRocks isn't supported at this time. I'll put that on the feature
>> suggestion list.
>> 
>> 
>> Best regards,
>> 
>> Jari Williamsson
>> 
>> 
>> _______________________________________________
>> JWLua mailing list
>> JWLua at jwmusic.nu
>> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>> 
>> 
> 
> 
> 
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu





More information about the JWLua mailing list