SBASIC bug?

Anything QL Software or Programming Related.
Post Reply
User avatar
pjw
QL Wafer Drive
Posts: 1629
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

SBASIC bug?

Post by pjw »

Anyone know whats going on here?

SBASIC only: EXecute the following program:

Code: Select all

100 ch = FOPEN("con"): CLS#ch
110 test ch, 1
120 PAUSE#ch
130 CLOSE#ch
140 :
150 DEFine PROCedure test(ch, a)
160 PRINT#ch; a
180 END DEFine test
Result in this case:

At line 150:4 DEFines may not be within other clauses

However there are various error conditions depending on how the program
is constructed. In the worst case it just hangs and must be RJOBed.

What seems to get the interpreter's knickers in a twist is a parameter
being referenced using the same name as the parameter, 'ch' in this case.
This is supposed to be perfectly "legal". I dont know when this behaviour
started but Ive noticed it for a while.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
pjw
QL Wafer Drive
Posts: 1629
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: SBASIC bug?

Post by pjw »

PS: I see the long-line code issue has still not been resolved.
Would it help if I threw a tantrum?


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
User avatar
dilwyn
Mr QL
Posts: 3131
Joined: Wed Dec 01, 2010 10:39 pm

Re: SBASIC bug?

Post by dilwyn »

Presumably to do with the proc parameter ch being replaced by a global ch? Don't know - I've run into this sort of thing myself before and simply written it differently to work around it before I waste too much time looking into it.


Post Reply