I guess that brings up a good point about my use of the word "background". When I said background before, I just meant that you were able to update the dialog in the UI while the agent was running, but the rest of the Notes client is still unusable until the agent finishes. That's not a "true" background process as you describe, which allows you to keep working as the agent runs.
By the way, when are you going to start blogging?
Voytek: There might have been some caching going on somewhere that caused you to get the old file -- I used the same file name for the 1.0, 1.1, and 1.2 versions of the database. I just updated the zip file name on the tips page, so please try again. Or you can just use this link:
Please tell me if that link still doesn't work. The new agent is called "StatusBoxTest (LS2J)", and can be run either from the Actions menu when the database is open or from the Agent list in Designer.
There is one particular place in BlogSphere where this would be perfect. When the configuration document is updated there is a script that updates all documents in the DB. It's currently using the WinAPI to do a progress bar but this would be so much nicer...
Can you do a double progress bar? Kind of like an overall progress. Then if your agent does a few different things there is a progress bar to show the complete agent and a second one to show the progress of each section of the agent.
In some cases it was because I was reusing Java wrappers I had written for other things, and I just cut and pasted in the database.
To me, it's a little more straightforward to try/catch errors in Java, so in some cases it may have been that as well.
Also, I happen to think it's a pain to call overloaded Java methods using LS2J, so that might be part of it.
Finally, since there are known memory leaks in LS2J (no one seems to know exactly what they are, but we all know they're there), it's sometimes safer to do as much processing as possible in "native" Java, since the leaks seem to be more prominent as you pass more information back and forth using LS2J calls.
But you're right: most if not all of the code could probably be handled directly in LotusScript. A lot of it is just a preference as much as anything else.
But, as usual, nice one Julian