structUpdate

Updates a key with a value.

structUpdate(structure, key, value) → returns boolean

Argument Reference

structure struct
Required

Structure to update

key string
Required

Key, the value of which to update

value any
Required

New value

Examples
Sample code invoking the structUpdate function

Change value of structure item

myStruct = {a: 1, b: 2, c: 3, d: 4};
structUpdate(myStruct,'c',15);
writeDump(serializeJSON(myStruct));

Expected Result: {"A":1,"B":2,"C":15,"D":4}

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub