Forum
SELECT/CASE ... END SELECT - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Wishlist (https://www.boriel.com/forum/forumdisplay.php?fid=14)
+---- Thread: SELECT/CASE ... END SELECT (/showthread.php?tid=973)



SELECT/CASE ... END SELECT - Neurox66 - 08-26-2020

Hi,
I would like to see  available on the ZX Basic the control flow statements SELECT/CASE ... END SELECT

Code:
Select Case Answer$
    Case "YES"
        ...
    Case "NO"
        ...
    Case "MAYBE"
        ...
    Default
        ...
End Select

Thanks,
Paolo


RE: SELECT/CASE ... END SELECT - boriel - 08-27-2020

(08-26-2020, 03:55 PM)Neurox66 Wrote: Hi,
I would like to see  available on the ZX Basic the control flow statements SELECT/CASE ... END SELECT

Code:
Select Case Answer$
    Case "YES"
        ...
    Case "NO"
        ...
    Case "MAYBE"
        ...
    Default
        ...
End Select

Thanks,
Paolo

This is planned, but not implemented.
In the meantime try using
Code:
IF

ELSEIF

ELSEIF

ELSE...

(notice ELSEIF is written with no spaces)


RE: SELECT/CASE ... END SELECT - Neurox66 - 08-27-2020

Hi Boriel,
thanks for the answer.
I'll test it

Paolo