Go Down

Topic: Equality operators don't work in "for" loops (Read 1 time) previous topic - next topic

AWOL

#5
Jul 16, 2012, 03:32 pm Last Edit: Jul 16, 2012, 03:49 pm by AWOL Reason: 1
Quote
Normally, you'd expect the middle bit of "for" loops to mean "until".

There's nothing "normal" about that expectation.

Quote
(it's hard to search for "for" in the forum...)?

I wouldn't expect to find documentation on language constructs in the forum, I'd look at the reference pages over at the main site.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Grumpy_Mike

Quote
Normally, you'd expect the middle bit of "for" loops to mean "until".

I don't think that the C language can be held responsible for you assumptions.

Quote
It does need documenting more explicitly for Arduino users

Are you saying that Arduino users are idiots who can't read?

crlMidi

Point taken, except that I use Arduino & don't consider myself a complete idiot.

When using structures that have been in common use in other languages for several decades it should normally be sufficient to look up just the syntax. The documentation and the Arduino Cookbook (700 pages)  are very well written; all I was saying is that it would help if the little warnings about the differences between Arduino and pure C++ could be extended to include other languages a user is likely to have encountered.

If you've had the misfortune to write XL VBA macros during the day for your employer, a little reminder that C++ "for" loops don't have the equivalent to "to" in them would make life easier when you switch to Arduino and a different reference book back at home.

AWOL

Quote
If you've had the misfortune to write XL VBA macros during the day for your employer,

I think that comes under the heading of "cruel and unusual", and would be banned in Europe under human rights legislation.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

wildbill

Quote
the differences between Arduino and pure C++


There really aren't any. All the Arduino stuff is just C++ libraries provided to make life easier - your code is compiled behind the scenes by the gnu C++ compiler.

Go Up