Majik Primer: MoI's Lighting Options and You!

 From:  Michael Gibson
5222.32 In reply to 5222.31 
Hi dinos, yes even though I don't think there's anything that uses it currently, a script can save something to the moi.ini file by passing true for the 3rd parameter value in setOption(), like: moi.command.setOption( 'name', value, true ) - that will save it under a [Commands] section of moi.ini . Then when you read it back in use moi.command.getOption( 'name', true ); , and also be aware that getOption will throw an exception if the value does not exist so you usually need to put it in a try / catch block.

For the name it's good to make sure it's not too generic to avoid future collisions, usually sticking the name of the .htm file or command at the start of the name is a good idea, like 'LightingOptions.htm_value', rather than just plain 'value' for the name.

- Michael