xHarbour Reference Documentation > Operator Reference |
Execution or grouping operator.
(<expr,...>) <symbol>([<params,...>]) <objVar>:<symbol>([<params,...>])
Parentheses are used to execute functions, procedures or methods, and to group expressions and define their order of execution.
When using the parentheses as a grouping operator, all items appearing inside the parentheses must be valid expressions. The grouping operator can be nested to any depth. The nesting level influences execution order of expressions, i.e. expressions on a deeper nesting level are evaluated first while expressions with the same nesting level are evaluated from left to right.
When the parentheses are used as execution operator, expressions between the parentheses are passed as arguments to the called function, method or procedure. Multiple expressions must be separated with commas. When no expression appears within the parentheses, no argument is passed.
See also: | & (macro operator) |
Category: | Special operators , Operators |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates different scenarios for using // the () operator. PROCEDURE Main LOCAL x // changing precedence of operations ? 5 + 2 * 2 // result: 9 ? (5 + 2)* 2 // result: 14 ? 5 + 2 * 2 - 1 // result: 8 ? 5 +(2 *(2 - 1)) // result: 7 x := " xHarbour " // one function call ? AllTrim( x ) // result: "xHarbour" // list of function calls ? ( x := Date(), CDow(x) ) // result: "Wednesday" RETURN
http://www.xHarbour.com