! input !! action
|-
| {{mono|A}} || Add
|-
| {{mono|S}} || Subtract
|-
| {{mono|M}} || Multiply
|-
| {{mono|D}} || Divide
|}
The next example illustrates how a similar effect can be achieved in languagesa language that dodoes not support pointer definitions in data structures but dodoes support indexed branching to a subroutine – contained within a ([[zero-based numbering|0-based]]) array of subroutine pointers. The table (CT2) is used to extract the index (from 2nd column) to the pointer array (CT2P). If pointer arrays are not supported, a SWITCH statement or equivalent can be used to alter the control flow to one of a sequence of program labels (e.g.: case0, case1, case2, case3, case4) which then either process the input directly, or else perform a call (with return) to the appropriate subroutine (default, Add, Subtract, Multiply or Divide,..) to deal with it.
:{| class="wikitable"
|+ CT2
! input 1!! {{mono|subr #}}
|-
| {{mono|A}} || {{mono|1}}
|-
| {{mono|S}} || {{mono|2}}
|-
| {{mono|M}} || {{mono|3}}
|-
| {{mono|D}} || {{mono|4}}
|-
| {{mono|?}} || {{mono|0}}
|}
As in above examples, it is possible to efficiently translate the potential [[ASCII]] input values (A, S, M,D or unknownD) into a pointer array index without actually using a table lookup, but is shown here as a table for consistency with the first example.
:{| class="wikitable"
|+ CT2P
|+ CT2P<br/>{{nobold|pointer array}}
! index || array
! !! [[pointer (computer programming)|pointer]] [[Array data structure|array]]
|-
| →1 || {{mono|default}}Add
|-
| →2 || {{mono|Add}}Subtract
|-
| →3 || {{mono|Subtract}}Multiply
|-
| →4 || {{mono|Multiply}}Divide
|-
| → || {{mono|Divide}}
|-
| → || {{mono|?other}}
|}
A two-dimensional control table could be used to support testing multiple conditions or performing more than one action, based on some matching criteria. An 'action' can include a pointer to another subordinate control table. The simple example below has had an ''implicit'' 'OR' condition incorporated as an extra column (to handle lower case input, however in this instance, this could equally have been handled simply by having an extra entry for each of the lower case characters specifying the same subroutine identifier as the upper case characters). An extra column to count the actual run-time events for each input as they occur is also included.
:{| class="wikitable"
|+ CT3
! input 1!!alternate!! {{mono|subr #}} !! {{mono|count}}
|-
| {{mono|A}} ||{{mono| a}} || {{mono|1}} || {{mono|0}}
|-
| {{mono|S}} ||{{mono| s}} || {{mono|2}} || {{mono|0}}
|-
| {{mono|M}} ||{{mono| m}} || {{mono|3}} || {{mono|0}}
|-
| {{mono|D}} ||{{mono| d}} || {{mono|4}} || {{mono|0}}
|-
| {{mono|?}} ||{{mono|?}}|| {{mono|0}}|| {{mono|0}}
|}
The control table entries are then much more similar to conditional statements in [[procedural language]]s but, crucially, without the actual (language dependent) conditional statements (i.e. instructions) being present (the generic code is ''physically'' in the interpreter that processes the table entries, not in the table itself – which simply embodies the program logic via its structure and values).
|
{| class="wikitable"
|+ CT4
|+ CT4<br/>{{nobold|(a complete 'program' to read input1 and process, repeating until 'E' encountered)}}
! input 1!!alternate!! subr # !! count !! jump
|-
| {{sdash}} || {{sdash}} || {{mono|5}}|| {{mono|0}} || {{sdash}}
|-
| {{mono|E}} ||{{mono|e}}|| {{mono|7}}|| {{mono|0}} || {{sdash}}
|-
| {{mono|A}}E ||{{mono|a}} e || {{mono|1}}7 || {{mono|0}} || {{sdash}}
|-
| {{mono|S}}A ||{{mono|s}} a || {{mono|2}}1 || {{mono|0}} || {{sdash}}
|-
| {{mono|M}}S ||{{mono|m}} s || {{mono|3}}2 || {{mono|0}} || {{sdash}}
|-
| {{mono|D}}M ||{{mono|d}} m || {{mono|4}}3 || {{mono|0}} || {{sdash}}
|-
| {{mono|?}}D ||{{mono|?}} d || {{mono|0}}4 || {{mono|0}} || {{sdash}}
|-
| {{sdash}} || {{sdash}} || {{mono|6}} || {{mono|0}} || {{mono|1}}
|}
|
{| class="wikitable"
|+ CT4P {{nobold|pointer array}}
! index || pointer
! !! [[pointer (computer programming)|pointer]] [[array data structure|array]]
|-
| →0 || {{mono|Default}}
|-
| →1 || {{mono|Add}}
|-
| →2 || {{mono|Subtract}}
|-
| →3 || {{mono|Multiply}}
|-
| →4 || {{mono|Divide}}
|-
| →5 || {{mono|Read Input1}}
|-
| →6 || {{mono|Alter flow}}
|-
| →7 || {{mono|End}}
|}
|}
|