The following pseudo functions are supported by the X# compiler
Function |
Description |
PCOUNT() |
This pseudo function is only available in methods or functions with a CLIPPER calling convention. |
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 methods or functions with a CLIPPER calling convention. |
String2Psz() and Cast2Psz() |
These pseudo functions are used 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. |
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. The compiler creates a delegate with the proper prototype and uses Marshal.GetDelegateForFunctionPointer() to call the function. |
_ARGS() |
This pseudo function returns is replaced by the compiler to a reference to the generated array of parameters for functions/methods with clipper calling convention |
SLen() |
This function is translated by the compiler to a call of the Length property of the string, with a built-in check for NULL. |
Chr(), _Chr() |
When the numeric parameter of this function is a literal number between 0 and 127 then the compiler replaces the function call with a literal string with a character of that value. Larger values are not converted at compile time but at runtime because these numbers are codepage dependent. |