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

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



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

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 - 2020-08-27

(2020-08-26, 04: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 - 2020-08-27

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

Paolo