Pages: 1 [2]   Go Down
Author Topic: Reading integers from SD card  (Read 2150 times)
0 Members and 1 Guest are viewing this topic.
Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 98
Posts: 4813
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's okay as it is but good practice says that when it's possible to get an error you really should check for and handle it even if the handling is to stop the program.

I see wayyyyy too little error trapping in most of the code here, it's all written as if it's going to work right and be used right every time. By the time something wrong is noticed you might have a nice set of symptoms to have to fixing what ain't broke, a great way to add bugs to code. But that's not the worst. Worse is when the program doesn't appear to behave wrong and has people trusting bad output as good.

I'm only putting this out so the beginners can get an idea of why to trap errors without having to find out completely the hard way. Completely because no matter how you try not to, you will find ways to be wro---errrr---end up with bugs if you write much non-trivial code.  smiley-grin
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

Offline Offline
Newbie
*
Karma: 0
Posts: 22
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Dan! That works just how i want.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

See this code - I can't index the file name, is this even possible?

I'm not sure what you mean by 'index the file name', or in what respect the sketch fails to do it.

index filename means 001.txt, 002.txt......etc
Logged

Pages: 1 [2]   Go Up
Jump to: