rejetto forum

an infinite loop

Mars · 2 · 1702

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2045
    • View Profile
Here is craftiness to fill the log with the macro RENAME

create an new real folder
create a file named old.txt
put the attached hfs.diff.tpl into the new folder

and include the [on macro rename] section in the

Quote from: hfs.diff.tpl
{.add to log|hfs.diff.tpl: macro rename|color=red.}

Quote from:
[+on macro rename]
{.add to log| macro rename

It is as in a play of ping-pong  :D

old-name >> new-name >> old-name >> new-name >> old-name >> new-name >> ........

It is beautiful the recursion, especially when we do not know where it is necessary to use it. ;D ;D

+ running a {.rename.} during [on macro rename] won't fire the event again (but you can override this with parameter "recursive")
« Last Edit: March 09, 2010, 01:43:39 PM by Mars »

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13346
    • View Profile
you may need multiple automatic renaming rules. in such case you may need to control when to stop recursion.
if you are using the "recursive" parameter then you are supposed to know what you are doing.
you can use an {.if.} to decide to stop recursion.
point is: it's off by default.
if you want to deliberately make an infinite loop there is an easier way: {.while|timeout=0.} ;)
« Last Edit: March 09, 2010, 01:49:37 PM by rejetto »