Show/Hide Toolbars

XSharp Bandol

The following pseudo functions are supported by the X# compiler

 

Function

Description

PCOUNT()

This pseudo function is only available in the VO/Vulcan dialect and only in methods or functions with a CLIPPER calling convention.
It returns the number of argument passed to the function. The function does not expect and does not allow any arguments.

ARGCOUNT()

This pseudo function returns the number of arguments defined for the current method or function.

_GETMPARAM() and _GETFPARAM()

These pseudo functions are only available in the VO/Vulcan dialect and only in methods or functions with a CLIPPER calling convention.
You can use them to retrieve a function parameter by position. You must pass a numeric expression to these functions. If you pass a number that is larger than the actual number of parameters at runtime then you will get an array access exception.

String2Psz() and Cast2Psz()

These pseudo functions are used in the VO/Vulcan dialect to convert DotNet strings to unmanaged Ansi PSZ strings. Not only is a PSZ created, but the functions also change the code generation and set up code to clear the allocated PSZ variable on exit of the function in which they are created.

ALTD()

This function will insert a call to System.Diagnostics.Debugger.Break inside a check to see if the debugger is attached (System.Diagnostics.Debugger.IsAttached)

_GetInst()

This function will return the module handle for the current module. Behind the scenes this is translated to System.Runtime.InteropServices.Marshal.GetHINSTANCE(TypeOf(FunctionsClass):Module)

PCALL() and CCALL()

The methods are used to call an API function for a strongly typed PTR.
The function expects a first parameter of type PTR and the other parameters must match the parameters defined in the function to which the typed PTR points
This is not yet supported in the current compiler version

PCallNative<Type>() and CCallNative<Type>()

The methods are used to call an API function for an untyped PTR

The function expects a generic type parameter which indicates the return type and a first parameter of type PTR. Other parameters are allowed and must not point to managed memory.
This is not yet supported in the current compiler version