PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Loop through variables
Loop through variables
Iniciado por Vlad, jan., 18 2024 3:00 PM - 6 respostas
Publicado em janeiro, 18 2024 - 3:00 PM
Greetings,

Does Windev support looping through variables in a way like:


FOR i = 1 TO 8
IF Drill[i] > 0 THEN
Info("Hello")
END
END

The main task is to check if Drill[1-8] has value. Tried Drill{i},Drill(i),Drill[i], Windev just will drop error "variable could not be found)

Thanks in advance!
Publicado em janeiro, 20 2024 - 12:25 PM
Hi Vlad,

Did you define the array as follows:
Drill is array of int //in case your "i" is an int
?

Best regards,

Volker
Publicado em janeiro, 22 2024 - 5:54 PM
Volker,

no, just check if Widnev recognizing objects by looping with variable like:
Drill[i]

I have text boxes like:
Drill1,Drill2...

Worked before with software which supports that kind of looping.

In Windev I did it with arrays, also good way to do it, and super fast.

Thanks!
Publicado em janeiro, 23 2024 - 6:45 PM
The software you used before … is called Clarion? At least it‘s exactly the same syntax. In Clarion these variables were called „groups“. But these groups are nothing else than arrays. 😊
I am still fighting with myself to replace Clarion by Windev. Probably I will use Clarion for booooring databases and Windev for attractive apps.
Publicado em janeiro, 26 2024 - 8:17 PM
Ah no it was very specified software in industry field.
Cheers :)
Membro registado
55 mensagems
Popularité : +2 (2 votes)
Publicado em janeiro, 29 2024 - 12:15 PM
Hello Vlad,
you can use indirection to loop variables or controls
Take a look at https://help.windev.com/en-US/index.awp…

sMyVar1, sMyVar2, sMyVar3, sMyVar4, sMyVar5 is string= ("NoValue", "NoValue", "NoValue", "NoValue", "NoValue")

Trace("BEFORE", sMyVar1, sMyVar2, sMyVar3, sMyVar4, sMyVar5)

sVarName is string
FOR i=1 TO 5
sVarName="sMyVar"+i
{sVarName, indVariable}=sVarName+" value is "+(i*10)
END

Trace("AFTER", sMyVar1, sMyVar2, sMyVar3, sMyVar4, sMyVar5)


Hope this helps
Andrea
Publicado em fevereiro, 02 2024 - 8:36 AM
Thanks Andrea :)
Seems this is it, just it made in more heavy way :)