I cant insert code, please help.....

I know this is going to be very vague, as there are many things at play, but, how do you insert code? Example: I have a simple time clock script.

if (hour >= 12)
  {
     if (hour == 12)
     {
       Serial.print(hour, DEC);
     }
     else
     {
       hour = hour - 12;
       Serial.print(hour, DEC);
     }
     Serial.print(":");
     if (minute < 10)
     {
       Serial.print("0");
       Serial.print(minute, DEC);
     }
     else
     {
       Serial.print(minute, DEC);
     }
     Serial.print(":");
     if (second < 10)

If I take the same type of code for the month/date and year, I get compiling errors that the (darn, i forget the naming) definition(?) or something like that doesnt exist, can not be found. I know it does because the same library thats used in the original date script works fine in that sketch and is included in the new sketch. I dont understand why it cant find the info in the library??

Also, is there a tutorial about when, where, why and how to use the “{ }” syntax’s? All i have read so far is that they are unstable and even the arduino program mis interprets them from time to time.

I will get you all the exact issue when I get home from work, but, I was hoping I could be directed to look at something during my lunch break.

1ArduinoFan:
this is going to be very vague

Agreed: vague in the extreme.

It is not possible for anyone to help you without at least one of, and ideally both of:

(1) the whole actual sketch you are struggling with, and
(2) the whole actual error messages given by the IDE when you build it.

is there a tutorial about when, where, why and how to use the "{ }" syntax

Thise demo about merging codes probably covers some of the things that are causing you trouble.

...R

gardner:

1ArduinoFan:
this is going to be very vague

Agreed: vague in the extreme.

It is not possible for anyone to help you without at least one of, and ideally both of:

(1) the whole actual sketch you are struggling with, and
(2) the whole actual error messages given by the IDE when you build it.

is there a tutorial about when, where, why and how to use the "{ }" syntax

http://arduino.cc/en/Reference/HomePage

Fair enough. I will post back later tonight when I get home with the actual problem.

Thanks everyone.

There is nothing "unstable" about braces '{}'.

Use them when you want to group several statements as one, or as part of a function definition.

Not sure what you're on about,

but i have noticed that you are missing a closing bracket that should have closed the first if statement.

not sure if that's because thats exactly what you wrote or you forgot to add that to your code bracket.

KeithRB:
There is nothing "unstable" about braces '{}'.

Sure about that?
Excerpt from this site "At present this feature is slightly buggy as the IDE will often find (incorrectly) a brace in text that has been "commented out."

TheTurtleKing:

It was something I just grabbed quick at work. I might have missed the end closing bracket or it could have come out of a sketch that wasn't closed any time soon. I have been through so many sketches now, I can remember what I was referring to for the example. i will have to post back when I hit that wall again with a real example.

Thanks everyone for looking, i will be back.

1ArduinoFan:
Sure about that?
Excerpt from this site "At present this feature is slightly buggy as the IDE will often find (incorrectly) a brace in text that has been “commented out.”

IIRC that’s in the section about the auto-format tool. That has nothing to do with compiling code.

Ahh, okay, fair enough, thanks.