L3DT documentation
Large 3D terrain generator



Cast the value of a variable to another variable type.


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

Function prototype

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


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:

  • Either hVarDest or hVarSrc are invalid variable handles.
  • DestVarID is not a valid variable type.
  • The data types of DestVarID and hVarSrc are incompatible.

True otherwise.


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.

zeolite/functions/zvar_cast.txt · Last modified: 2017/08/31 07:32 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki