Re: New switch/case idea

new topic     » goto parent     » topic index » view thread      » older message » newer message
DerekParnell said...

That should still work in Euphoria too, but it doesn't at the moment. I think this is a bug. To get it to work currently you have to add a label to the break clause...

  switch X label "A" do 
      case 1 then 
      . . . 
         if cond then 
             break "A" 
         end if 

break will exit the if statement, which I am not sure is something we should actually do. So, your break statement in the example, breaks from the if, not the switch. If you had

integer X = 1 
switch X do 
    case 1 then 
        X  = 2 
        break 
        X  = 3 
end switch 
? X 

it will print 2.

Jeremy

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

Search



Quick Links

User menu

Not signed in.

Misc Menu