Table of Contents

var_SetValueEx

Description

Set the value of a variable, ensuring first it is of the correct variable type.

Function prototype

bool CExtAPI::var_SetValueEx(ZVAR hVar, long VarID, void* pValue);

Arguments

Name Type Comment
hVar ZVAR A ZVAR handle to a variable, the value of which is to be set.
VarID long The expected type ID of the variable.
pValue void* A user-supplied handle to an allocated block of memory for the appropriate data type, containing the value to be set.

Return value

False if:

  1. hVar does not reference a valid variable (e.g. is null).
  2. pValue is null.
  3. The variable referenced by hVar is not initialised.
  4. The variable referenced by hVar is not of the type given by VarID.
  5. The variable type of hVar cannot be copied (see comments for var_GetValue.)

True otherwise.

Comments

Please refer to the comments for var_GetValue, which apply equally to this function.