====== zvar_Cast ====== ===== Description ===== Cast the value of a variable to another [[zeolite:varid|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 [[zeolite:varid|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: * Either //hVarDest// or //hVarSrc// are invalid variable handles. * //DestVarID// is not a valid [[zeolite:varid|variable type]]. * The data types of //DestVarID// and //hVarSrc// are incompatible. 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 [[zeolite:functions:zvar_ReInit]] on //hVarDest// to re-initialise it as the correct output variable type.