CC.ModifyTableOperation
Provides methods to modify a data table.
Constructor
CC.ModifyTableOperation (string view)
Initializes a new instance of the class with default settings.
Methods
FindField(string field_name)
Returns the position of the field in the current dataview.
AddField (string name, string type, real width, integer decimals, arr options)
Add a field to the data table.
| Option | Type | Description |
|---|---|---|
| name | string | Name of the field to be added |
| type | string | Field type |
| width | real | Field width |
| decimals | integer | Display decimals |
| opts | array | Additional field options: Indexed, Format, Aggregation, Description, DefaultValue, JoinSplit, DisplayName |
FindOrAddField(string name, string type, real width, integer decimals, arr options)
Add a field if it does not exist in the data table.
| Option | Type | Description |
|---|---|---|
| name | string | Name of the field to be added |
| type | string | Field type |
| width | string | Field width |
| decimals | string | Display decimals |
| opts | array | Additional field options: Indexed, Format, Aggregation, Description, DefaultValue, JoinSplit, DisplayName |
ChangeField( string fieldname, optarr opts )
Change an existing field property. Available options are: type, width, decimals, Indexed, Format, Description, Default
DropField( fieldname )
Permanently deletes a field from the data table
Apply( )
Apply the changes to the data table.
Example
obj = CreateObject("CC.ModifyTableOperation", GetView())
opts.Indexed = True
obj.AddField("New Field", "Real", 8, 2, opts)
obj.Apply()
See Also: