# addField(rec,name,value)

Adds to an existing record a field with specified name and value.

### Syntax

o_addField(rec,name,value)
  rec: Record - an existing record
  name: scalar Text - the name of a field that is to be added to the existing record
  value: scalar Any - the value of a field that is to be added to the existing record
  return: record - existing record with one additional field added

### Usage

Creates a new field with specified name and value and adds it to an existing record.

### Location

menu: veeos ==> Data ==> addField

library: dataLib

### Example

o_addField (A, "new", 38.7) takes the record A and adds to it a field with name "new" and value of 38.7).

### Notes

As with any record, one cannot add a field whose name matches an existing field.

New for VEEOS 2: If the "rec" field is null or anything other than a record then a record is returned with just the one new field, That is, addField becomes buildField if the rec input is anything other than a record.

### Reference

### Supported On

VEE 7.0+, All platforms.

### See Also

buildField

© 2015-2021. All Rights Reserved. Stan Bischof (stan@worldbadminton.com). Last updated 05 August 2021 10:44.