Home > LotusScript > Recompile Lotus Notes Agents When Script Libraries Change.

Recompile Lotus Notes Agents When Script Libraries Change.

If you make changes to a script library in Lotus Notes, it’s sometimes difficult to know when you have to recompile all the Notes agents that call the script library and when you don’t. Here are some observations I’ve made.If you change the signature of a function, sub, or class method, you have to recompile for not have error when use.

If Notes agent uses a constant value from a script library and a constant in a script library is changed:

* if the Notes agent is run in Debug mode, the new constant is used
* if the Notes agent is run manually or scheduled, the old constant is used (even if you just ran it in Debug mode and saw the new variable)
* if the Notes agent is opened, saved with CTRL-S (with no changes having been made to the agent), and closed, the old constant is still used
* if the Notes agent is opened, modified, and saved with CTRL-S, the new constant is used
* if the Notes agent is recompiled using the API, the new constant is used

I think the reason why the old constants stick around is because when the LotusScript is compiled, the LotusScript bytecode contains the translated value of the constant, not a reference to the constant. This is good programming as far as bytecode optimization is concerned, but bad if you change the constant in the script library, because the agent never looks back at the script library to check the value of the constant.

Because I am not the only reference to the bytes of signature, function and content they want, including your own, such as diving and in the library of functions and code changes so far concern diving beauty.
In other words, whenever an agent wants to run a function or a sub from a script library, it always runs it from the LotusScript library. So if you change the content of a function or sub in a library (and leave the signature alone) and don’t re-save your agent, your code changes will still be recognized.

Viewed 5993 times by 1638 viewers

  1. No comments yet.
  1. No trackbacks yet.