Thanks
Peter
-------------------------
PIC BASIC Mailing List
Crownhill Associates Ltd
www.crownhill.co.uk
www.picbasic.co.uk
-------------------------
To remove yourself from this list, please send email to
majo...@qunos.net
with this text in its body: unsubscribe picbasic-l
Make sure you read the info in the manual about the numbering in arrays.
test var byte[10] will declare a 10 byte array
test[0] is the first byte in that array and test[9] is the last.
Tim
(London England)
Belief doesn't hack it, pal. If, rather than believing, you will read the
manual, you will see that var byte[10] is a 10 byte array, numbered 0 to 9.
Try counting your toes, starting with zero.
Yikes.
John
I'm not even using the whole array. I also tried to alter the size ([8] ,
[12] , [11] ...) - still the same problem.
What really makes me nervous is that the whole thing works perfect when I
declare all the other variables as words!
The program is about 4k words in size and I'm using 18 word variables and
two arrays (one has 10 bytes the other 16 bytes).
Peter
>
>
>
> Peter
>
>
> Make sure you read the info in the manual about the numbering in arrays.
>
> test var byte[10] will declare a 10 byte array
>
> test[0] is the first byte in that array and test[9] is the last.
>
> Tim
>
> (London England)
>
>
>
>
> > -----Original Message-----
> > From: owner-pi...@ns.qunos.net
> > [mailto:owner-pi...@ns.qunos.net]On Behalf Of Peter Meyer
> > Sent: 14 November 2000 08:05
> > To: picba...@qunos.net
> > Subject: PICBASIC-L Problem with arrays
> >
> >
> > If I declare an array (i.e. test var byte[10]) and other byte or bit
> > variables, some of the byte and bit variables change their values when I
> > write to the array. As soon as I declare the variables as word it
> > works just
> > fine...
> > Any ideas??
> >
> > Thanks
> > Peter
> >
Are you sure that you are writing a byte to the array?. If you have another
variable defined as a word, and the value in this variable is 255 or less,
you may think that you could safely write this value to the byte array. This
is not the case, the value will still need to be stored in a word array.
I came across this by mistake a while ago.
Regards
Reg Smith
----- Original Message -----
From: "John Lighton" <lig...@sablesys.com>
To: <picba...@qunos.net>
Sent: Tuesday, November 14, 2000 11:29 PM
Subject: Re: PICBASIC-L Problem with arrays
> <snip>
> Actually I beleive a var byte[10] is an eleven byte array elements 0
through
> 10.
> <snip>
>
> Belief doesn't hack it, pal. If, rather than believing, you will read the
> manual, you will see that var byte[10] is a 10 byte array, numbered 0 to
9.
> Try counting your toes, starting with zero.
>
> Yikes.
>
> John
>
>
>