returns the value of an expression.
# Metadata
Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:
# Syntax
the value of expression
# Params
- expression : Any expression. - object : Any object reference.
# Examples
the value of 22 + 3 -- returns 25
value(myVariable) -- returns value of the contents of myVariable
the value of the selectedLine -- returns the actual text of the line
value("the name of me", card 1) -- returns name of card 1
# Description
Use the value function to evaluate an expression, or to force LiveCode to evaluate an expression within a statement.
ask "What do you want to compute?" answer it && "equals" && the value of it
If you specify an object, references to me in the expression are treated as references to the object. However, other object references are treated as though the handler were in the current object script. For example, "button 3" refers to button 3 on the current card, not the card where the object is located.
If the expression is a single string, then even if it is enclosed in quotes, LiveCode attempts to evaluate its contents instead of treating it as a literal string. This means that you must be careful about literal string that contain operators such as "and".
# Tags
# See
- **property:** script - **operator:** [[()]] - **keyword:** me, numeric, string, card - **control structure:** function - **function:** value, merge - **command:** call - **glossary:** object, current card, return, handler, operator, logical, statement, literal string, expression, evaluate, object reference