bwBASIC’s DIM sets the max element instead of the number of elements.
DIM A(2)
PRINT A(0), A(1), A(2)
I’m used to DIM specifying the number of elements. This likely needs to be an OPTION so it can be adjusted per VERSION. I tested basica and qbasic and they behave the same way bwBASIC does. But I’m certain that TRS-80 BASIC spec’d the number of elements.
bwBASIC's `DIM` sets the max element instead of the number of elements.
```
DIM A(2)
PRINT A(0), A(1), A(2)
```
I'm used to DIM specifying the number of elements. This likely needs to be an OPTION so it can be adjusted per `VERSION`. I tested basica and qbasic and they behave the same way bwBASIC does. But I'm certain that TRS-80 BASIC spec'd the number of elements.
I checked the TRS-80 model 1 level II BASIC reference and it also spec’d the max element, not the count. I’m apparently mistaken and likely made arrays too big. I think ZBasic, which I used the most, may have spec’d count instead of max. But I’m closing this because it seems that this behavior is what was typically done.
I checked the TRS-80 model 1 level II BASIC reference and it also spec'd the max element, not the count. I'm apparently mistaken and likely made arrays too big. I think ZBasic, which I used the most, may have spec'd count instead of max. But I'm closing this because it seems that this behavior is what was typically done.
bwBASIC’s
DIM
sets the max element instead of the number of elements.I’m used to DIM specifying the number of elements. This likely needs to be an OPTION so it can be adjusted per
VERSION
. I tested basica and qbasic and they behave the same way bwBASIC does. But I’m certain that TRS-80 BASIC spec’d the number of elements.I checked the TRS-80 model 1 level II BASIC reference and it also spec’d the max element, not the count. I’m apparently mistaken and likely made arrays too big. I think ZBasic, which I used the most, may have spec’d count instead of max. But I’m closing this because it seems that this behavior is what was typically done.