NooBie in need of help

I used to do very basic programming in picbasic.
the structure allowed me to name a loop ie, LOOP1, LOOP2, LOOP3 etc and i could jump to that section using the goto command.
Is it possible to do this in arduino? ive been looking on google etc but cant find anything. The biggest problem im having is my knowlage of picbasic is getting in the way and confusing me.
Any help on this would be greatly appreciated.
Many thanks in advance

for(byte r = 0; r < 255; r++){
    for(byte g = 255; g > -1; g--){
        for(byte b = 0; b < 255; b++){
            if (analogRead(0) > 250){ goto bailout;}
            // more statements ... 

Hi, this is an example from the Reference section of this site.
Tom… :slight_smile:

Many thanks. It is very similar to picbasic and i think its that that has been confusing me, being a new product i assume it would be very different.
Once again thanks for your help.
I am finding arduino very interesting and have already purchased the uno and the mega. I can see this is going to be a wonderful learning curve

C programmers cringe when you mention jumps. They lead to spagetti code. C uses encapulation and structure. You would be much better to learn to program without jumps…


Hi, no problems with the help, thats what we are here for.
I agree with Jeffegg2, being a fortran and hpbasic and qbasic fan, GOTOs were regular parts of the program, however as you learn to structure your C programs you will find that you use it very very rarely.

Tom....Have fun... :slight_smile: