home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.sys.cbm      Discussion about Commodore micros      53,866 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 52,216 of 53,866   
   Shaun Bebbington to All   
   Something strange going on.   
   11 Apr 18 03:33:15   
   
   From: shaun@square-circle.co.uk   
      
   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.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca