LavishScript:Top-Level Objects

From Lavish Software Wiki
Jump to: navigation, search

Introduction

Difficulty Rating
Top-Level Objects
Usage Beginner
Level of Understanding Intermediate
Computer Savvy Newbie
Logic Intermediate

A Top-Level Object is simply an object -- where an object type describes a type of object, a TLO is an object. For example, "table" would be an object type, but "my dining table" would be an object. Everything said about "my dining table" can generally be said about every other table. Thus, an object type is a generalized way of describing many objects. Using this generalization makes it relatively easy to work with a large number of objects, because they are all described in the same way.

The term Top-Level Object is used to differentiate between objects that are a part of something else, and an object that can be immediately referred to. String is a Top-Level Object, whereas string.Upper is a member object of the given string.

Usage

Basic usage of a Top-Level Object is like so: ${System}. This simple form retrieves the object given by the System TLO, which is the system object type. Because the usage ends immediately with a }, the entire ${System} part of the text is replaced with the default value given by the system object type.

A Top-Level Object is described as Top-Level simply because it provides a starting point for accessing data. This does imply that there are lower level objects, accessible through a TLO. For example, the System TLO simply provides a way of accessing information about your system as described by the system object type. Lower-level objects are accessed via members of the system object type. One such object is referred to as system.OS, and is a string type. The string type then has members which can be accessed directly, such as string.Length. As described in Data Syntax, the usage is recursive, and each member results in an entirely new object for which the form can be continued. This means that instead of ${String[${System.OS}].Length}, you should simply use ${System.OS.Length}, because system.OS is a string.

Nearly all commands allow parsing of data portions before the command itself is processed. To prevent this from happening, escape the ${ portion of any Data Sequence, like \${String[xyz]}.

Built-in Top-Level Objects

Data Storage Conversion

Use Data Storage Conversion objects only when necessary, they do not generally need to be used at all! (see Usage)

Date and Time

Events

Inline Branching

Math

Misc

Operating System

Scripting

See Also