Having worked with Deluge for a few weeks now, it's become clear that Deluge isn't a programing or scripting language. This inherently means that they don't include features like counted or conditional loops, infinite recursion, or other features that we find in Turing Complete languages.
While this can be frustrating for professional developers, they have good business reasons for maintaining a Finite State model rather than a Turing Complete model.
When you do a little searching around you'll find all sorts of workarounds for this, the most common one is to generate a list with x items and looping through that rather than using a simple for x to y format. You can then use a counted variable like you would in a while style loop.
Below is a function that should generate the list for you.
- list Utility.GetForList(int x)
- {
- d = "".leftpad(x);
- d = d.replaceAll(" ", ", ");
- l = d.toList(" ");
- return l;
- }
What other work arounds have you found for doing things that are common in Turing Complete languages?