Monday, November 28, 2022

🪲 Subroutine invocation without the CALL statement : NOW IT REALLY WORKS !!!

In an earlier post,  I describe undoing a problem I introduced into wwwBASIC.  I had broken wwwBASIC's ability to handle subroutine invocation without using the CALL statement.

Just when I got it working again, I discover that wwwBASIC's code for handling subroutine invocations without the use of CALL is broken: if the subroutine has more than one parameter, none of the parameters beyond the first one actually get passed to the subroutine.

Now, BAM's embedded version of wwwBASIC can handle subroutine invocations without CALL just as well as subroutine invocations with CALL.

Sample code used to discover the issue:

sub hey(a$, d%, c$)

    print "a$: " + a$

    print "d%: " + d%

    print "c$: " + c$

end sub

 

call hey("howdy", 5, "later") ' this works no problem

hey("hello", 6, "bye-bye")    ' this, all parameters except the first are "lost"

Before today's fix, the subroutine invocation without CALL would only pass a value for the first parameter, and ignore all parameters beyond the first one.


No comments:

Post a Comment

🖥 Flower Tesselation: Testing DRAW and recursive SUB's

This BAM program inspired by Richard Russell's "Flower-like tesselation" BBC BASIC program posted on Facebook . Created in ord...