Language Elements and Reference:xpplrm

Expressions Foundation

An expression is also used in a program to determine a value. Expressions can only be evaluated at runtime of a program and they always return a value. Simple expressions reference only one single program element, such as a variable, a literal or a function call. Examples for simple expressions are:

? "Hundred"      // output of a character value     : Hundred 
? 100            // output of a numeric value       : 100 
? Sqrt(4)        // output of a function value      : 2 
? Date()         // output of a date                : 12/06/94 

Nested or complex expressions including a combination of several language elements along with operators can be created. This is shown in the following examples of assignments:

nNumber := 10                    // Simple literal 
nResult := nNumber + 90          // Variable plus literal 
nResult := nResult / (nNumber-5) // Variable divided by expression 

The operators that can be used in a complex expression depend on the data type of the variables, literals or function values.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.