Shop OBEX P1 Docs P2 Docs Learn Events
Out of VAR memory? — Parallax Forums

Out of VAR memory?

ArchiverArchiver Posts: 46,084
edited 2003-03-22 21:08 in General Discussion
Hi all,

I have a program with a total of 16 cons and vars. Most vars are bytes. Yet
I am being told I am out of memory room. I can't seem to find that maximum
allowable number of vars in my manual, but I have other programs with more,
I am sure. What gives?

Thanks,

Jonathan

www.madlabs.info

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-03-22 18:34
    The BASIC Stamp has 26 bytes of user RAM in the VAR space; so somthing is up.
    Make sure you're only declaring the actual size you need: use Bits and
    Nibbles when the values they'll hold will allow. Also, reuse variables when
    possible; often variables are localized to a routine and their value does not
    need to be maintained through the run of the program. In this case, you can
    use aliasing to rename a variable to keep your program readable, but will
    save you space.

    -- Jon Williams
    -- Parallax

    In a message dated 3/22/2003 12:26:52 PM Central Standard Time,
    jpeakall@m... writes:

    > Hi all,
    >
    > I have a program with a total of 16 cons and vars. Most vars are bytes. Yet
    > I am being told I am out of memory room. I can't seem to find that maximum
    > allowable number of vars in my manual, but I have other programs with more,
    > I am sure. What gives?
    >
    > Thanks,
    >
    > Jonathan
    >
    > www.madlabs.info



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-22 19:10
    Jon,

    I was nowhere near 26 bytes. Good to know what the ceiling is. Oddly, I
    tried cutting and pasting the code into new document, and the problem went
    away. Same code, same Stamp designation, word for word. I have occasionally
    run into this kind of "tainted file" before, but not with the Stamp editor.

    Jonathan

    Original Message
    From: <jonwms@a...>
    To: <basicstamps@yahoogroups.com>
    Sent: Saturday, March 22, 2003 10:34 AM
    Subject: Re: [noparse][[/noparse]basicstamps] Out of VAR memory?


    > The BASIC Stamp has 26 bytes of user RAM in the VAR space; so somthing is
    up.
    > Make sure you're only declaring the actual size you need: use Bits and
    > Nibbles when the values they'll hold will allow. Also, reuse variables
    when
    > possible; often variables are localized to a routine and their value does
    not
    > need to be maintained through the run of the program. In this case, you
    can
    > use aliasing to rename a variable to keep your program readable, but will
    > save you space.
    >
    > -- Jon Williams
    > -- Parallax
    >
    > In a message dated 3/22/2003 12:26:52 PM Central Standard Time,
    > jpeakall@m... writes:
    >
    > > Hi all,
    > >
    > > I have a program with a total of 16 cons and vars. Most vars are bytes.
    Yet
    > > I am being told I am out of memory room. I can't seem to find that
    maximum
    > > allowable number of vars in my manual, but I have other programs with
    more,
    > > I am sure. What gives?
    > >
    > > Thanks,
    > >
    > > Jonathan
    > >
    > > www.madlabs.info
    >
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-03-22 21:08
    In a message dated 3/22/2003 11:14:38 AM Pacific Standard Time,
    jpeakall@m... writes:

    > Jon,
    >
    > I was nowhere near 26 bytes. Good to know what the ceiling is. Oddly, I
    > tried cutting and pasting the code into new document, and the problem went
    > away. Same code, same Stamp designation, word for word. I have occasionally
    > run into this kind of "tainted file" before, but not with the Stamp editor.
    >
    > Jonathan

    Jonathan,

    I too have had code that "HAD TO WORK" but did not. I too remember cutting
    the entire listing and pasting into a new document and the problem went away.

    Ken


    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.