NET:LavishScriptAPI.LavishScript.Objects.GetPermanentObject

From Lavish Software Wiki
Jump to navigation Jump to search

Overview

Used to retrieve a permanent LavishScriptObject object from a LavishScript Top-Level Object. Permanent objects are exempt from post-frame cleanup. Do not use this function to retrieve a permanent reference to a non-permanent object. If the object may disappear at any point while the program is executing, the object is, by definition, temporary (i.e. not permanent).

Reference Library

Lavish.InnerSpace.dll

Fully Qualified Name

LavishScriptAPI.LavishScript.Objects.GetPermanentObject

Declaration

static public LavishScriptObject GetPermanentObject(string Name)

Parameters

  • string Name
Name of the LavishScript Top-Level Object to access

Return Value

The requested object, or null

Examples

C#

Frame.Lock();
LavishScriptObject Obj = LavishScript.Objects.GetPermanentObject("LavishScript");
if (Obj == null)
{
    InnerSpace.Echo("object not found");
}
else
{
    /* "LavishScript" object's ToString value is its version number, which follows the form of a typical float */
    float Version = Obj.GetValue<float>();
    InnerSpace.Echo("LavishScript Version " + Version.ToString());
}
Frame.Unlock();

See Also