Restored from previous forum. Originally posted by naw.
yes and also
case 1 to 10 ; for all numbers from 1 until 20
as i have asked long time ago
Christos
If PB supported Unix style Regular Expressions, then this and many other pattern matching problems would be resolved in one go.
eg: select TEST$
case "a" ; .......
case "a|b|b" ; .......
case "a[b|B]" ; ......
case "a[A-z]" ; ......
endselect
- I wonder if there is a Unix style Regular Expressions DLL that could be used in PB? Certainly, there are numerous implementations of vi, bash, sed etc...
Restored from previous forum. Originally posted by fweil.
You suppose it would solve in one go ...
But it won't.
It will give you an easier way to describe your problem at the PB level. But the compiler will have to translate this in a step by step process which will not be better at the execution level.
I practiced Fortran for years too and this language proposed such tools to build skip tables which were faster, but the multicase will not go faster I believe.
Anyway, if we get such multicase feature it will make the high level design easier to code.
If value=1 or value=3 or value=4
; code for 1, 3, 4.
ElseIf value=2 or value=5 or value=6
; code for 2, 5, 6.
ElseIf value>6 and value<11
; code for 7-10.
EndIf
Restored from previous forum. Originally posted by Branston.
Could these variants be included in this useful command?
CASE > d ; relational
CASE d TO 99 ; range d to 99 inclusive
CASE 25, d ; two equality tests; equal to 25 or equal to d?
CASE 25 TO 99,14 ;combination of range and equality