Computer Science Canada

HELP!!!! -Implementation restriction -Block nesting too deep

Author:  zjlzjl [ Wed Jun 08, 2005 3:02 am ]
Post subject:  HELP!!!! -Implementation restriction -Block nesting too deep

Implementation restriction -Block nesting too deep

why is it in my program??? how can i solve it??????


my code is too long, can any one download the attchment and fix it for me? pliz. thankyou. very much.!


bowing.......

btw, u wont be able to run the program because of missing picutre
if u need the picz, Msn me, or email -xjayq@hotmail.com

Author:  Drakain Zeil [ Wed Jun 08, 2005 6:11 am ]
Post subject: 

Perhaps you should post the code?

Author:  c0bra54 [ Wed Jun 08, 2005 8:40 am ]
Post subject: 

yeh.. what are oyu talking about..

Author:  Cervantes [ Wed Jun 08, 2005 4:56 pm ]
Post subject: 

It sounds like you've got nested loops/for loops/if statements/case constructs to the nine hells and back again! It would seem that Turing does not like that so much. You should not like that too much, either. Having nested loops/conditional statements forever and ever makes things get way, WAY too complicated. For most programs, you only NEED one main loop (sure, there are smaller loops inside there, but they are small).
I suspect you're doing something like "if you click this button, then [code goes into another loop which is almost as big as the previous one]". If it's something like that, you need to find another way to code your program. Believe me, it will make things easier.

If that's not the case, feel free to ignore my post. Smile

Author:  c0bra54 [ Wed Jun 08, 2005 10:06 pm ]
Post subject: 

or maybe there are like 8 for loops, nested checking 8 different dimesions of an array.. that is MASSIVELY complex, 8 dimensions!

or it is like cervantes says..

Author:  zjlzjl [ Thu Jun 09, 2005 7:03 pm ]
Post subject: 

Cervantes wrote:
It sounds like you've got nested loops/for loops/if statements/case constructs to the nine hells and back again! It would seem that Turing does not like that so much. You should not like that too much, either. Having nested loops/conditional statements forever and ever makes things get way, WAY too complicated. For most programs, you only NEED one main loop (sure, there are smaller loops inside there, but they are small).
I suspect you're doing something like "if you click this button, then [code goes into another loop which is almost as big as the previous one]". If it's something like that, you need to find another way to code your program. Believe me, it will make things easier.

If that's not the case, feel free to ignore my post. Smile


woah i guess ur rit, im a newbe man, cud u help me take a look at my program and fix it? i appreciate ....

Author:  c0bra54 [ Thu Jun 09, 2005 7:56 pm ]
Post subject: 

ok well umm yeh.. your problem is DEFFINITLY to many nested for loops.. if you clikc the handy indent buttton it will show you jsut how bad it is... note.. that's REALLY bad..

word of advice, it's great that you are using for loops, but most of the time you do not need so many stacked inside, usually nested for's deal with multidimensional arrays (least when i use them) or when checking say for example every y pixel, from x=5 to x=10 or sumthing to that effect... what you want to do instead is a kind of if elsif satements.. these are golden.. they basically say that if a statement is true then do the following, the elsif is espeicially good because it will not let two things happen from the same if elsif statment...

yeh.. for loops = good.. that many = omg i run away


: