Table of Contents

zvar_SetValueText

Description

Set the value of a variable from an ASCII character string.

Files

Declaration Zeolite.h
Implementation Zeolite.cpp

Function prototype

bool zvar_SetValueText(ZVAR hVar, const char* lpValueText);

Arguments

Name Type Comment
hVar ZVAR A ZVAR variable handle whose value is to be set.
lpValueText const char* A handle to a C-style string containing the value (as text) to which the variable will be set.

Return value

False if an error occurred, and true otherwise.

Comments

Allowed variable types

Note that the variable referenced by hVar bust be initialised as one of the following types:

VarID Example string
VarID_bool “true”, “1”, “false”, “0”
VarID_char “c”
VarID_byte “255”
VarID_ubyte as above
VarID_sbyte ”-128”
VarID_short ”-32768”
VarID_ushort “65535”
VarID_int “1”
VarID_uint “1”
VarID_int64 “1”
VarID_float “1.0”
VarID_double “1.0”
VarID_string “Hello world”
VarID_colour “255, 255, 255”
VarID_vector3c “0, 1, 2”
VarID_vector3i “0, 1, 2”
VarID_vector3f “0.0, 1.0, 2.0”
VarID_vector3d “0.0, 1.0, 2.0”

In the above examples I have used decimal notation for floating point numbers (e.g. “1.0”). This is not strictly required, you may also use integer notation (e.g. “1”), or exponential notation (e.g. “1.234E5”), as with the C standard atof function.