Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I´m having trouble inserting a variable into a loop. When I have only the first segment I get no data, it makes no itineration. When I have the data from the second segment I get all the data.
In the next lines on the first segment the loop, on the second segment the code for the loop expanded.
I think the problem is in the this part do while vTotalCount=0 but not sure how to change the syntax
First Segment
do while vTotalCount=0
call Registros($(vTimeStamp))
Let vTimeStamp = Peek('TimeStamp',-1,'Clients');
Let vTotalCount = Peek('TotalCount',-1,'MetaCollectionResult');
loop
Second Segment
// call Registros($(vTimeStamp))
// Let vTimeStamp = Peek('TimeStamp',-1,'Clients');
// Let vTotalCount = Peek('TotalCount',-1,'MetaCollectionResult');
// call Registros($(vTimeStamp))
// Let vTimeStamp = Peek('TimeStamp',-1,'Clients');
// Let vTotalCount = Peek('TotalCount',-1,'MetaCollectionResult');
// call Registros($(vTimeStamp))
// Let vTimeStamp = Peek('TimeStamp',-1,'Clients');
// Let vTotalCount = Peek('TotalCount',-1,'MetaCollectionResult');
You could try to change from a While statement to an Until statement un your loop. Take a look at the help page Do..loop .
do until vTotalCount=0
…
loop
Or you can change the condition
do while vTotalCount <> 0
…
loop
What if you declare the variable in prior to the loop? Like this.
Set vTotalCount=0;
do while vTotalCount=0
call Registros($(vTimeStamp))
Let vTimeStamp = Peek('TimeStamp',-1,'Clients');
Let vTotalCount = Peek('TotalCount',-1,'MetaCollectionResult');
loop
Vegar hi
I tried but it only makes the first loop although when it finish, the variable vTotalCount is equal to 117 and stops....
I don't follow.
If vTotalCount is equal to 117, then the loop should stop. You o not want to loop if it is equal to zero or do I misunderstand your concern?
Vegar hi
I want the loop to go until the variable is equal to 0.
The variable values are: 117, 60, 17 and 0
Should I change the condition?
You could try to change from a While statement to an Until statement un your loop. Take a look at the help page Do..loop .
do until vTotalCount=0
…
loop
Or you can change the condition
do while vTotalCount <> 0
…
loop
Vegar hi
Thank you for your help