PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Switch syntax error
Switch syntax error
Débuté par Rafa, 02 mai 2016 10:42 - 3 réponses
Posté le 02 mai 2016 - 10:42
Hi to all.

Webdev 19 throws this "Error:Syntax error in description of CASE", I think it has to be a very simple error but I see nothing...

SWITCH TypeVar( xPar )

CASE wlDate, wlDateTime:

...

CASE wlBoolean:

...

CASE wlInt:

...

CASE wlString:

...

OTHER CASE:

...

END
Posté le 02 mai 2016 - 13:49
I guess the syntax goes like this

Switch variable
Case 1: valuex
Case 2: valuey
Case 3: valuez
end
Posté le 02 mai 2016 - 15:46
It would be helpful for you to post the actual code and the error message you are receiving.

http://help.windev.com/en-US/…

Mike Peterson
T7Group.com
Posté le 03 mai 2016 - 12:29
I have found the error, its not from the switch syntax... In one of the cases, my code was an IF like this:
IF [CONDITION] THEN [CODE] ELSE [CODE] END


It seems that Windev dont want an IF in one line of code, I turned it to this and all worked:
IF [CONDITION] THEN
[CODE]
ELSE
[CODE]
END


Thanks to you guys.