by Roelf Toxopeus <these3rt0only@[EMAIL PROTECTED]
>
Jan 23, 2005 at 12:03 AM
In article <f3cdf9d9.0501210909.1841f573@[EMAIL PROTECTED]
>,
jeandal34@[EMAIL PROTECTED]
(jd) wrote:
> Hi,
>
> I am running MacForth 5.2 on a Mac and have very strange things
> happening with my arrays. When i create an array and enter a value in
> the first cell as follows:
> create MyArray 12 allot
> 221 MyArray !
>
> if i view the content of the first cell the value is right:
> MyArray @[EMAIL PROTECTED]
.
> 221
>
> However if i now enter a value in the second cell of the 16 bit array:
> 230 MyArray 2 + !
>
> and check the content of the first cell again, i obtain 0 : my first
> cell has been erased!!
>
> Do i do anything wrong? Can anyone help.
> Thanks in advance,
> jd
a cell in MacForth is 32 bits
use w@[EMAIL PROTECTED]
and w! for 16 bit storage and retrieval as in your case above.
221 Myarray w!
230 MyArray 2 + w!
use ! and @[EMAIL PROTECTED]
for 32 bit stuff
221 Myarray !
230 MyArray 4 + !
(just in case: use c@[EMAIL PROTECTED]
and c! for 8 bit, sorry characters)