| Stonefield Query SDK |
| About.Settings |
Parameters
A reference to the Stonefield Query Application object.
Return Value
An XML string defining the settings to display in the About dialog. The format for the XML is as follows:
<settings>
<setting>
<description>Setting Description</description>
<value>Current value</value>
<link>Yes or No</link>
<linkexpr>Link expression</linkexpr>
</setting>
<setting>
<description>Setting Description</description>
<value>Current value</value>
<link>Yes or No</link>
<linkexpr>Link expression</linkexpr>
</setting>
...
</settings>The following elements are available:
However, if you want something different to occur, such as calling a script or an external application, specify that for this element.
Example
Here's an example that adds the name of the current database and ODBC driver used to access it to the list of settings in the About dialog:
Visual FoxPro
lparameters toApplication as SQApplication
local loDatabase as Database, lcXML
loDatabase = toApplication.DataEngine.Databases.GetMainDatabase()
lcXML = '<settings>' + ;
'<setting>' + ;
'<description>Current database</description>' + ;
'<value>' + loDatabase.DataSourceName + ' (' + ;
loDatabase.CurrentDataSource.Driver + ')</value>' + ;
'</setting>' + ;
'</settings>'
return lcXML VBScript
function Main(Application)
dim MainDatabase
set MainDatabase = Application.DataEngine.Databases.GetMainDatabase()
Main = "<settings>" & _
"<setting>" & _
"<description>Current database</description>" & _
"<value>" & MainDatabase.DataSourceName & " (" & _
MainDatabase.CurrentDataSource.Driver & ")</value>" & _
"</setting>" & _
"</settings>"
end function JavaScript
function Main(Application) {
var MainDatabase = Application.DataEngine.Databases.GetMainDatabase() ;
var cXML = "<settings>" +
"<setting>" +
"<description>Current database</description>" +
"<value>" + MainDatabase.DataSourceName + " (" +
MainDatabase.CurrentDataSource.Driver + ")</value>" +
"</setting>" +
"</settings>" ;
return cXML ;
}This code calls the GetMainDatabase method of the Databases collection of the DataEngine object of the passed Application object to return a Database object containing properties for the main database. It then builds an XML string with a single setting: the current database name and the driver used to access it. The DataSourceName property of the Database object contains the former and the Driver property of the CurrentDataSource member contains the latter. The XML string is then returned.
See Also
Scripts
| Last Updated: 02/05/2008 |