TIP: Click on subject to list as thread! ANSI
echo: cbm
to: All
from: Ed Vance
date: 2018-04-11 22:37:00
subject: Something strange going o

04-11-18 03:33 Shaun Bebbington wrote to All about Something strange going o
Howdy! Shaun,

 SB> @MSGID: 
 SB> Hi,

 SB> I found something odd today in the powerful CBM BASIC v2.0.

 SB> Having worked with Sinclair BASIC quite a lot recently, I use GOTO X
 SB> where X is a valid line number (i.e., LET X = 100). But I know that's
 SB> not possible with Microsoft BASIC. Of course there is the ON X GO TO
 SB> 100,200 ...

 SB> So I thought "I know, I'll try and use a function, could CBM BASIC use
 SB> this as a look up table". The following, I expected to go to the value
 SB> in the function A() which returns 10, but...

 SB> 0 DEF FN A(X) = 10
 SB> 1 PRINT FN A(0)
 SB> 2 GO TO FN A(0)
 SB> 3 PRINT "END GRACEFULLY"
 SB> 4 END
 SB> 10 PRINT "STOP"
 SB> 11 STOP

 SB> Try it for yourself. What's going on here?

 SB> Thanks in advance.

X isn't given a VALUE yet.   I "think" (TM).



... Have you checked your smoke detector batteries & Fire Ext, LATELY?!

--- SoupGate-Win32 v1.05
                                            
* Origin: SpaceSST BBS Usenet Fidonet Gateway (255:255/999)

SOURCE: echomail via QWK@dmine.net

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.