Stop torturing the man. I did the same mistake a few days ago. I was staring my monitor 30 seconds before I realized what is wrong. :D For a beginner is a perfectly understandable mistake.100% agree.
@Molly why not givving the right answer with an example?Because it's too easy. If one needs to do some brushing up like in this case, reading is the way to go, which can be done very comfortably using internet where you can find answers within minutes. If a compiler complains, finding out why on your own is the best way to understand that compiler, so you won't make that mistake again.
@Molly why not givving the right answer with an example?
I am not sure I needed the parenthesisNot in this case, but it's easy to check this for yourself, isn't it..? :)
How exactly did you get the copy and pate to come from the IDE like that?The usual way:
Form1.Color := clBlack;Try
In this case the color always stays at defaultYes, of course, you set the Color to clDefault outside the CASE statement and at the end of the procedure, so the last thing the procedure does is setting the DEFAULT color....
@ molly and everyoneYes, i was aware that you already had your face-palm moment before i even wrote that post.
I did get it. Even before I saw the sample code posted here.
It was right there in front of me, I just couldn't see it.
Just in case you were interested this is what gave me the clue as to what I was doing wrong.tbh i thought the first clue from Bazzao was a much better one, but in the end it only matters what works for you (e.g. if it can work as a reminder for you)
"Colonize (add a colon to) assignments and decolonize (remove colon from) expressions."
When I start with a new language (it wasn't all that long ago that I started with Pascal relatively speaking) I usually get a book or reference guide showing me the basics
And coming from BASIC-like languages I had to make the same mistake several times before it really sank in.
This topic was essentially unnecessary IF the OP would have taken the time to figure out the basics. Instead he jumped at the forum to get a quick answer.
Yes dude, if one knows how to find its way to the forum, then assuming that one knows how to use google as a start, isn't being unrealistic.QuoteWhen I start with a new language (it wasn't all that long ago that I started with Pascal relatively speaking) I usually get a book or reference guide showing me the basics
Good for you. Are you assuming that OP knows how to access and how to find these resources?QuoteAnd coming from BASIC-like languages I had to make the same mistake several times before it really sank in.
You should not assume that because it was hard for you that it must be for others too.QuoteThis topic was essentially unnecessary IF the OP would have taken the time to figure out the basics. Instead he jumped at the forum to get a quick answer.
You were assuming OP had a bad attitude and you are assuming that he thought this forum is a way to get a "quick answer". Sorry dude, I think you are assuming too much.
Colonize (add a colon to) assignments and decolonize (remove colon from) expressions.didn't actually give what I would call a quick answer. I apologize that I don't remember your name. A quick answer in my opinion would have been to post corrected syntax of the 'if' statements.