Help: About Text Files

Hello guys,

I just want to ask if there are tutorials or post regarding the text files?

I want to know if how can I make may saved text go directly to the next line? because on the the documentation, it only save the text in a linear way.

because I’m planning to create a configurations file wherein all my config will be saved on the text file and later use them for conditional statements.

Thank in advance

Jam

Put a newline character at the end of each line (\n).

But if you’re wanting to save values, perhaps storing them in a table and using JSON (json.encode() ) to convert the table to as string will do what you want.  Then you read the JSON string back in and use json.decode() to turn it back into a Lua Table.

See this blog post:

http://omnigeek.robmiracle.com/2012/02/23/need-to-save-your-game-data-in-corona-sdk-check-out-this-little-bit-of-code/

Thanks for the reply Bob!! :slight_smile:

Your blog post saves me! thank you very much

Put a newline character at the end of each line (\n).

But if you’re wanting to save values, perhaps storing them in a table and using JSON (json.encode() ) to convert the table to as string will do what you want.  Then you read the JSON string back in and use json.decode() to turn it back into a Lua Table.

See this blog post:

http://omnigeek.robmiracle.com/2012/02/23/need-to-save-your-game-data-in-corona-sdk-check-out-this-little-bit-of-code/

Thanks for the reply Bob!! :slight_smile:

Your blog post saves me! thank you very much