Creating SBM Application Objects

SBM ModScript includes the core ChaiScript function CreateObject(), taking a single string parameter. If the parameter is "Scripting.Dictionary", then a new Dictionary object is returned. If the parameter begins with "SBM.", then an SBM object is returned. For example, the following statement creates a new User object:

var myUser = CreateObject( "SBM.User" );

Some SBM objects cannot be created with the CreateObject() function, because additional parameters are necessary. For example, the object type AppRecord is always associated with an SBM table and cannot be created without a numeric table ID. The CreateObject() function cannot accommodate the table ID parameter, so it cannot be used to create AppRecord objects. Instead, SBM ModScript provides the function Ext.CreateAppRecord() which takes a table ID parameter. Refer to Extension Functions for details on this and other special object creation functions.

Related Topics

Inheritance

Object Types