In der "Version History" gibt es zu dem Thema das hier:
Code: Select all
Changes in 2.1.1.0 (Bandol GA 2.11)
Compiler
·We have added new syntaxes for OUT parameters. You can now use one of the following syntaxes
LOCAL cString as STRING
cString := "12345"
IF Int32.TryParse(cString, OUT VAR result)
// this declares the out variable inline, the type is derived from the method call
? "Parsing succeeded, result is ", result
ENDIF
IF Int32.TryParse(cString, OUT result2 AS Int32)
// this declares the out variable inline, the type is specified by us
? "Parsing succeeded, result is ", result2
ENDIF
IF Int32.TryParse(cString, OUT NULL)
// this tells the compiler to generate an out variable, we are not interested in the result
? "Parsing succeeded"
ENDIF
IF Int32.TryParse(cString, OUT VAR _)
// this tells the compiler to generate an out variable, we are not interested in the result.
// The name "_" has a special meaning "ignore this"
? "Parsing succeeded"
ENDIF
Karl-Heinz