Typically, a two-dimensional control table contains value/action pairs and may additionally contain operators and [[type system |type]] information such as the ___location, size and format of input or output data, whether [[data conversion]] is required. The table may contain [[array index |indexes]] or relative or absolute [[pointer (computer programming)|pointer]]s to generic or customized primitives or [[subroutine]]s to be executed depending upon other values in the row.
The table below impilesis a prototype of a control table that implies an action based on a single input value.
{| class="wikitable"
Line 77:
| value|| action
|}
(This side-by-side pairing of value and action has similarities to constructs in [[event-driven programming]], namely 'event-detection' and 'event-handling' but without (necessarily) the [[asynchronous system|asynchronous]] nature of the event itself)
The variety of values that can be [[encoded]] withinin a control table is largely dependent upon the [[computer language]] used. [[Assembly language]] provides the widest scope for [[data types]] including (for the actions), the option of directly executable [[machine code]]. Typically a control table will contain values for each possible matching class of input together with a corresponding pointer to an action subroutine. Some languages claim not to support [[pointer (computer programming)|pointer]]s (directly) but nevertheless can instead support an index which can be used to represent a 'relative subroutine number' to perform conditional execution, controlled by the value in the table entry (e.g. for use in an optimized [[switch statement|SWITCH]] statement – designed with zero gaps i.e. a [[multiway branch]]).
Comments positioned above each column (or even embedded textual documentation) can render a decision table 'human readable' even after 'condensing down' (encoding) to its essentials (and still broadly in-line with the original program specification – especially if a printed decision table, [[enumeration|enumerating]] each unique action, is created before coding begins).
The table entries can also optionally contain counters to collect run-time statistics for 'in-flight' or later optimization