expression

From Free Pascal wiki
Revision as of 21:02, 18 April 2019 by Kai Burghardt (talk | contribs) (create)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Template:Translate An expression is a non-productive rule that resolves by calculation into a value. They consist of at least one operand, and additional operands may be linked via non-unary operators. An operand may be

  • a literal value of any type
  • a variable or constant identifier, or
  • a function call.

Examples of expressions are:

  • x + 5
  • 'Z'
  • response <> 42

Expressions, and parts thereof, can be classified by their result type. Usually primarily arithmetic and logic expressions are distinguished. An arithmetic expression results in a numeric value. A logic expression results in a Boolean value.

remarks

With {$extendedSyntax on} a function call as an expression can appear as a statement, too.

see also