| Posted: 02:01am 07 Jun 2025 |
|
|
|
Having trouble with BYVAL in latest RC. According to the manual changing the value in this test Sub should leave the original value unchanged. Or have I got it wrong? If that is the case an example in the manual would make it clearer.
> LIST ' Test prog 1 Dim integer a=5 Print "a =";a test
Sub test(BYVAL a As integer) If a = 5 Then a = 10 Print "In Sub a =";a EndIf End Sub
Print "After Sub a =";a End > > > RUN a = 5 In Sub a = 10 After Sub a = 10 > > option list PicoMite MMBasic RP2040 Edition V6.00.02RC26 OPTION SYSTEM SPI GP18,GP19,GP16 OPTION SYSTEM I2C GP8,GP9 OPTION COLOURCODE ON OPTION CONTINUATION LINES ON OPTION CPUSPEED (KHz) 378000 OPTION DISPLAY 55, 155 OPTION LCDPANEL ST7796S, PORTRAIT,GP15,GP14,GP13,GP20 OPTION TOUCH GP12,GP11 GUI CALIBRATE 1, 140, 3979, 855, -1278 OPTION SDCARD GP17 OPTION RTC AUTO ENABLE > Edited 2025-06-07 12:05 by phil99 |