Difference between revisions of "Subtable: Editable part of an array"

Line 3: Line 3:
  
  
The purpose of '''SubTable''' is to provide the user an alternative editable view of part of an edit
+
The purpose of '''SubTable''' is to provide the user an alternative editable view of part of an edit table. If a variable '''a''' is defined as an edit table, a variable b defined as '''SubTable(a[i = x])''' lets the user use u to view and edit a subarray of '''a''', for which index '''i''' of '''a''' has value '''x'''. Any change you make to cells of '''b''' is reflected in '''a''', and vice versa. The actual values are stored in edit table '''a'''.
table. If a variable '''a''' is defined as an edit table, a variable b defined as '''SubTable(a[i = x])''' lets the user use u to view and edit a subarray of '''a''', for which index '''i''' of '''a''' has value '''x'''. Any change you make to cells of '''b''' is reflected in '''a''', and vice versa. The actual values are stored in edit table '''a'''.
 
  
 
'''SubTable(a[i = x]):''' A subtable can also show subarrays of '''a''' in a different order, if '''x''' is an array containing some or all values of '''i''' in a different sequence. '''b''' can also use different number formats.  
 
'''SubTable(a[i = x]):''' A subtable can also show subarrays of '''a''' in a different order, if '''x''' is an array containing some or all values of '''i''' in a different sequence. '''b''' can also use different number formats.  
Line 10: Line 9:
 
A subtable also works if '''a''' is defined using any editable table functions, including edit table ('''table'''), probability table ('''probtable'''), deterministic table ('''determtable'''), or even another subtable.  
 
A subtable also works if '''a''' is defined using any editable table functions, including edit table ('''table'''), probability table ('''probtable'''), deterministic table ('''determtable'''), or even another subtable.  
  
'''SubTable()''' must be the main expression in the definition of a variable. It cannot be a subexpression or inside a function. Its parameter must be a slice or subscript operator. For example, in the simplest form:
+
'''[[SubTable]]()''' must be the main expression in the definition of a variable. It cannot be a subexpression or inside a function. Its parameter must be a slice or subscript operator. For example, in the simplest form:
 
  SubTable(a[i = x])
 
  SubTable(a[i = x])
 
where '''x''' is an element of index '''i''' and '''x''' is a value of '''i'''. Many other variations are also useful including:
 
where '''x''' is an element of index '''i''' and '''x''' is a value of '''i'''. Many other variations are also useful including:
Line 17: Line 16:
 
  SubTable(a[i = b])
 
  SubTable(a[i = b])
 
  SubTable(a[@i = c])
 
  SubTable(a[@i = c])
If the subarray returned by '''Subtable()''' is an atom (i.e., a single value with no indexes), you can
+
If the subarray returned by '''Subtable()''' is an atom (i.e., a single value with no indexes), you can edit it in a table view, or, if you define an input node for it, directly as an input field.
edit it in a table view, or, if you define an input node for it, directly as an input field.
 
  
 
==See Also==
 
==See Also==
 +
* [[SubTable]]()
 
<footer>DetermTable: Deterministic tables / {{PAGENAME}} / MultiTable: Combining editable and computed arrays</footer>
 
<footer>DetermTable: Deterministic tables / {{PAGENAME}} / MultiTable: Combining editable and computed arrays</footer>

Revision as of 08:49, 15 December 2015


The purpose of SubTable is to provide the user an alternative editable view of part of an edit table. If a variable a is defined as an edit table, a variable b defined as SubTable(a[i = x]) lets the user use u to view and edit a subarray of a, for which index i of a has value x. Any change you make to cells of b is reflected in a, and vice versa. The actual values are stored in edit table a.

SubTable(a[i = x]): A subtable can also show subarrays of a in a different order, if x is an array containing some or all values of i in a different sequence. b can also use different number formats.

A subtable also works if a is defined using any editable table functions, including edit table (table), probability table (probtable), deterministic table (determtable), or even another subtable.

SubTable() must be the main expression in the definition of a variable. It cannot be a subexpression or inside a function. Its parameter must be a slice or subscript operator. For example, in the simplest form:

SubTable(a[i = x])

where x is an element of index i and x is a value of i. Many other variations are also useful including:

SubTable(a[i = x])
SubTable(a[i = x, j = y])
SubTable(a[i = b])
SubTable(a[@i = c])

If the subarray returned by Subtable() is an atom (i.e., a single value with no indexes), you can edit it in a table view, or, if you define an input node for it, directly as an input field.

See Also

Comments


You are not allowed to post comments.