COM Vuser Functions (LRC) > Alphabetical List of Functions > lrc_variant_scode

lrc_variant_scode

Example: lrc_variant_scode Assignment to Variants

Assigns a string to an error code value in a variant.

VARIANT lrc_variant_scode( const char* errcode );
VARIANT lrc_variant_scode_by_variant( const char* errcode ); 
errcode A character string representing an error code value.

The lrc_variant_scode function converts a string containing a system error code value to an error code stored in a variant.

Be careful not to use lrc_variant_scode to create a variant of any type other than an scode error variant. For example, to create a variant to pass a long value to a function that takes a variant argument, use lrc_variant_long.

You create dynamic values for errcode in one of two ways. Either use the standard parameterization methods, or generate a string variable with the value you want to store in an scode variant. The example shows how to do this.

You can also pass a string literal:

VARIANT var = lrc_variant_scode("-2147352572");

The additional function lrc_variant_scode_by_variant is used when a variant to the variant of a system error is required.

The lrc_variant_scode_by_variant function converts a string containing a system error code value to an error code and returns a variant containing a reference to the variant containing the value.

Return Values

lrc Return Values

Parameterization

All arguments can be parameterized using standard parameterization.