Paul Ziegler
Switch Else Statement February 24, 2009 09:45PM |
FireTox
Re: Switch Else Statement February 24, 2009 09:50PM |
Paul Ziegler
Re: Switch Else Statement February 24, 2009 11:16PM |
Georgio
Re: Switch Else Statement February 24, 2009 11:57PM |
Quote
Paul Ziegler
Can someone tell me why this doesn't work?
Quantity is int
Comment is string
SWITCH Quantity
CASE 1: Comment = "Take advantage of our promotions: buy one, get one free"
CASE 2: Comment = "Buy two products: get one free"
CASE ELSE: Comment = " "
END
The ELSE has a red line under it. This code was copied directly out of the WD help. The only thing I did was declare the variables. I have found another way to do the Switch statement that I want, but would really like to know why the above doesn't work. Any feed back is appreciated.
Thanks,
Paul Ziegler
Stefan Bentvelsen
Re: Switch Else Statement February 25, 2009 09:18AM |
Fabrice Harari.pcs.crosspost
Re: Switch Else Statement February 25, 2009 11:58AM |
Georgio
Re: Re: Switch Else Statement February 26, 2009 11:17PM |
Quote
Fabrice Harari.pcs.crosspost
Hi Georgio
it does work... The help just reference an incorrect syntax, the correct
one being "other case"
Best regards
--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting
More information on [www.fabriceharari.com]
Georgio wrote:
> Can someone tell me why this doesn't work?
>
>
>> Quantity is int
>
>> Comment is string
>
>
>> SWITCH Quantity
>
>> CASE 1: Comment = "Take advantage of our promotions: buy one, get one free"
>
>> CASE 2: Comment = "Buy two products: get one free"
>
>> CASE ELSE: Comment = " "
>
>> END
>
>
>> The ELSE has a red line under it. This code was copied directly out of the WD help. The only thing I did was declare the variables. I have found another way to do the Switch statement that I want, but would really like to know why the above doesn't work. Any feed back is appreciated.
>
>
>> Thanks,
>
>> Paul Ziegler
> Hi Paul,
> You have to be careful with code in WD help. I've found (many times) that the
> code is not correct.
> Georgio
>
Message forwarded from pcsoft.us.windev