EZSEvents

Functions

function askAnalysisComments( )
Replaces the Analysis | Comments menu command.
function askAnalysisCountWords( )
Replaces the Analysis | Count words menu command.
function askAnalysisRank( )
Replaces the Analysis | Rank Order menu command.
function askAnalysisReport( )
Replaces the Analysis | Report menu command.
function askAnalysisStats( )
Replaces the Analysis | Stats menu command.
function askAnalysisSummary( )
Replaces the Analysis | Summary menu command.
function askCreateASCII( )
Replaces the Utilities | Create a blank ASCII file menu command.
function askCreateSQL( )
Replaces the Utilities | Create SQL menu command (PRO only).
function askCustomText( )
Replaces the Custom Text menu command.
function askDataAddRecord( )
Replaces the Data | Add record menu command
function askDatabaseSetup( )
Replaces the File | Database Setup menu command
function askEmailFetch( )
Replaces the Publish | Read email function
function askEmailHTML( )
Replaces the Publish | Text/HTML menu command.
function askEmailImport( )
Replaces the Utilities | Import email message files menu command.
function askEmailText( )
Replaces the Publish | Text email menu command.
function askExportASCII( )
Replaces the File | Export to ASCII menu command in the View/Edit Data windows.
function askMailManager( )
Replaces the Bulk Email menu command. If typeof(form) == 'undefied', no project is presently open.
function askTableLayout( )
Replaces the Table Wizard dialog. Include form.refreshEditor.
function askWebAdminister( )
Replaces the Publish | Administer web site menu command.
function askWebAdvanced( )
Called by the Advanced button in web site setup to replace the default dialog.
function askWebCreate( )
If present, this event handler replaces EZSurvey's web site generation code.
function askWebDownload( )
Replaces the Publish | Download web data now command.
function askWebPasswords( )
Called by the Passwords button in web site setup to replace the default dialog.
function askWebPreview( )
Replaces the web site preview function.
function askWebPublish( )
If present, this event handler replaces EZSurvey's web site generation code. Has a lower priority than askWebCreate.
function askWebSQL( )
Called by the SQL button in web site setup to replace the default dialog.
function askWebTemplate( )
Replaces the web site appearance dialog.
function onDataImport( )
Runs when data are imported from the web or email. database.selectedQuestion is set to the first row of new data in the database.
function onDatabaseSetup( )
Called after askDatabaseSetup() runs, and after the database has been reloaded. In the plugin, write <script name=onDatabaseSetup validate=1 database=1> do_something(); form.refreshEditor = true; </script>
function onPalmCreate( )
Called after a Palm form is created, but before the instructions are printed.
function onStartup( )
Runs when the program starts.
function onWebCreate( )
If the default EZS web page generation is used, this is run after the web site files are set up, but before the WEB.ODBC.MAKESQL option is processed.
function runEmailImport( )
Replaces the internal email parsing and importing function. This will be called if askEmailFetch is not installed. Pre-set variables are form, database, and files, a list of file names to parse.

EZSPage

Properties

dataString HTML data
hiddenString Comma-delimited list of all the hidden fields on the page. Server and client-side validation scripts are scanned for field names to determine whether a hidden field needs to be included on a particular page. Otherwise, all the hidden fields go on the last page.
nameString Page name
nextString Name of the next page (or blank if the last)
questionsString Comma-delimited list of all the visible fields on the page
requiredRecord Names of fields that are required and their corresponding error messages.
validateJSString JS server-side validation code
validatePerlString Perl server-side validation code

EZSurvey

Properties

dataRecord Global object: Data values if the script was invoked from the onDataImport() method.
databaseTable Global object for manipulating the active database.
database.selectedRecordNumber 1-based index of the selected record (if the script was invoked from the Data view).
filesArray Global object: Array of file names to process.
formForm Global object for manipulating the active form.
form.selectedQuestionNumber 0-based index of the selected question.

Functions

