PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WINDEV
WINDEV
Débuté par Vinit Sawant, 16 nov. 2017 14:15 - 4 réponses
Posté le 16 novembre 2017 - 14:15
Can anyone please explain what does below code do?

NumCmd =""
SI Gauche(WBS,3) ="FR-" ALORS
NumCmd = Milieu(WBS,4,7)
TableauCode = Milieu(WBS,12,4)
FIN
SI Gauche(WBS,6) ="XX-01-" OU Gauche(WBS,6) ="ZZ-01-" ALORS
NumCmd = Milieu(WBS,7,6)
TableauCode = Milieu(WBS,14,4)
FIN

I'm not able to understand it as I'm new to WINDEV.
Posté le 16 novembre 2017 - 14:31
Hi Vinit,

does this translation make it more clear?

NumCmd ="" IF Left(WBS,3) ="FR-" ALORS NumCmd = Middle(WBS,4,7) TableauCode = Middle(WBS,12,4) END IF Left(WBS,6) ="XX-01-" OU Left(WBS,6) ="ZZ-01-" THEN NumCmd = Middle(WBS,7,6) TableauCode = Middle(WBS,14,4) END
Posté le 16 novembre 2017 - 14:45
Hi Stefan,
Thanks for your reply.

I want to know what this code is doing and it's purpose.
Because I want to add "FF-*********" (* will be any digits)in this but I'm not able to understand this code. If you can explain this code then it will be very useful.
Posté le 16 novembre 2017 - 15:50
Hi Vinit,

NumCmd =""
IF Left(WBS,3) ="FR-" ALORS // If leftmost 3 characters of WBS equal to "FR-"
NumCmd = Middle(WBS,4,7) // NumCmd becomes WBS from position 4 the next 7 characters
TableauCode = Middle(WBS,12,4) // TableauCode becoms WBS from position 12 the nest 4 characters
END
IF Left(WBS,6) ="XX-01-" OU Left(WBS,6) ="ZZ-01-" THEN // If leftmost 6 characters of WBS equal to "XX-01-" or "ZZ-01-"
NumCmd = Middle(WBS,7,6) // NumCmd becomes WBS from position 7 the next 6 characters
TableauCode = Middle(WBS,14,4) // TableauCode becomes WBS from position 14 the nest 4 characters
END

I hope, this helps for you.
Posté le 17 novembre 2017 - 07:13
Yes it does help a lot.
Thanks:)