 |
dBworxPE Help File |
 |
Design |
 |
Special Field Types |
 |
Operation |
 |
Listings, Reports and Labels |
 |
Templates |
|
|
FORMULA FIELDS:
Formula field: code = F
Formula fields allow the user to define fields which are the result
of a calculation or "formula" of some type, involving a combination
of fields, variables, and constants. For example:
@Unit Price>*>@Quantity Sold>*0.8>
In the above formula, whatever value is in the "Unit Price" field
is multiplied by the value in the "Quantity Sold" field, and that
amount is then multiplied by 0.8. Note that dBworxPE fields must be
preceeded by the "@" sign; also, field names entered must match the
actual field names exactly and are case sensitive -- you must match
the case of the actual field name as well.
Another example:
Your first name is >&>@First Name>
This example concatenates or joins two strings; the phrase "Your
first name is" and the contents of the field called "First Name".
The operators that can be used in formulas are:
+ Add two numbers
- Subtract two numbers
* Multiply two numbers
/ Divide two numbers
^ Raise a number to a power (e.g., 5 ^ 3 = 5 x 5 x 5 = 125)
& Join two strings
You also have a number of built-in "functions" that you can use in
creating formulas:
!mid -- returns a portion of a field value
example: [!mid>@Name>1>5>] (returns 1st 5 char)
!sin -- returns the sine of a given angle
example: !sin>@angle>
!cos -- returns the cosine of a given angle
example: !cos>@angle>
!tan -- returns the tangent of a given angle
example: !tan>@angle>
!asin -- returns the arcsine of a given angle
example: !asin>@angle>
!acos -- returns the arccosine of a given angle
example: !acos>@angle>
!atan -- returns the arctangent of a given angle
example: !atan>@angle>
NOTE:
If you use Webforms for data input you can also make use of
javascript, vbscript or java functions in creating formulas --
adding 'if' statements or complex logical expressions for
example.
|