Public Member Functions | List of all members
Table Class Reference

Public Member Functions

 Table (Array values, Map specifiers)
 
Value lookup (Integer index)
 
 reset ()
 

Detailed Description

A lookup table.

var myTable = new Table(["A", "B", "C"], {initial:2, unchanged:"P"});
myTable.lookup(2); // returns "P"
myTable.lookup(1); // returns "B"
myTable.lookup(1); // returns "P"
myTable.reset();
myTable.lookup(1); // returns "B"

Constructor & Destructor Documentation

◆ Table()

Table ( Array  values,
Map  specifiers 
)

Constructs a new lookup table.

Parameters
valuesThe array of possible values.
specifiersThe format specifiers.

The supported specifiers are:

  1. initial: The initial value.
  2. force: Specifies that the value must always be returned.
  3. unchanged: Specifies the value to be returned when the value is unchanged.

Member Function Documentation

◆ lookup()

Value lookup ( Integer  index)

Returns the value at the specified index.

◆ reset()

reset ( )

Invoke to force output of value on the next invocation of lookup(). reset() has no effect if force has been set to true.



Generated by Autodesk, Inc. 19 April 2024
Copyright (c) 2012-2024 by Autodesk, Inc.