Writing to SD Card

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
ahmedkhalid
Posts: 28
Joined: Mon May 26, 2014 8:51 pm
Has thanked: 4 times

Writing to SD Card

Post by ahmedkhalid »

Hello Everyone!!
Sorry I am here to disturb you guys again :). I want to know how I can move to next line of a text editor file using SD/FAT functions?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Writing to SD Card

Post by Benj »

Hello,

You would do something like this.

Initialise
OpenFile("file.txt")
LineString = ReadStringFromFile(MaxLength, '\n')

The ReadStringFromFile function will then populate the LineString variable with a line of data read from the file terminating at a new line character.

ahmedkhalid
Posts: 28
Joined: Mon May 26, 2014 8:51 pm
Has thanked: 4 times

Re: Writing to SD Card

Post by ahmedkhalid »

Well Thanks for the response! But in my case I have to write into the text file and after writing few bytes I have to move to the next line. How I can do that?

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: Writing to SD Card

Post by kersing »

To move to the next line for a Windows editor write the string "\r\n" (or the characters '\r' and '\n') at the end of your line.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

ahmedkhalid
Posts: 28
Joined: Mon May 26, 2014 8:51 pm
Has thanked: 4 times

Re: Writing to SD Card

Post by ahmedkhalid »

Plus one more thing, how can I create a file and write on it simultaneously? Like I created a file and after opening it tried to write something but when the program was executed, during its first execution only a file was created and nothing get written, but when the program was executed again then I was able to write onto the file. So How can I do both the tasks in a single execution cycle? I hope you get my question! :)

Post Reply