Manage Learn to apply best practices and optimize your operations.

Do While Loop In @Functions

For those of us that wish Lotus had created an @DoWhile here is something that
will work.

The loop does have a limit of about 250 iterations and you will have to code
that into the loop or you may cause notes to crash.

In this example I have created a document that has a number field on it called
"Test". The DoWhile loop is activated by an action button, but you may run it
on any "event" that will allow you to run a agent.

Create an agent and set it to "Run Once (@Commands may be used)". My agent is
called "(Test)".

Here is the code for the agent. You will have to adapt the code for your use.
FIELD TestField := TestField;
Tmp :=
@If(@TextToNumber(@Environment("TestEnv"))="";0;@TextToNumber(@Environment("Test
Env")));
@If(Tmp < 250;@Do(@SetField("TestField";Test Field+
1);@SetEnvironment("TestEnv";@Text(tmp
+1));@Command([ViewRefreshFields]);@Command([ToolsRunMacro];"(Test)"));@Do(@SetE
nvironment("TestEnv";"");))

Dig Deeper on Domino Resources - Part 3

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close