formulavalue(
DATABASE
,
FORMULA
)
The formulavalue( function calculates the result of a formula based on data in the current record of any open database. This is similar to the fieldvalue( function, but allows any formula to be used, rather than just a single field.
Parameters
This function has two parameters:
database – is the database that you want to grab data from. This database must be currently open. If this parameter is ""
then the current database will be used.
formula – is the formula to be used to retrieve data. If the formula is specified inline in the function itself, it must be quoted (see Quotes). Otherwise, you can pre-store the formula in a field or variable.
Description
The function returns data from the specified database. Unlike the superlookup( function, the formulavalue( function does not search for the data, it simply uses whatever data is in the currently active record of the specified database.
This example grabs the current address from a Mailing List database, in mailing label format.
formulavalue("Mailing List",{First+" "+Last+cr()+Address+cr()+City+", "+State+
" "+Zip+sandwich(cr(),Country,"")}
See Also
- Arithmetic Formulas -- mathematical operators and functions.
- Characters and Unicode Values -- working with individual characters of text.
- Constants -- values embedded into a formula.
- Date Arithmetic Formulas -- performing calculations on dates, and converting between dates and text.
- Formula Workshop -- formula workshop wizard for testing and experimenting with formulas.
- formulacalc -- allows you to evaluate a formula that you were not able to
code into the procedure when it was being written.
- Formulas -- basics of formulas: components and grammar.
- formulavalue -- calculates the result of a formula. Usually this is done with an assignment statement (for example `x=2 * y` ), but the *formulavalue* statement gives you more flexibility. You can specify what database is to be used for the calculation (an assignment statement always uses the current database) and you can specify the formula using a variable, making it easy to change on the fly. This statement also gives you more control over how errors are handled.
- FormulaValue --
- Functions -- index of all functions available for use in Panorama formulas.
- grabdata( --
- Linking with Another Database -- multiple database files working together.
- makemergeformula( -- builds a formula from an “auto-wrap" style merge template.
- Non Decimal Numbers -- working with numbers in alternate (non-decimal) bases, including binary, octal and hexadecimal.
- Numbers -- Working with numeric values in a formula, and converting between numbers and text.
- Operators -- index of all operators available for use in Panorama formulas.
- Quotes -- text constants embedded into a formula
- Statements -- index of all statements available for use in Panorama procedures.
- SuperDates -- date and time combined into a single value.
- Tag Parsing --
- Text Formulas -- manipulating text with a formula (concatenation, extraction, rearranging, etc.)
- Time Arithmetic Formulas -- performing calculations on times, and converting between times and text.
- True/False Formulas -- logical boolean calculations.
- Using Fields in a Formula -- accessing database fields within a formula.
- Values -- the raw material that formulas work with -- numbers and text.
- Variables -- storing and retrieving individual items of data, not part of a database.
History
10.0 | New | New in this version. |