PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → How do I check if the Compile() method in Windev checks the code?
How do I check if the Compile() method in Windev checks the code?
Débuté par Wilnar, 04 nov. 2022 05:03 - 1 réponse
Membre enregistré
1 message
Posté le 04 novembre 2022 - 05:03
The Compile() method returns an error when Windev can not compile it.

For instance (correct code):

teller is int = hnbrec("client")
result teller
This code returns the amount of items in de Client datafile.

But when I make a typo like:

teller is int = hnbrec("client")
result telles //should be teller
Windev does not mention an error...

But when I make a typo like:

teller iss int = hnbrec("client") //should be is
result teller
It throws a syntax error telling me it does not recognize iss.

How do I check the second example so it will throw an error?

EDIT: However when I execute the code with

ExecuteProcess("<the process name>", trtProcedure)
The process will return an error saying it does not know telles... But I don't want to execute the process, I only need to check it and write it to the database.
Membre enregistré
54 messages
Popularité : +2 (2 votes)
Posté le 04 novembre 2022 - 10:34
Hi Wilnar,
I think windev cannot throw an error in this case, becouse "telles" variable can be defined in an other point of your code and used/manipulated in your compile() code, so the result of compile("YourCode") is ok, but at execution time you get an error.

eg

in a point before you define:
telles is int

and then your compile code:

teller is int = hnbrec("client")
telles+=teller
result telles

I think this may be the explanation...
Hope this helps
Andrea