Shop OBEX P1 Docs P2 Docs Learn Events
Visual Basic AHHH!!!! — Parallax Forums

Visual Basic AHHH!!!!

ArchiverArchiver Posts: 46,084
edited 2001-08-21 13:55 in General Discussion
Well I have been expermenting with the Stamp and interfacing it into
a Basic stamp program and I got it working and then expanded the idea
however when I transmit the data the stamp is transmitting the right
number of bytes to my prgram and my program is capturing them all in
my program with no errors. However I'm transmitting three seperate
arrays and the last element of the first two arrays is being
transmitted the same as the first ellement of the next array so A(3)
is showing up as B(0) and B(0) is also B(0). however if I change the
variable I'm transmitting to a constant my program captures it with
no problem. I hope that makes sense I was just wondering If this has
happened to anybody before or if anybody has any suggestions that
might solve this problem

Thank You
Aaron Nielsen

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-08-21 13:55
    I'm just guessing, but here's my guess:

    Do you realize that arrays dimensioned to N (in PBasic) range from 0 to N-1.
    However, PBasic doesn't bound check. So... if you have:

    abc var byte(3)
    xyz var byte(3)


    You just created abc(0), abc(1), abc(2) (and the same for xyz). However,
    PBasic will let you say abc(4) but it will probably (depending on how the
    Stamp software lays out your variables) be the same as xyz(0).

    So my guess is, you have statements like the above when you should use "abc
    var byte(4)" which would give you legal subscripts from 0 to 3.

    Good Luck!

    Al Williams
    AWC
    * Connect a PS/2 keyboard to your next Stamp project
    http://www.al-williams.com/awce/pak6.htm


    >
    Original Message
    > From: Aaron [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=1BYEgC3icCVJpvkVShrpELVJu2aAherR9EM0aJ1mhRM2W-YnzM01f5ek25H7bwTqfuIF43xuvJwp8n2T3qFL]snazzyguy2@y...[/url
    > Sent: Tuesday, August 21, 2001 3:09 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Visual Basic AHHH!!!!
    >
    >
    > Well I have been expermenting with the Stamp and interfacing it into
    > a Basic stamp program and I got it working and then expanded the idea
    > however when I transmit the data the stamp is transmitting the right
    > number of bytes to my prgram and my program is capturing them all in
    > my program with no errors. However I'm transmitting three seperate
    > arrays and the last element of the first two arrays is being
    > transmitted the same as the first ellement of the next array so A(3)
    > is showing up as B(0) and B(0) is also B(0). however if I change the
    > variable I'm transmitting to a constant my program captures it with
    > no problem. I hope that makes sense I was just wondering If this has
    > happened to anybody before or if anybody has any suggestions that
    > might solve this problem
    >
    > Thank You
    > Aaron Nielsen
    >
    >
    > 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/
    >
Sign In or Register to comment.