LavishScript:Top-Level Objects

From Lavish Software Wiki
Jump to navigation Jump to search

Introduction

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

Top-Level Objects (TLOs) are the complement to Data Types. Where a a data type describes a type of object, a TLO is a specific object. For example, "table" would be a data type, but "my dining table" would be an object. Everything said about "my dining table" can generally be said about every other table. Thus, a data 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.

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 data 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 data 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 data type. Lower-level objects are accessed via members of the system data 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, make use of the NoParse command.

Built-in Top-Level Objects

Data Storage Conversion

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

Date and Time

Inline Branching

Math

Misc

Operating System

Scripting

See Also