PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Code not Branching?
Code not Branching?
Débuté par Pierce DUBROCK, 08 juin 2022 03:16 - 1 réponse
Membre enregistré
2 messages
Posté le 08 juin 2022 - 03:16
A real weird one here. If I go "STEP by STEP" through my code it branches to the "ELSE" clause correctly.
If I run the code normally via "Debug project" it never hits "ELSE". It just runs the code in the "IF" part of my statement (it should not).
I know there is data to be processed by the "ELSE" clause but it is never run?.
Am I missing something simple somewhere?.
Membre enregistré
2 messages
Posté le 08 juin 2022 - 06:14
Fixed my issue by tinkering. Just in case someone else has the same issue.

I had a string to capture the required field from my data source:
sPrice_Family_Code is string
sPrice_Family_Code = HRetrieveItem(dsQry,5)


I would have thought sPrice_Family_Code would have been good enough to hold the data from HRetrieveItem().
I could see the value in sPrice_Family_Code via the debugger but WD27 didn't like it for some reason.

Changed it to:
sPrice_Family_Code is string
sPrice_Family_Code = dsQry.Price_Family_Code


My "IF" "THEN" "ELSE" code started branching properly as expected.