| Posted: 05:25am 07 Jun 2025 |
|
|
|
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 >
> LIST ' Test prog 1 Dim integer a=5, b=6, c=7 Print "a, b, c =";a;b;c test a,,c
Sub test(a, b, 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 0 7 After Sub a, b, c = 5 6 7 > BYVAL appears to be the default anyway.
Senility advancing. Edited 2025-06-07 16:01 by phil99 |