A Function Library is a component that contains a set of routines defined using the MthRoutine command. These function library routines can be used in expressions. To handle objects of type *VARIANT, you need to use the variant function library #PRIM_LIBV. (For string, number, date and time, using Intrinsic Functions is simpler than using a function library.)
Variants can contain any type of data (strings, integers, decimals, booleans, components). You can use variant functions for testing the kind of value contained in the variable and you can retrieve its value in converted forms like numbers, strings or booleans.
Variants make possible the generic processing of values regardless of their type. For example, the value of a grid cell cannot be known by the compiler before the application is executed. Therefore the Value parameter of grid EditorChanged and ItemChangedAccept events returns the value in the cell as a variant so that compiler errors about the declared type of the value do not occur. You then need to write the program in a way that understands what type(s) are in the grid.
Also the EditorChanged and ItemChangedAccept events of tree and list views return the Value parameter as a variant. Similarly, many ActiveX controls return and accept values as variants. You can also use variants in your own dynamic programs for generic processing of values regardless of their type. For example:
Define_Com Class(*VARIANT) Name(#lclVariant)
Using the *VARIANT class is the recommended approach. Alternatively, you can use primitive variant component #PRIM_VAR and its properties and methods.
#PRIM_LIBV supports these functions: