Hi Len, both getOption and setOption need to have the "use ini" parameter added.
If you call moi.command.getOption( 'ArcCAM.htm_test' ) that will get it from the runtime storage.
You need to call moi.command.getOption( 'ArcCAM.htm_test', true ) to get it from ini storage.
You don't want to have a mismatch with the get coming from runtime storage and the set going to ini storage.
It's good to have the get wrapped in a try / catch block to handle the exception that will be triggered if there isn't any value present.
var value = false;
try {
value = moi.command.getOption( 'ArcCAM.htm_test', true );
} catch(e) {}
It would probably have been better for this to return undefined if no value had ever been set rather than throwing an exception but it's difficult to change things that are in use.
- Michael
|