-
Notifications
You must be signed in to change notification settings - Fork 0
cDataTable.CopyField
CopyField
returns boolean
accepts (ByVal sourceFieldName As String, ByVal newFieldName As String)
Pass this method the name of an existing field and the name you would like a copy of that field to be stored in. A new field will be created and the value of the existing field will be copied to the new field. The new field will be placed at the end of the record. If the newFieldName specified already exists, then the code will add a new field with a sequential number on the end of it that does not exist.
This means it is possible to add a field and the name will be different to the one you specified if you specified a name that was already taken. This is based upon the behaviour of the underlying methods (cRecord.CopyField and cRecord.AddField) chosen to implement this behaviour. It also means that this will not generate an error.
The default record of the cDataTable will also have the field copied.
See also: cRecord.CopyField, cRecord.AddField