A more program space efficient way of doing ta whole heap of IFs????


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: A more program space efficient way of doing ta whole heap of IFs????

    Quote Originally Posted by rsocor01 View Post
    Darrel,

    Let me ask a very dumb question here about your ELSEIF program . Lets say for example that variable supply_in= 251. Does the program exits the IF..ENDIF block after it encounters the lines

    ELSEIF supply_in> 250 then
    max_duty = 155
    ...
    That one''s easy (programmer by trade), it exits the nested IFs after assigning 155.

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default Re: A more program space efficient way of doing ta whole heap of IFs????

    Quote Originally Posted by Demon View Post
    That one''s easy (programmer by trade), it exits the nested IFs after assigning 155.
    Ooh, I see. Thank you Robert.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: A more program space efficient way of doing ta whole heap of IFs????

    When in doubt, use debug feature.

    If you don't have a debug feature (using Wordpad instead of an IDE), then make one up. Just put in a bunch of LEDs on empty ports, and then make them blink different ways in different places in your code.

    Or even better, get the easiest LCD on the market, the HD44780, and send debug messages (abbreviated syntax, just for example):

    Code:
     
    LCDOUT "Program start", var1, var2
     
    Label_A:
      LCDOUT "Label A", var1, var2
      Program logic...
      IF var1 < var2 then goto Label_A
     
    Label_B:
      LCDOUT "Label B", var1, var2
      More program logic...
      IF var1 < var2 then goto Label_B
     
    LCDOUT "Program end", var1, var2
    We do something similar as mainframe programmers; it's called using DISPLAY statements. There is no limit to what you can use as a debug feature. If it works for you, then it's perfect.

Members who have read this thread : 0

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