Table of Contents

zvar_Cast

Description

Cast the value of a variable to another variable type.

Files

Declaration helper/zVarCast.h
Implementation helper/zVarCast.cpp

Function prototype

bool zvar_Cast(ZVAR hVarDest, long DestVarID, ZVAR hVarSrc);

Arguments

Name Type Comment
hVarDest ZVAR A handle to a variable that is to receive the value of hVarSrc after type casting.
DestVarID long The desired variable type of the variable addressed by hVarDest (see comments).
hVarSrc ZVAR A handle to the variable containing the value to be cast to another variable type.

Return value

False if:

True otherwise.

Comments

DestVarID and hVarDest

If the variable type given by DestVarID different to the actual variable type of hVarDest, this funciton will automatically call zvar_ReInit on hVarDest to re-initialise it as the correct output variable type.