Click or drag to resize

IsCodeBlock Function

X#
Determine if a value is a code block.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION IsCodeBlock(
	uValue AS USUAL
) AS LOGIC
Request Example View Source

Parameters

uValue
Type: Usual
The value to examine.

Return Value

Type: Logic
TRUE if the value is a code block; otherwise, FALSE.
Remarks
IsCodeBlock() identifies both runtime and compile-time code blocks as code blocks.
UsualType(), on the other hand, identifies runtime code blocks as objects.
Examples
This example uses IsCodeBlock() and UsualType() on a runtime code block:
X#
1LOCAL cbRunTime
2// Create code block at runtime
3cbRunTime := &("{||TRUE}")
4? UsualType(cbRunTime)                // OBJECT
5? IsCodeBlock(cbRunTime)                // TRUE
This example uses IsCodeBlock() and UsualType() on a compile-time code block:
X#
1LOCAL cbCompileTime
2// Code block known at compile-time
3cbCompileTime := {||TRUE}
4? UsualType(cbCompileTime)            // CODEBLOCK
5? IsCodeBlock(cbCompileTime)            // TRUE
See Also