Hi,is a valid line number (i.e., LET X = 100). But I know that's not possible with
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X where X
So I thought "I know, I'll try and use a function, could CBM BASIC use thisas a look up table". The following, I expected to go to the value in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Shaun.
Hi,is a valid line number (i.e., LET X = 100). But I know that's not possible with
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X where X
So I thought "I know, I'll try and use a function, could CBM BASIC use thisas a look up table". The following, I expected to go to the value in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Shaun.
Hi,is a valid line number (i.e., LET X = 100). But I know that's not possible with
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X where X
So I thought "I know, I'll try and use a function, could CBM BASIC use thisas a look up table". The following, I expected to go to the value in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Shaun.
@MSGID: <5ACE2329.2490.cbm@capitolcityonline.net>
Hi,
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X
where X is a valid line number (i.e., LET X = 100). But I know that's
not possible with Microsoft BASIC. Of course there is the ON X GO TO 100,200 ...
So I thought "I know, I'll try and use a function, could CBM BASIC use this as a look up table". The following, I expected to go to the value
in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Hi,is a valid line number (i.e., LET X = 100). But I know that's not possible with
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X where X
So I thought "I know, I'll try and use a function, could CBM BASIC use thisas a look up table". The following, I expected to go to the value in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Shaun.
Hi,
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X
where X is a valid line number (i.e., LET X = 100). But I know that's
not possible with Microsoft BASIC. Of course there is the ON X GO TO
100,200 ...
So I thought "I know, I'll try and use a function, could CBM BASIC use
this as a look up table". The following, I expected to go to the value
in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
On Wednesday, April 11, 2018 at 6:33:17 AM UTC-4, Shaun Bebbington wrote:
Hi,
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X
where X is a valid line number (i.e., LET X = 100). But I know
that's not possible with Microsoft BASIC. Of course there is the ON
X GO TO 100,200 ...
So I thought "I know, I'll try and use a function, could CBM BASIC
use this as a look up table". The following, I expected to go to the
value in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Shaun.
You SHOULD get a syntax error. Commodore (Microsoft) BASIC is supposed
to only allow numeric constants, not variables after GOTO and
GOSUB.
What do you actually see happening?
Try:
on X goto
On Wednesday, April 11, 2018 at 6:33:17 AM UTC-4, Shaun Bebbington wrote:is a valid line number (i.e., LET X = 100). But I know that's not possible with
Hi,
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X where X
only allow numeric constants, not variables after GOTO and GOSUB. What do you actually see happening?
So I thought "I know, I'll try and use a function, could CBM BASIC use this as a look up table". The following, I expected to go to the value in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Shaun.
You SHOULD get a syntax error. Commodore (Microsoft) BASIC is supposed to
On Thu, 12 Apr 2018 18:41:56 -0700 (PDT), Thomas Lake wrote:[..]
You SHOULD get a syntax error. Commodore (Microsoft) BASIC is supposed
to only allow numeric constants, not variables after GOTO and
GOSUB.
@MSGID: <5ACE2329.2490.cbm@capitolcityonline.net>
Hi,
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X
where X is a valid line number (i.e., LET X = 100). But I know that's
not possible with Microsoft BASIC. Of course there is the ON X GO TO 100,200 ...
So I thought "I know, I'll try and use a function, could CBM BASIC use this as a look up table". The following, I expected to go to the value
in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Thanks in advance.
Hi,
I found something odd today in the powerful CBM BASIC v2.0.
Having worked with Sinclair BASIC quite a lot recently, I use GOTO X
where X is a valid line number (i.e., LET X = 100). But I know that's
not possible with Microsoft BASIC. Of course there is the ON X GO TO
100,200 ...
So I thought "I know, I'll try and use a function, could CBM BASIC use
this as a look up table". The following, I expected to go to the value
in the function A() which returns 10, but...
0 DEF FN A(X) = 10
1 PRINT FN A(0)
2 GO TO FN A(0)
3 PRINT "END GRACEFULLY"
4 END
10 PRINT "STOP"
11 STOP
Try it for yourself. What's going on here?
Sysop: | Nelgin |
---|---|
Location: | Plano, TX |
Users: | 509 |
Nodes: | 10 (1 / 9) |
Uptime: | 111:31:02 |
Calls: | 8,194 |
Calls today: | 1 |
Files: | 15,442 |
Messages: | 913,273 |
Posted today: | 8 |