Nested IF THEN Statements


Closed Thread
Results 1 to 5 of 5
  1. #1
    cjsanders's Avatar
    cjsanders Guest

    Default Nested IF THEN Statements

    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?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    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
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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.

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    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
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Nested For Next Loop Demo
    By Archangel in forum Code Examples
    Replies: 0
    Last Post: - 8th June 2009, 08:57
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Multiple IF-THEN statements
    By DavidK in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th June 2007, 18:28
  4. Proton Commands & statements
    By Lotondo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th November 2006, 23:37
  5. If - then statements
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 18th May 2006, 22:57

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts