home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   CBM      Commodore Computer Conference      4,328 messages   

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

   Message 2,388 of 4,328   
   Shaun Bebbington to Shaun Bebbington   
   Re: Something strange going on.   
   11 Apr 18 04:05:16   
   
   On Wednesday, 11 April 2018 11:33:17 UTC+1, 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.   
      
   The same weird thing is happening with 1D arrays, i.e.,   
      
   0 PRINT "LINE ZERO"   
   1 LET A(0) = 10   
   2 LET A(1) = 20   
   3 LET A(2) = 30   
   5 GO TO A(1)   
   10 STOP   
   20 STOP   
   30 STOP   
      
   Expected result: Unconditional jump to line 20   
   Actual: infinite loop   
      
   But one cannot GOTO A for instance.   
      
   Regards,   
      
   Shaun.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: SpaceSST BBS Usenet  Fidonet Gateway (255:255/999)   

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


(c) 1994,  bbs@darkrealms.ca