#20 Max dimension in arrays

Closed
opened 2 years ago by ChipMaster · 1 comments

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.
ChipMaster commented 2 years ago
Owner

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.
ChipMaster closed this issue 2 years ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.