Bracket notation (LotusScript® Language)

For applications developed with some HCL products, you can use names in brackets rather than object reference variables to identify HCL software objects. To determine whether your software supports this notation, see the product documentation.

Syntax

[ prodObjName ]

Elements

prodObjName

The name understood by the product to identify an object (an instance of a product class).

Usage

In some cases, HCL products assign names to objects, and in other cases you can use the product user interface to name the objects you create. In a spreadsheet, for example, A1 identifies a particular cell, and you could use the user interface to name a chart SalesTracking.

Bracket notation lets you use these names without declaring an object variable and binding it to the object. For example, the product might allow you to use:

[A1].contents = Cstr(247000)

instead of:

Dim myCell as Range
Set myCell = Bind("A1")
mycell.contents = Cstr(247000)

In some cases, the product uses bracket notation when it records transcripts of user actions. This makes the transcripts easier to read and modify. For more information, see the product documentation.

The LotusScript® compiler does not attempt to determine the class of objects that are identified with bracket notation, so any class syntax errors you make (such as the incorrect use of properties and other methods), will generate run-time errors, not compile-time errors.

You can also use empty brackets to identify the currently selected product object. Empty brackets are equivalent to leading dot notation. For example, if the current selection is a range named Sales, then

[ ].CopyToClipboard

and

.CopyToClipboard

are equivalent to

[Sales].CopyToClipboard

All three statements copy the contents of the Sales range to the clipboard.

To include brackets as text within a string, double the brackets. For example, if the current selection is a range named Sales[East], use the following syntax:

[Sales[[East]]].CopyToClipboard

Example