1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 16:45:53 +00:00
QB64-PE/internal/help/CASE_ELSE.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

62 lines
1.2 KiB
Plaintext

{{KW|CASE ELSE}} is used in a {{KW|SELECT CASE}} procedure as an alternative if no other {{KW|CASE}} statements are true.
{{PageDescription}}
* CASE ELSE should be listed at the bottom of the case list as it will supercede any case statements after it.
* Use it as a &quot;safety net&quot; or as an alternative for ALL values not covered in the {{KW|CASE}} statements.
{{PageExamples}}
''Example 1:''
{{CodeStart}}
a = 100
{{Cl|SELECT CASE}} a
{{Cl|CASE}} {{Cl|IS}} &lt; 99: {{Cl|PRINT}} &quot;a is &lt; 99&quot;
{{Cl|CASE}} 99: {{Cl|PRINT}} &quot;a is 99&quot;
{{Cl|CASE}} {{Cl|IS}} &gt; 100: {{Cl|PRINT}} &quot;a is &gt; 100&quot;
{{Cl|CASE ELSE}}
{{Cl|PRINT}} &quot;a is 100&quot;
{{Cl|END SELECT}}
{{CodeEnd}}
{{OutputStart}}
a is 100
{{OutputEnd}}
''Example 2:''
{{CodeStart}}
a = 100
{{Cl|SELECT CASE}} a
{{Cl|CASE}} 10: {{Cl|PRINT}} &quot;a is 10&quot;
{{Cl|CASE}} 20: {{Cl|PRINT}} &quot;a is 20&quot;
{{Cl|CASE}} 30: {{Cl|PRINT}} &quot;a is 30&quot;
{{Cl|CASE ELSE}}: {{Cl|PRINT}} &quot;a is something other than 10, 20 and 30&quot;
{{Cl|END SELECT}}
{{CodeEnd}}
{{OutputStart}}
a is something other than 10, 20 and 30
{{OutputEnd}}
{{PageSeeAlso}}
*{{KW|SELECT CASE}}
*{{KW|IF...THEN}}, {{KW|ELSE}}
{{PageNavigation}}