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
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Cool Coding Examples

    Darrel,

    I have to say your coding examples are nothing short of excellent.

    That is one place that I think the PBP manual could be improved. I came over from the basic stamp, their manual was quite good with examples.

    The hardest thing for me to do is to go from a technical description of a given PBP command to a real world working piece of code. Whereas, once I see how to correctly use a given PBP statement, then I can usually write my way through my own code. Where I usually have trouble is with the syntax and good examples are invaluable. There seems to be a lot of wasted blank paper in the manual that could be filled up with more syntax examples.

    If MElabs could produce a webpage where a person could goto and enter any given PBP statement and see a few (several) examples of good code, it would help the newbie greatly. I know there are a few of those over at MElabs but there could be more.

    Please pass this along to the MElabs people .

    You are a real asset to the group... and I look forward to future releases of PBP that might?? include some of your excellent coding work implemented as new PBP statements.
    Last edited by Heckler; - 27th May 2011 at 14:01.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  2. #2
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

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

    If there is a mathematical relationship between supply_in and max_duty, it might be more efficient to just compute max_duty as supply_in varies.

    Also, if the relationship could be refined to eliminate the max _duty granular discontinuities (i.e. if it can vary in steps of 1 or any constant step), a loop might be better.
    Last edited by dhouston; - 27th May 2011 at 15:49.

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    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 dhouston View Post
    If there is a mathematical relationship between supply_in and max_duty, it might be more efficient to just compute max_duty as supply_in varies.

    Also, if the relationship could be refined to eliminate the max _duty granular discontinuities (i.e. if it can vary in steps of 1 or any constant step), a loop might be better.

    I'd considered that, but alas the supply_in vs the max_duty required is all over the shop....hence the multiple ifs!

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


    Did you find this post helpful? Yes | No

    Default Re: Coding Examples

    Quote Originally Posted by Heckler View Post
    The hardest thing for me to do is to go from a technical description of a given PBP command to a real world working piece of code. Whereas, once I see how to correctly use a given PBP statement, then I can usually write my way through my own code. Where I usually have trouble is with the syntax and good examples are invaluable.
    This forum, PBPGroup, Rentron.com & Melabs website are full of handy code example, take a pick, modify them, try to make them better.

    To me the PBP book is perfect. It explain what a specific command do. Just build a test program around it and you're all set. There's by far worst reference book... check MPASM assembler, most (see any) API/DLL reference... list is long

    Programming... It's like everything, practice makes "perfect", the more you do, the easier it gets. Call it experience if you like. It take months, years, decade... it's a never ending learning process... welcome on the dark side
    Steve

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

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