[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem with case stmt alternatives

RichardOnRails

4/12/2009 8:51:00 PM

Hi,

I posted my problem code on http://pastie.....

On lines 38-39 I have the code:
case colSymbol
when :Status || :Symbol || :TradeType || :Quantity || :Price

As colSymbol assumes various Symbols as values, only the first one
seems to match.
The || symbols don't seem to work in this context.

Any ideas why not?

Thanks in Advance,
Richard
2 Answers

James Gray

4/12/2009 9:01:00 PM

0

On Apr 12, 2009, at 3:55 PM, RichardOnRails wrote:

> On lines 38-39 I have the code:
> case colSymbol
> when :Status || :Symbol || :TradeType || :Quantity || :Price
>
> As colSymbol assumes various Symbols as values, only the first one
> seems to match.
> The || symbols don't seem to work in this context.
>
> Any ideas why not?

Try:

when :Status, :Symbol, =85

James Edward Gray II=

RichardOnRails

4/12/2009 9:11:00 PM

0

On Apr 12, 5:01 pm, James Gray <ja...@grayproductions.net> wrote:
> On Apr 12, 2009, at 3:55 PM, RichardOnRails wrote:
>
> > On lines 38-39 I have the code:
> > case colSymbol
> > when :Status || :Symbol || :TradeType || :Quantity || :Price
>
> > As colSymbol assumes various Symbols as values, only the first one
> > seems to match.
> > The || symbols don't seem to work in this context.
>
> > Any ideas why not?
>
> Try:
>
> when :Status, :Symbol, …
>
> James Edward Gray II

Hey James,

You're spot on!

Thank you very much.

Best wishes,
Richard