-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTopLevelObjects.cpp
More file actions
22 lines (18 loc) · 1.04 KB
/
TopLevelObjects.cpp
File metadata and controls
22 lines (18 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "ISXRI.h"
// A LavishScript Top-Level Object is similar to a global C++ object. The main difference is that
// a TLO can give ANY data type it wants; it is not limited to a single type. You may wish to give
// a different type depending on the index (parameters, dimensions, etc) for example. Usually, though,
// you simply give one specific type.
bool __cdecl TLO_RI(int argc, char *argv[], LSTYPEVAR &Dest)
{
// argc and argv are used if the object access uses an index, such as RI[1] or
// RI[my coat,1,seventeen]. argc is the number of parameters (or dimensions) separated
// by commas, and does NOT include the name of the object.
// LSTYPEVAR, used for Dest, is a VarPtr with a Type. Type should be set to a pointer to a data type,
// such as Dest.Type=pIntType for integers. Do not set the Type or return true if the data retrieval
// fails (there is no object). For example, if the requested data is a string, and the string does
// not exist, return false and do not set the type.
Dest.DWord=1;
Dest.Type=pRIType;
return true;
}