How to quit a loop?

player

Client
Регистрация
06.06.2011
Сообщения
154
Благодарностей
16
Баллы
0
Hi, what is the best way to quit a loop? Lets say i check a resource file and after 10 executions/loops of the template the file is empty. So everything was processed and after that i want to quit the loop. I can check this with the logic function and see that the file is empty.

To what do i connect the logic step branch? Some say an empty macro, some say a pause macro, but isn't there a better way? I want to get the message "template executed successfully". But if i can't quit a loop properly, i can't get this message.
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
You can exit from a loop with successful branch but during the loop execution go through unsuccessful
 

player

Client
Регистрация
06.06.2011
Сообщения
154
Благодарностей
16
Баллы
0
Sry, i don't understand. I know there is a successful exit and a failed release.

I check the string number in my resource file:

Number of Strings = 1? --> No --> failed release --> Loop continues

Number of Strings = 1? --> Yes --> successful exit --> Now i want to quit my template, but how? Do i connect the successful release to a pause, to an empty macros or to what to let a template execute successfully?
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
If there are no any branches after branch with logic you don't need any additional steps to exit successful. It will just exit successfully
 

player

Client
Регистрация
06.06.2011
Сообщения
154
Благодарностей
16
Баллы
0
Hmm, counting the strings of my resource file is one of the first steps. So there are many branches after the counting strings branch.

Reason for that: I don't want that ZP deletes my resource file. So i have an empty line in this file at the beginning and after that all my bookmarking sites. If the number of strings is 1 (the remaining empty line) the template execution should stop, because all bookmarking sites have been processed.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
If it bothers you so much just put a blank macro or a counter macro for the step out of your loop. Then template will give you successful execution. But I think that HB is right, execution of the branch with logic should give you success.
 

Stereomike

Client
Регистрация
29.03.2011
Сообщения
221
Благодарностей
30
Баллы
0
check if you used == or =
= assigns a value,
== does a comparison

Only == works for a logic test
(other variants= !=, >=,<=)
Very useful as well: && and || to tie several conditionals together.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)