Previous Topic: Character StringsNext Topic: UNIX File Attributes


Declare Functions

This command declares a function for BYREF.

The FUNCTION command format is as follows:

FUNCTION function name ([BYREF] arg_1 As type_1, ..., [BYREF]arg_n As type_n) as type_r

type_1type:n

Specifies a basic type or a structure, and defines the return value.

arg1 ... arg_n

Specifies arrays.

The return value type_r is either a basic type or a structure and defines the type of the return value. Arrays as return values are not supported

To return a value, the value must be assigned to the function name function_name in the body of the function.

Example: Declaring functions

Function square ( I as integer) as integer
Square = I * I
End Function