Use this script if you want to define additional file types for output in Stonefield Query. For example, if you want to output to Microsoft Excel files but perform special processing, you can use this script to define a new file type and a user-defined script to perform the actual output.

Parameters
A reference to the Stonefield Query Application object.

Return Value
An XML string defining the file output settings. The format for the XML is as follows:

<settings>
  <setting>
    <description>Setting description</description>
    <filetype>File extension</filetype>
    <script>Script name</script>
  </setting>
</settings>

The following elements are available:

Example
Here's an example that defines a new file type, Data Export File, with an xxx extension.

Visual FoxPro

lparameters toApplication as SQApplication
local lcXML
lcXML = '<settings>' + ;
  '<setting>' + ;
  '<description>Data Export File (*.xpt)</description>' + ;
  '<filetype>xpt</filetype>' + ;
  '<script>DataExportOutput</script>' + ;
  '</setting>' + ;
  '</settings>'
return lcXML

The DataExportOutput script generates a simple XML file with "DataSet" as the element name for each record:

lparameters toApplication as SQApplication, tcFileName, tcCursor
cursortoxml(tcCursor, 'lcXML')
lcXML = strtran(lcXML, tcCursor, 'DataSet')
strtofile(lcXML, tcFileName)

See Also
Scripts