Crystal Reports  

Basic Syntax for Custom Functions

The syntax for custom functions in Basic syntax is very similar to the syntax for functions in Visual Basic.

Function name [(argList)] [As type]

[statements]

[name=expression]

[Exit Function]

...

End Function

The Exit Function statement causes Crystal Reports to immediately exit from the function. You can use this statement any number of times, anywhere in the body of the function.

Note   The only statements you can place before the start of the function, or after the end of the function declaration are comments — either with apostrophes or Rem statements.

argList Syntax

[Optional] varName [()] As varType [=defaultValue]

Passed By Value

All arguments are passed by value. In Visual Basic, arguments can be passed either by value or by reference, and are passed by reference by default. However, custom functions do not support reference arguments.

See Also

Custom Function Syntax Rules | Custom Function Evaluation Time