Shop OBEX P1 Docs P2 Docs Learn Events
Out of Variable Space???? — Parallax Forums

Out of Variable Space????

coorscoors Posts: 28
edited 2005-03-02 23:19 in BASIC Stamp
I am writing 2 different codes and both went well alone.· Now I added both together cause they will be complimenting each other.· Howver the compiler is complaining now about "Out of Variable Space".· WTF

Thing is I still need to·add even another segment of code to the program.· Is there a way around this.· Maybe getting another BOE and connecting them both??

ANy help wopuld be appreciated.

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-03-02 18:25
    Part of the painful debugging process for tight code is to optimize it to the point that your head hurts.

    There may be several ways to increase your variable space, but it's hard to say what your best solution
    would be without taking a look at your code.

    Personally I would avoid moving to a second BOE if at all possible.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • dandreaedandreae Posts: 1,375
    edited 2005-03-02 18:26
    See if you can share the same variable in all three sections of code for a particular use.· You can also check to see if you can use constants instead of variables.· There maybe some cases where the variables value never changes.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • The Dead BugThe Dead Bug Posts: 73
    edited 2005-03-02 18:34
    And have you declared the smallest variables possible for your applications?

    Bruce

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Name: Bruce Clemens

    Work:· Clemensb@otc.edu
    Good Stuff on my Bolg: http://theDeadBug.journalspace.com
  • kb2hapkb2hap Posts: 218
    edited 2005-03-02 22:04
    what stamp are you using?
    could you upgrade to a bs2p then you
    could throw the 2 different programs on different pages
    and pass info using the ram

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2005-03-02 22:10
    Excelent idea kb2hap!! .... I keep forgetting that there is a BS2 made that alows "page flipping"

    I would do this over a second (or even a third) BOE

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • Robert SchwartzRobert Schwartz Posts: 141
    edited 2005-03-02 22:10
    Make sure that all of your variables are as small as possible. For example if you have a variable that will only be a 1 or 0, make it a bit, not nibble, byte, or word.
  • GadgetmanGadgetman Posts: 2,436
    edited 2005-03-02 23:19
    Another tip regarding variables is to note which variables, while having large values, never change by much...

    F.example in a thermometer type application measuring body-temperature, you'd assume a 'lowest possible' value, and use this as an offset. (Setting this to 30, and using a nibble type variable will give a range of 30 to 46 degrees centigrade, instead of wasting a whole Byte on it. Should work with Fahrenheit, too, but I'm not certain about the range you need)
    It's a bit slower as you must sometimes add or subtract a constant, but it might help you squeeze in more into the variable space.

    Also, some of the Stamps allows you to do SERIN/SEROUT and similar commands using a Scratchpad RAM instead of variables as the buffer.
Sign In or Register to comment.