This command is used to change all or several of the values in an array or group of arrays. It will quickly and efficiently add or subtract values, or insert or delete a specific element number in an array.
UPDTA fn/v1, fn/v2,..., fn/vx Required - The names of the array fields to be changed. You may set the array element spec to the first element number to be updated, or in the case of INS/DEL, the location to start the insertion/deletion.
do_what | Required - INS / DEL / ADD / SUB / CLR |
ADD - Add a value to an array of values. The type of the value being added needs to be the same as the type of the array field(s). The value specified will added the number of times specified, starting with the array element indicated in array_field_list.
SUB - Subtract a value from an array of values. The type of the value being subtracted needs to be the same as the type of the array field(s).
INS - Insert a number of lines with value being the number. In this case the program will move out the elements from the starting element number so that there are effectively value number of elements available for new values.
DEL - Delete a number of lines with value being the number. In this case the program will move in the elements from the starting element number so that value number of element values will be overwritten.
CLR - Clear the array element values, with the number of elements affected determined by times. If numerical, date, time, etc. set to 0; if alpha set to spaces.
TIMES f/c/e | In the case of ADD/SUB/CLR this is the number of elements to update. If this isn't included the program will automatically use the number of elements in the array field. This is ignored in INS/DEL since the program always uses the number of array elements specified by value. |
VAL f/c/e | Required - This option is required in all but CLR. It is the value to be added or subtracted or the number of elements (lines) to insert or delete. |
COMMENTS
Note that in the INS and DEL mode that the times value doesn't need to be set. The program will automatically continue moving in or out element values until it reaches the end of the array for that particular field.
SEE ALSO
EXAMPLES
ADD - Add a value to an array of values. For example, if the following were true:
Element # FLD1
1 250
2 300
3 100
4 125
5 190
and the following were executed:
UPDTA FLD1[2] ADD VAL 10 TIMES 3
the following would result:
Element # FLD1
1 250
2 310
3 110
4 135
5 190
SUB - Subtract a value from an array of values. For example, if the following were true:
Element # FLD1
1 250
2 300
3 100
4 125
5 190
and the following were executed:
UPDTA FLD1[2] SUB VAL 10 TIMES 3
the following would result:
Element # FLD1
1 250
2 290
3 90
4 115
5 190
INS - Insert a number of lines with value being the number. For example, assume the following:
Element # FLD1 FLD2 FLD3
1 ABC 250 9/23/90
2 NCC 300 12/10/90
3 QHI 100 10/11/90
4 0 0/ 0/ 0
5 0 0/ 0/ 0
If the following is executed:
UPDTA fld1[2],fld2[2],fld3[2] INS VAL 2
the result would be:
Element # FLD1 FLD2 FLD3
1 ABC 250 9/23/90
2 0 0/ 0/ 0
3 0 0/ 0/ 0
4 NCC 300 12/10/90
5 QHI 100 10/11/90
DEL - Delete a number of lines with value being the number. For example, assume the following:
Element # FLD1 FLD2 FLD3
1 ABC 250 9/23/90
2 NCC 300 12/10/90
3 QHI 100 10/11/90
4 0 0/ 0/ 0
5 0 0/ 0/ 0
If the following is executed:
UPDTA fld1[2],fld2[2],fld3[2] DEL VAL 1
the result would be:
Element # FLD1 FLD2 FLD3
1 ABC 250 9/23/90
2 QHI 100 10/11/90
3 0 0/ 0/ 0
4 0 0/ 0/ 0
5 0 0/ 0/ 0
CLR - Clear the array element values. For example, assume the following is true:
Element # FLD1 FLD2 FLD3
1 ABC 250 9/23/90
2 NCC 300 12/10/90
3 QHI 100 10/11/90
4 RST 75 8/22/90
5 UVW 350 6/15/89
If the following is executed:
UPDTA FLD1[2],FLD2[2],FLD3[2] CLR TIMES 3
the following will result:
Element # FLD1 FLD2 FLD3
1 ABC 250 9/23/90
2 0 0/ 0/ 0
3 0 0/ 0/ 0
4 0 0/ 0/ 0
5 UVW 350 6/15/89
Page url: http://www.cassoftware.com/tas/manual/updatearrayfield.htm