Welcome! Log In Create A New Profile

Advanced

Switch Else Statement

Posted by Paul Ziegler 
Paul Ziegler
Switch Else Statement
February 24, 2009 09:45PM
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
FireTox
Re: Switch Else Statement
February 24, 2009 09:50PM
hello

the good syntax is

SWITCH Quantity
CASE 1: Comment = "Take advantage of our promotions: buy one, get one free"
CASE 2: Comment = "Buy two products: get one free"
OTHER CASE : Comment = " "
END

regqards
Paul Ziegler
Re: Switch Else Statement
February 24, 2009 11:16PM
Thanks for the reply. That works. I will just forget about trying to use the ELSE.

Paul Ziegler
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

Hi Paul,

You have to be careful with code in WD help. I've found (many times) that the
code is not correct.

Georgio
Stefan Bentvelsen
Re: Switch Else Statement
February 25, 2009 09:18AM
Hi Paul,

I suggest that you send this Help-file bug to PCSoft.
Fabrice Harari.pcs.crosspost
Re: Switch Else Statement
February 25, 2009 11:58AM
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
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

Hi Fabrice,

I was just making a note to the original poster that most of the examples provided with
windev's help files have syntax issues. I would say about 60% of the time. I imagine it
may have something to do with the French to English translation. But, I could be wrong.

Thanks!
Georgio
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: