RSLogix5000 Anomaly

Code:
% cat cee.c ; gcc cee.c ; echo ======== ; ./cee
#include <stdio.h>
int
main() {
int counter;
  for (counter=0; counter<10; ++counter) {
    printf("%8d in loop\n", counter);
  }
  printf("%8d after loop\n", counter);
  return 0;
}


Silly question, do you always put the ++ before the variable in loops?
 
Silly question, do you always put the ++ before the variable in loops?




yes actually, though it's purely style and does not matter.


A colleague who was smarter than me expressed a rationale for it nearly thirty years and TBH that is why I do it, but again TBH I have no idea what they said.


My personal favorite construction is



Code:
for {counter=Npositive; counter--; ) ...


or an equivalent



countre=Npositive;
while (counter--) ...
but that is when my code golf nature beats up my non-obfuscation nature.
 
Last edited:
Lemme explain what happens when you fly a squadron of F-22 Raptors backwards across the International Date Line.

Wind up in the wrong country?????
Or wait, Is this like the time superman saved Lois.
I'm just guessing Ken
I don't know anything about Space/Time Continuums
 
Last edited:

Similar Topics

Hi! So my problem is a little funky, I had Studio 5000 v 24 and 30 installed, but forgot to install RSLogix (which I cannot go without). Is there...
Replies
2
Views
112
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
427
Hello everyone, I have an RSLogix5000 project which is running live in the factory but I need to make some changes to the logic. I want to test...
Replies
0
Views
1,120
Good Morning Everyone, I'm looking to use the GSV instruction to get I/O fault codes for my project so I know if there's a comms issue in my E/IP...
Replies
5
Views
866
The machine is running production. When trying to go online with the laptop the whole machine looses communication and faults out. Drives, HMI...
Replies
13
Views
1,932
Back
Top Bottom