This script is called when the user clicks the OK button in the Options dialog if you've defined any custom options settings in an Options.Settings script. It gives you an opportunity to do something about the changes, such as storing a value in another location.

Parameters
A reference to the Stonefield Query Application object and an XML string containing the key values, former values, and new values of all custom options. The format for the XML is as follows:

<settings>
  <setting>
    <key>Registry key</key>
    <old>Former value</old>
    <new>New value</new>
  </setting>
  <setting>
    <key>Registry key</key>
    <old>Former value</old>
    <new>New value</new>
  </setting>
  ...
</settings>

The following elements are available:

Return Value
Any value (Stonefield Query ignores the return value).

Example
Here's an example that updates a custom property of the Application object when a change is made to the custom AR Location setting.

Visual FoxPro

lparameters toApplication as SQApplication, tcSettingsXML
local loXMLDOM as MSXML.DOMDocument, lcDirectory
loXMLDOM = createobject('MSXML.DOMDocument')
loXMLDOM.ASync = .F.
loXMLDOM.LoadXML(tcSettingsXML)
lcDirectory = loXMLDOM.selectSingleNode('/settings/setting[key = "AR Location"]').childNodes(2).text
toApplication.ARLocation = lcDirectory
return

VBScript

function Main(Application, SettingsXML)
dim XMLDOM
set XMLDOM = createobject("MSXML.DOMDocument")
XMLDOM.ASync = False
XMLDOM.LoadXML(SettingsXML)
Directory = XMLDOM.selectSingleNode("/settings/setting[key = 'AR Location']").childNodes(2).text
Application.ARLocation = Directory
end function

JavaScript

function Main(Application, SettingsXML) {
var XMLDOM, Directory ;
XMLDOM = new ActiveXObject('MSXML.DOMDocument') ;
XMLDOM.ASync = false ;
XMLDOM.LoadXML(SettingsXML) ;
Directory = XMLDOM.selectSingleNode('/settings/setting[key = "AR Location"]').childNodes(2).text ;
Application.ARLocation = Directory ;
return ;
}

See the topic for the GetRegistryValue method of the Application object for an example that uses these options.

See Also
Options.Settings | Options.Validate | Scripts