Re: switch statement

new topic     » goto parent     » topic index » view thread      » older message » newer message

Note how qbasic does it:

SELECT CASE Expression 
    CASE IS >= 5 
          ... 
    CASE 2 TO 4 
          ... 
    CASE 1 
         ... 
    CASE ELSE 
         ... 
END SELECT 

The "IS" token precedes complex expression, this way simple expressions get a fast processing.

Will be great if the switch can process sequences. But may become very complex like this

for i=1 to 5 do 
 
  select case my_sequence[i] 
  case "" 
    ... 
  case other_sequence[i] 
    ... 
  case else 
    ... 
  end select 
 

May be a very powerfull, but not easy to eval

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu