robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
393 stars 48 forks source link

OPTION BASE should be allowed after ERASEing all arrays #185

Closed robhagemans closed 2 years ago

robhagemans commented 2 years ago

Test code:

DIM Y%(4)
OPTION BASE 1
ERASE Y%
OPTION BASE 1    

What happens:

Duplicate Definition
Ok
Duplicate Definition
Ok

What should happen:

Duplicate Definition
Ok
Ok

Background - OPTION BASE should fail with Duplicate Definition if there are allocated arrays. However, if all arrays have been ERASEd it should be allowed. PC-BASIC disallows it if at any point an array has been allocated

rbergen commented 2 years ago

Wow, I'd put this in the "rather obscure" category, for sure. I can't help wondering how on earth you found this one. :)

robhagemans commented 2 years ago

As almost always, by accident... Though in the context of issue #182 it's not quite so random.

rbergen commented 2 years ago

I had missed #182. But yes, I do see the connection now.

robhagemans commented 2 years ago

Fixed by commit e2611007

robhagemans commented 1 year ago

As almost always, by accident... Though in the context of issue #182 it's not quite so random.

On Thu, 23 Jun 2022, 09:56 Rutger van Bergen, @.***> wrote:

Wow, I'd put this in the "rather obscure" category, for sure. I can't help wondering how on earth you found this one. :)

— Reply to this email directly, view it on GitHub https://github.com/robhagemans/pcbasic/issues/185#issuecomment-1164140325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB25REXGTX3AQRW5HLW4FW3VQQRDFANCNFSM5ZROFEYA . You are receiving this because you were assigned.Message ID: @.***>