function ezsurvey.askOpenFile( title String, file name String, file types String) returns String
title Dialog box title
file name Default file name
file types String of the form "Data Files|*.DAT|"
Shows a dialog box to prompt for a file name.
function ezsurvey.askSaveFile( title String, file name String, file types String) returns String
title Dialog box title
file name Default file name
file types String of the form "Data Files|*.DAT|"
Shows a dialog box to prompt for a file name. If the file exists, the user will be asked whether the file may be overwritten.
function ezsurvey.closeWindow( handle Number) returns Boolean
handle Window handle from openFile(), openText(), or openHTML()
Asks the specified window to close itself. Returns true if successful.
function ezsurvey.createBlankAsciiFile( out Stream, in Form)
out Output stream
in Form
Creates a tab-delimited list of fields.
function ezsurvey.createDirectory( dirname String) returns Boolean
dirname Full path name
Same as makeDirectory.
function ezsurvey.createTableSQL( form Form, driver String, table name String) returns String
form The form
driver Driver name: ORACLE, WATCOM, MS, DB2, or ACCESS
table name New table title (schema.table)
Returns the SQL commands necessary to create the table. May throw an exception if there could be a problem with the SQL code.
function ezsurvey.decodePassword( password String)
password Encrypted password
The SCP password is encrypted in the form file. Use this function to decode it.
function ezsurvey.editMail( recip String, subj String, note String, html String, attach String) returns Boolean
,Opens the mail editor message. Here, you may attach files, as user intervention required before sending.
function ezsurvey.execForm( form String|Stream, data Record) returns Record
form EZF file name or stream containing an Electronic Form System document.
data Initial data to populate the form with. If not specified, a new record is created
If data entry was successful (OK/SAVE selected), returns a Record object with the form data. If unsuccessful, returns a null object.
function ezsurvey.exportData( form Form, in Table, out Stream, random ids? Boolean, index Stream, fields String)
form Form
in Input table
out Output table
random ids? Generate random ids?
index Output table
fields Columns to export (blank for all)
Useful for initializing ASC files.
function ezsurvey.findWindow( handle Number) returns Boolean
handle Window handle from openFile(), openText(), or openHTML()
Returns true if the window is still open.
function ezsurvey.fixImportData( form Form, data Record)
form Form object
data Data
Reformats date, time, number questions. If the form is marked as anonymous, the HOST field is replaced with a hash value.
function ezsurvey.generateHTML( form Form, template Record, javascript Boolean) returns EZSPage
form The form
template Template
javascript Is client-side validation to be used? Default=false.
Returns a EZSPage object, containing all questions on one page.
function ezsurvey.generateHTMLPages( form Form, template Record, javascript Boolean) returns Array
form The form
template Template
javascript Is client-side validation to be used? Default=false.
Returns an array of EZSPage objects.
function ezsurvey.generateText( form Form) returns String
form The form
Returns a text representation of the online form.
function ezsurvey.getFileBase( filename String)
Returns the filename without the type extension. ezsurvey.getFileBase('\\path\foo.bar') returns '\\path\foo'
function ezsurvey.getQuestionOptions( dialog Form, form Form, question Integer, titles Boolean) returns Boolean
dialog Output form
form Input form
question Question index (starts at 0)
titles Include page titles?
Builds a list of questions to describe question options in EZSurvey.
function ezsurvey.getTempPath( ) returns String
Returns the Windows temporary directory path.
function ezsurvey.makeDirectory( dirname String) returns Boolean
dirname Full path name
Builds a directory tree.
function ezsurvey.messageBoxYN( prompt String) returns String
prompt Dialog box text
Shows a dialog box with Yes and No buttons. Returns "YES" or "NO"
function ezsurvey.messageBoxYNC( prompt String) returns String
prompt Dialog box text
Shows a dialog box with Yes, No, and Cancel buttons. Returns "YES", "NO", or "CANCEL"
function ezsurvey.messageBoxYesNo( prompt String) returns String
prompt Dialog box text
Shows a dialog box with Yes and No buttons. Returns "YES" or "NO"
function ezsurvey.messageBoxYesNoCancel( prompt String) returns String
prompt Dialog box text
Shows a dialog box with Yes, No, and Cancel buttons. Returns "YES", "NO", or "CANCEL"
function ezsurvey.openFile( filename String) returns Number
filename File name
EZSurvey uses the file extension to determine what type of window to display. Returns an integer handle identifying the window, or zero if no window was created.
function ezsurvey.openHTML( text Stream, title String) returns Number
text Stream containing HTML
title Title
Opens a web browser window. The document is associated with the current project, and will close when the current project's form editor closes. Use openFile() instead if you want to open a URL. Returns an integer handle identifying the window, or zero if no window was created.
function ezsurvey.openText( text Stream, title String) returns Number
text Stream containing text
title Title
Opens a text edit window. The document is associated with the current project, and will close when the current project's form editor closes. Use openFile() instead if you want to open a text file. Returns an integer handle identifying the window, or zero if no window was created.
function ezsurvey.readTemplate( input Stream, template Record) returns Record
input Template data
template Template data
function ezsurvey.readTemplate( form Form, template Record) returns Record
form Form
template Template data
function ezsurvey.sendMail( recip String, subj String, note String, html String) returns Boolean
recip Recipient
subj Subject
note Text note
html HTML note
,To reduct the virus risk, you can't attach files. To send mail with attachments, instead create a new Mail object (password required) and use its send() function
function ezsurvey.setupWeb( options Record) returns Record
options form.options
Returns null if the user cancels the dialog box. Otherwise, it returns a Record (which may be empty) storing the HTML template.
function ezsurvey.translate( text String) returns String
text English text
Looks up the message in the RSRC/LANGUAGE.XML (if available) and returns the translation if available. If no translation is used, or the translation table is missing this message, it returns the input string.
function ezsurvey.updateProgress( current Number, max Number, title String)
current Current position
max Total process length
title Update the caption
Shows and updates the progress dialog. Use updateProgress(0,0,'title') to change the progress box text. It takes longer to update the text than it does to redraw the progress bar.
function ezsurvey.uploadFile( URL String, source String, destination String)
URL scp://username:password@host/directory/
source Source file name (fully-qualified)
destination Destination file name (relative to the URL directory)
Uses SCP to transmit files. SCP is controlled by a separate program, and monitored by a new window. Sorry, no return value to indicate success. The file will probably not finish sending before the function returns.
function ezsurvey.uploadFile( URL String, files Record)
URL scp://username:password@host/directory/
files List of (source=destination)
Transmits a list of files successively with SCP.