Difference between revisions of "T-VEC Tablular Modeler Examples"

From T-VEC Wiki
Jump to: navigation, search
(Arrays)
 
Line 77: Line 77:
  
 
===Arrays===
 
===Arrays===
Single dimensional arrays are supported for structures and scalars. The following provides an example for defining an array. Provide a name and selected a data types and check the box indicating that the type is an array. Finally, supply an positive integer indicating the size of the array.
+
The following provides a look at how single dimensional arrays is to be supported for structures and scalars. The following provides an example for defining an array. Provide a name and select a data types and check the box indicating that the type is an array. Finally, supply a positive integer indicating the size of the array.
  
 
[[Image:Array_type_declaration.png|center|Array Types]]
 
[[Image:Array_type_declaration.png|center|Array Types]]
  
Arrays are referenced similar to structures or scalars, but using square brackets. An array of size 4 has three elements:
+
Arrays are referenced similar to structures or scalars, but using square brackets if a particular array element is to be referenced. An array of size 4 has four elements, starting at location zero (0):
  
 
   a[0], a[1], a[2] and a[3]
 
   a[0], a[1], a[2] and a[3]
  
Arrays elements or an entire array can be referenced in a condition or an assignment. If a variable is used to index an array, then the range of the variable must be constrained to the size of the array. The following examples shows three different ways to assign array information to an array of structures.
+
An entire array or array elements can be referenced in a condition or an assignment. If a variable is used to index an array, then the range of the variable must be constrained to the size of the array. The following example shows three different ways to assign array information to an array of structures.
 
* Row 1 shows that the output array is assigned the input array inArray
 
* Row 1 shows that the output array is assigned the input array inArray
 
* Row 2 shows that the zeroth element of the array is assigned two different field values, one for status and another for value
 
* Row 2 shows that the zeroth element of the array is assigned two different field values, one for status and another for value

Latest revision as of 12:03, 27 October 2008