![]() | |||||||||||||||
Regular variables containing text, numbers or date can be defined in one of the following ways:
To create a variable click the "Add Variable" button in the Script Designer and select a type:
By Math FormulaSet the value of the variable using a mathematical formula. In the formula you can use the values of other variables, database fields, queries, etc. Learn more about formulas... Examples [$orders] = queRecN(|All Orders|). Sets variable orders as the number of records from the All Orders query. [$orders] = [$orders]+[Quantity]. Increases the value of the [$orders] variable by the value of the Quantity field of the current record. Note: if you want to use the field values of the current record, don't forget to specify its type in the Use the following record type text box:
By Text FormulaSet the value of the variable using the text formula. Text Formula is a text string that consists of several elements such as values of the record fields, formulas, variables, system values, etc. Learn more about text formulas... Examples For example, there is a record with the First Name and Last Name fields that store the Thomas and Anderson values accordingly. [$full_name] =[First Name] [Last Name^text UCASE]. Sets full_name as value Thomas ANDERSON. ANDERSON capitalized, according to the UCASE formatting. [$full_name] = Dear [$full_name]. Adds prefix Dear to variable [$full_name]. Now [$full_name] equals to "Dear Thomas ANDERSON". Note: if you want to use the field values of the current record, don't forget to specify its type in the Use the following record type field:
By entering a textSet the value of the variable using the edit field. The user is offered to input the value of the variable directly while the script is being executed, for example:
The default value and the message text can be set by using text formulas. By selecting one value from a list or a popup menuThe user is offered to select a value on the list as the variable value. Options:
By default, this action puts the selected value (e.g., Moscow) to the variable. However, you can have the program put the value identifier instead of the actual value to the variable. To make that happen, the list items are to be defined as identifier > value pairs; for example:
In this case, the list will appear the same way, but the selection of, for instance, London will write 1 to the variable. This method is especially useful for the further
work with the values in formulas. For example, this way
you can make the tax selection:
Depending on the selected value, the variable will have 0, 17.5 or 5. The list text can be set by using text formulas. By selecting a date from the calendarIn this case, the user will be offered to select a date using the calendar:
Options:
By selecting a file using the "Open 'File' dialog box"In this case the standard Microsoft Windows "Open File..." dialog box will appear:
Options:
By using a formHere, the user is shown the selected form in a different window, and field values are inserted into the variables:
Learn more about this way of data entry...
| |||||||||||||||
|
Copyright (C) 2001-2010 Binary Brilliant Inc. All Rights Reserved. |