Quote from Igor-13 on February 10, 2023, 7:22 pmPlease tell me:
There are 50 text output elements (Inscription/Text) on the page.
Each element has its own name, for example Text600.
All subsequent Text601, Text602, Text603 and so on up to Text649.
How can I change the name of the element in order to loop through all the elements.
For example, to update their content?Подскажите пожалуйста:
На странице находятся 50 элементов для вывода текста (Надпись/Текст).
Каждый элемент имеет своё имя, например Text600.
У всех последующих Text601, Text602, Text603 и так до Text649.
Как можно изменять имя элемента чтобы в цикле перебрать все элементы.
Например чтобы обновить их содержание?
Please tell me:
There are 50 text output elements (Inscription/Text) on the page.
Each element has its own name, for example Text600.
All subsequent Text601, Text602, Text603 and so on up to Text649.
How can I change the name of the element in order to loop through all the elements.
For example, to update their content?
Подскажите пожалуйста:
На странице находятся 50 элементов для вывода текста (Надпись/Текст).
Каждый элемент имеет своё имя, например Text600.
У всех последующих Text601, Text602, Text603 и так до Text649.
Как можно изменять имя элемента чтобы в цикле перебрать все элементы.
Например чтобы обновить их содержание?

Quote from emo on February 10, 2023, 10:22 pmHi @Igor-13
Try this:
Loop "600" "649" "[pos]" SetObjectCaption "Text[pos]" "caption text [pos]" EndLoop
Hi @Igor-13
Try this:
Loop "600" "649" "[pos]" SetObjectCaption "Text[pos]" "caption text [pos]" EndLoop

Quote from rcohen on March 13, 2023, 1:51 amHi @emmanuel-fernandez,
Since I came here to ask questions about loops, perhaps you won't mind my hijacking this thread ;-)
I have a loop that runs very large lists. I would like to be able to create both, a pause button and an abort (stop) button. The trouble is that the mouse and keyboard are more or less frozen during a looping process, so I'm a bit unclear on how I can operate both a pause and a stop (abort) from buttons.
This next question isn't about loops exactly but is IN my loop. I wish to trap file access errors and so I have unchecked "show errors" in the pub setup and I'm working with [LastError]. Since this variable is in a loop, I do not know if I need to manually set the variable to null via setvar, OR if this value automagically clears itself after the next operation?
Thanks guys
Since I came here to ask questions about loops, perhaps you won't mind my hijacking this thread ;-)
I have a loop that runs very large lists. I would like to be able to create both, a pause button and an abort (stop) button. The trouble is that the mouse and keyboard are more or less frozen during a looping process, so I'm a bit unclear on how I can operate both a pause and a stop (abort) from buttons.
This next question isn't about loops exactly but is IN my loop. I wish to trap file access errors and so I have unchecked "show errors" in the pub setup and I'm working with [LastError]. Since this variable is in a loop, I do not know if I need to manually set the variable to null via setvar, OR if this value automagically clears itself after the next operation?
Thanks guys

Quote from Vadim on March 13, 2023, 8:06 am@rcohen
Hi Robert!
a) Instead of Loop you can use While and in its condition check the value of variable (play \ stop). The value of the variable can be changed in the subroutine (including hotkeys). Although inside Loop you can also check the value of the desired variable and in case of a stop do ExitLoop.
b) Yes, as far as I know the [LastError] variable is cleared after the next successfully executed command. You can check this on a test project by hiding the error between other lines of code.
Hi Robert!
a) Instead of Loop you can use While and in its condition check the value of variable (play \ stop). The value of the variable can be changed in the subroutine (including hotkeys). Although inside Loop you can also check the value of the desired variable and in case of a stop do ExitLoop.
b) Yes, as far as I know the [LastError] variable is cleared after the next successfully executed command. You can check this on a test project by hiding the error between other lines of code.

Quote from rcohen on March 13, 2023, 8:24 amThanks @vadim.
It was the DoWhile that I was struggling to recall.... thanks for kicking the memory bank ;-)
I would like to have tested it but I can't force an error in this case ;-0 I think it resets too but wasn't sure.
Thanks again
Thanks @vadim.
It was the DoWhile that I was struggling to recall.... thanks for kicking the memory bank ;-)
I would like to have tested it but I can't force an error in this case ;-0 I think it resets too but wasn't sure.
Thanks again

Quote from DaviddeArgentina on March 13, 2023, 5:51 pmHi Robert,
consider putting a delay "10" inside the while, to "distract" the control of the process and that it can be more "controllable", pausing or ending the loop
my 0.01
Hi Robert,
consider putting a delay "10" inside the while, to "distract" the control of the process and that it can be more "controllable", pausing or ending the loop
my 0.01
Quote from Gaev on March 13, 2023, 6:34 pm@rcohen
Before one can propose a solution, there need to be some questions answered first ...
1) can you put a number to 'very large lists' ?
2) can you post an example of the commands to be serviced per iteration of the loop ?
3) how many seconds/minutes does it take to go through the whole list ?
4) What is the purpose of the Pause and Abort Buttons ? ... are they related to any errors (i.e. [LastError]) reported by the pub or just because the user is impatient ?
5) Does the Pause process require another button to Resume the loop ?
I would like to have tested it but I can't force an error in this case ;-0 I think it resets too but wasn't sure.
Inside your loop, add these commands temporarily ...
If "[LoopCounter]" "=" "20" ... force an error Math "[aaa]/0" "0" "[bbb] EndIf SetVar "[errorResult]" "[LastError]"
... and have a TextBox with its content set to [errorResult]
If the TextBox only flashes the error temporarily, then you can assume that [LastError] is being reset.
Before one can propose a solution, there need to be some questions answered first ...
1) can you put a number to 'very large lists' ?
2) can you post an example of the commands to be serviced per iteration of the loop ?
3) how many seconds/minutes does it take to go through the whole list ?
4) What is the purpose of the Pause and Abort Buttons ? ... are they related to any errors (i.e. [LastError]) reported by the pub or just because the user is impatient ?
5) Does the Pause process require another button to Resume the loop ?
I would like to have tested it but I can't force an error in this case ;-0 I think it resets too but wasn't sure.
Inside your loop, add these commands temporarily ...
If "[LoopCounter]" "=" "20" ... force an error Math "[aaa]/0" "0" "[bbb] EndIf SetVar "[errorResult]" "[LastError]"
... and have a TextBox with its content set to [errorResult]
If the TextBox only flashes the error temporarily, then you can assume that [LastError] is being reset.

Quote from rcohen on March 13, 2023, 10:20 pmHi @gaev
That's a great idea, thank you. I have added this to my local tips and trix archive.... it never occurred to me that I could CREATE an error ;-) The visual of crash test dummies comes to mind ;-)For now I have the issue solved. When I enter a long loop, my mouse generally spins up a "busy pointer". But it never occurred to me that I could just position and click as once you move the mouse the busy pointer vanishes... Imagine my surprise LOL ;-)Thanks all who offered solutions.
Hi @gaev