Setting examples and output results of calculation-formulas and edit-formulas (text field/numeric field)
This section describes how to set basic calculation-formulas and edit-formulas for text fields and numeric fields, and explains the behavior of the field buffer in each case.
For text fields
Examples with the following conditions are used to explain how to set basic calculation-formulas and edit-formulas in a text field, and to explain the field buffer.
Specify data by enclosing it in double quotation marks (" ").
Prerequisite | When the following data are entered from the higher-level application
A dummy field (text field) "DUM" is created as a reference field. |
|---|---|
Input data only | To print the input data in the "NAME" field without making any changes
|
Input data+Calculation-formula (input field) | To edit the input data using the calculation-formula, and print the result
|
Input data+Edit-formula (input field) | To edit the input data using the edit-formula, and print the result ReferenceBecause the result of an edit-formula does not replace the field buffer value, "John Smith" is stored in the field buffer.
|
Input data+Calculation-formula (using edit functions) | To edit the data in the field "NAME" with the edit function
|
Input data+Edit-formula (using edit functions) | To edit the data in the field "NAME" with the edit function
|
Input data+Calculation-formula (using edit functions)+Edit-formula | To edit the data in the field "NAME" with the edit function
|
Specify the output data as a fixed value (calculation-formula) | To specify the output data in the "DUM" field using the calculation-formula
|
Specify the output data as a fixed value (edit-formula) | To specify the output data in the "DUM" field using the edit-formula
|
Specify the output data as a fixed value (calculation-formula+edit-formula) | To specify the output data in the "DUM" field with the calculation-formula and the edit-formula ReferenceAs "Calculation-formula" is specified in the calculation-formula of the "DUM" field, "Calculation-formula" will be stored as the value of the field buffer. However, as "Edit-formula" is specified in the edit-formula, the value of the edit-formula will be output as the printing result. However, if you refer to the "DUM" field from another field, "Calculation-formula" will be retrieved as the value, since the value of the field buffer will be referenced.
|
Refer to the output data from other fields (calculation-formula) | To refer to the "NAME" field data from the "DUM" field and print the data
|
Refer to the output data from other fields (edit-formula) | To refer to the "NAME" field data from the "DUM" field and print the data
|
Output date
Retrieve the output data from edit functions (calculation-formula) | To output the system date in the "DUM" field as text-type data
|
|---|---|
Retrieve the output data from edit functions (edit-formula) | To output the system date in the "DUM" field as text-type data
|
Retrieve the output data from edit functions (calculation-formula)+edit-formula | To acquire the system date in the "DUM" field using the calculation-formula, and output after converting it to text-type data by using the edit-formula ReferenceAs DATE is specified in the calculation-formula, the calculation result of DATE "20100110" will be saved as the field buffer value of the "DUM" field. So, you can output the value as text-type data in YYYY/MM/DD format (such as "2010/01/10") by referring to the "DUM" field as a DTOC function parameter in the edit-formula.
|
For numeric fields
Examples with the following conditions are used to explain how to set basic calculation-formulas and edit-formulas in a numeric field, and to explain the field buffer:
Prerequisite | When the following data are entered from the higher-level application
A dummy field (numeric field) "DUM" is created for calculation. ReferenceIn the edit-formula, the calculation results must be specified as text-type data. Therefore, when specifying numeric data, use the FORMAT function to convert to text-type data. |
|---|---|
Input data only | To print the input data in the "UNIT_PRICE" field without making any changes
|
Input data+Calculation-formula (calculated using the input field) | To edit the input data using the calculation-formula, and print the result
|
Input data+Edit-formula (calculated using the input field) | To edit the input data using the edit-formula, and print the result ReferenceBecause the result of an edit-formula does not replace the field buffer value, the entered value of "1000" is stored in the field buffer.
|
Input data+Calculation-formula (calculated by referring to data in a different field) | To print the calculated values in the "UNIT_PRICE" field by using the input data in the "QUANTITY" field
|
Input data+Edit-formula (calculated by referring to data in a different field) | To print the calculated values in the "UNIT_PRICE" field by using the input data in the "QUANTITY" field
|
Input data+Calculation-formula (calculated by using edit functions) | To edit the input data in the "UNIT_PRICE" field using edit functions
|
Input data+Edit-formula (calculated by using edit functions) | To edit the data in the "UNIT_PRICE" field using edit functions ReferenceIn the edit-formula, the calculation results must be specified as text-type data. Therefore, when specifying numeric data, use the FORMAT function to convert to text-type data.
|
Input data+Calculation-formula (using edit functions)+Edit-formula (using the buffer value itself) | To edit the input data in the "UNIT_PRICE" field using edit functions
|
Specify the output data as a fixed value (referenced using calculation-formula) | To specify the output data in the "DUM" field using the calculation-formula
|
Specify the output data as a fixed value (referenced using edit-formula) | To specify the output data in the "DUM" field using the edit-formula ReferenceBecause the result of an edit-formula does not replace the field buffer value, the default value of "0" will be stored when a calculation-formula is not specified.
|
Specify the output data as a fixed value (calculation-formula+edit-formula) | To specify the output data in the "DUM" field with the calculation-formula and the edit-formula ReferenceAs "QUANTITY" * "UNIT_PRICE" is specified in the calculation-formula of the "DUM" field, 5000 (QUANTITY * UNIT_PRICE) will be stored as the value of the field buffer. However, as "UNIT_PRICE" * 1.05 is specified in the edit-formula, the calculation results specified in the edit-formula will be output as the printing result. If you refer to the "DUM" field from another field, the value of 5000 (QUANTITY * UNIT_PRICE) will be retrieved as the value, since the value of the field buffer will be referenced.
|
Specify the output data as a fixed value (calculation-formula+edit-formula) | To specify the output data in the "DUM" field with the calculation-formula and the edit-formula ReferenceIf the name of the field itself is specified in the edit-formula, calculations will be done based on the field buffer value of the field itself. As "QUANTITY" * "UNIT_PRICE" is specified in the calculation-formula of the "DUM" field, 5000 (QUANTITY * UNIT_PRICE) will be stored as the value of the field buffer. As the name of the field itself is specified in the edit-formula, calculations will be done based on the calculation results specified in the calculation-formula (field buffer value) and "5,250" will be printed as a result.
|