Name Values

The Name class defines the characteristics of names. Names are primarily used as parameters in function calls to signify one of a set of options.

Literal

#

See Names for a description of Name literals.

Constructors

as name

Converts a String value into a name

Operators

==

!=

<

>

<=

>=

Comparison of names is caseless alphabetic. Among other things, this allows arrays of names to be sorted using the array sort function.

Methods

copy

Creates a new copy of the name value.

?

Examples

The following script shows the use of various literals, constructors, and operators of the Name class.

Script:

-- name test bed

name1=#Hello -- set variable to name literal

name2="HELLO" as name -- convert string to name

if name1 == name2 do print "names are equal" -- compare the names

box_props=getpropnames box -- get the properties of box class

sort box_props -- sort the property names

Output:

#Hello -- result of line 2

#Hello -- result of line 3

"names are equal" -- output from line 4

"names are equal" -- result of line 4

-- following are the results of lines 5 and 6

#(#height, #length, #lengthsegs, #width, #widthsegs, #mapCoords, #heightsegs)

#(#height, #heightsegs, #length, #lengthsegs, #mapCoords, #width, #widthsegs)