fastbasic icon indicating copy to clipboard operation
fastbasic copied to clipboard

INC on byte arrays

Open ukcroupier opened this issue 5 years ago • 2 comments

Think I got a bug.

inc a(1)

This works as expected with WORD arrays but gives an error with BYTE arrays

ukcroupier avatar Feb 10 '20 06:02 ukcroupier

Hi!

Think I got a bug.

inc a(1)

This works as expected with WORD arrays but gives an error with BYTE arrays

Yes, INC (and DEC, GET, INPUT, and generally all the other statements that expect a variable) only work with WORDS, not with BYTEs.

To support bytes, we would need a new statement, as the current ones write on a WORD location (so they write two bytes).

If you really need that, I could implement it, it would be about 15 extra bytes in the IDE.

Have Fun!

dmsc avatar Feb 10 '20 15:02 dmsc

There's no desperate need for it, INC is more of a bonus feature than a necessity. 15 bytes doesn't sound like a lot, so if it doesn't hinder your overal plans it would be nice to have.

ukcroupier avatar Feb 10 '20 17:02 ukcroupier