Create a named variable that may be accessed by other plugins, scripts, etc.
Declaration | Zeolite.h |
---|---|
Implementation | Zeolite.cpp |
ZVAR zvar_CreateShared(long VarID, const char* lpVarName);
Name | Type | Comment |
---|---|---|
VarID | long | The type ID of the variable to be created. |
lpVarName | const char* | A pointer to a C-style string containing the name of the variable to be created (null if to be unnamed). |
Null if an error occurred, and a non-null ZVAR handle otherwise.
Please refer to the comments for zvar_Create, which are relevant to this function also.
If the given lpVarName contains the '.' (dot) character, the variable will be created in a nested list. For instance, and lpVarName of “list1.list2.varname” will create the variable varname in a list called list2, which itself is contained in list1. In this example, list1 and list2 will be automatically created if they do not already exist. If list1 or list2 do exist but are not initialised as something other than VarID_varlist, var_CreateShared
will return false and error will be thrown.
Variables created by zvar_CreateShared
are placed into a shared memory space that can be accessed by L3DT or other plugins using zvar_GetSharedVar. If you want to create a private variable accessible only to your plugin, use zvar_Create, and store the ZVAR in your plugin for later use (note zvar_GetSharedVar cannot retrieve a variable created with zvar_Create.)