PicoMite V6.00.02 release candidates - all versions


Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4281
Posted: 06:29am 07 Jun 2025      

  phil99 said  
  Quote  When calling a subroutine you can supply less than the required number of values and in that case the missing values will be assumed to be either zero or an empty string.
BYVAL appears not to adhere to that.
> LIST
' Test prog 1
Dim integer a=5, b=6, c=7
 Print "a, b, c =";a;b;c
test a,,c

Sub test(BYVAL a, BYVAL b, BYVAL c)
If a = 5 Then
 a = 10
 Print "In Sub a, b, c =";a;b;c
EndIf
End Sub

Print "After Sub a, b, c =";a;b;c
> RUN
a, b, c = 5 6 7
In Sub a, b, c = 10 6 7
After Sub a, b, c = 5 6 7
>


Oops - looks like a bug in MMBasic!

(b should default to 0 in test.)

John