View Full Version : Nested IF THEN Statements
cjsanders
- 6th December 2004, 21:24
What is the maximum # of Nested IF THEN's you can have with a 16F877 MCU?
Does the Compiler warn you if you exceed this number?
mister_e
- 6th December 2004, 21:31
as i expect you can have as many as you want or program memory is able to contain them.
I don't see any reason why it should have a maximum. BUT maybe i'm wrong.
Sometime SELECT CASE is a good way to reduce IF THEN statements.
Dwayne
- 7th December 2004, 19:17
I seemed to remember a Maximum of 4 nested.
I have been trying to call up the manual to doublecheck my
answer, but the site doesn't seem to be working.
Dwayne
Melanie
- 7th December 2004, 20:12
That's subroutines with a 4 max. IF... THEN's do not use the stack and therefore have no restriction. The compiler will warn you if you run out of program codespace.
Dwayne
- 7th December 2004, 20:18
Melanie>>That's subroutines with a 4 max. IF... THEN's do not use the stack and therefore have no restriction<<
Thanks a MILLION!... I knew I remembered something like a max of 4 on something...Since I may never met that max, I just blow it off.
Dwayne
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.