Recursion Limit
#5
(05-28-2023, 02:39 PM)CharlieJV Wrote: I wanted to see how QBJS handles my BAM program (I was expecting same results), but QBJS is giving the error:

Code: (Select All)
WARN : 4 : Missing or unsupported method: 'howRecursive(i' - ignoring line
ERROR : 0 :
Unexpected token '}'
SyntaxError: Unexpected token '}'
    at new AsyncFunction ()
    at runProgram (https://qbjs.org/qbjs-ide.js:234:22)

@bplus' original example runs without modification just fine in QBJS.  There were a couple of issues keeping your BAM version from running in QBJS:
1) You are calling a sub with parameters, but without a CALL statement.  You need to either remove the parameters or prefix the call to the sub with the CALL statement.
2) Main code must be defined before subs and functions

This modified version runs fine:
Code: (Select All)
howRecursive 1

Sub howRecursive (i As long)
    If i < 0 Then Print "_Integer64 turned negative.": End
    if i mod 300 = 0 then Print i: _Delay .000000000005
    'if i > 520000 then print "press a key to continue" : sleep
    howRecursive i + 1
End Sub

I would expect some variation between browsers and system specs.  I'm running the code in my Edge browser.  It's still running now and just passed 13 million:

   
Reply


Messages In This Thread
Recursion Limit - by bplus - 05-28-2023, 02:04 PM
RE: Recursion Limit - by CharlieJV - 05-28-2023, 02:39 PM
RE: Recursion Limit - by dbox - 05-28-2023, 03:55 PM
RE: Recursion Limit - by CharlieJV - 05-28-2023, 03:06 PM
RE: Recursion Limit - by mnrvovrfc - 05-28-2023, 03:37 PM
RE: Recursion Limit - by bplus - 05-28-2023, 06:10 PM
RE: Recursion Limit - by CharlieJV - 05-28-2023, 06:59 PM
RE: Recursion Limit - by Jack - 05-28-2023, 06:30 PM
RE: Recursion Limit - by bplus - 05-28-2023, 10:30 PM
RE: Recursion Limit - by bplus - 05-28-2023, 11:14 PM
RE: Recursion Limit - by dbox - 05-29-2023, 12:04 AM



Users browsing this thread: 6 Guest(s)