Go Down

Topic: Sequential file naming on SD card (Read 523 times) previous topic - next topic

samarkh

I'm struggling here a bit.
I want to write a fresh file each time the SD card is inserted.
e.g.
data0.csv
data1.csv
data2.csv

so I thought that something like
count++
fileName="data" & count & ".csv"
could work.
but this approach looks to be rubbish.
What is the correct approach?
Yours Simon M.

PaulS

Quote
so I thought that something like
count++
fileName="data" & count & ".csv"
could work.
but this approach looks to be rubbish.
What is the correct approach?

The correct approach is to use code that stands a chance of working. No matter what type fileName is, the & operator is not the correct one to use.

Of course, you should be able to see from this comment that we don't know what type fileName is, so any help in getting a variable encoded in the variable is going to be vague.

If you'd read the sticky, you'd know that the requirement for posting here is to post your code (properly).


Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview