Whatever message this page gives is out now! Go check it out!
StructUpdate(structure, key, value)Parameter | Description |
structure | Structure to update. |
key | Key, the value of which to update. |
value | New value. |
<cfscript>
myStruct=StructNew();
myStruct={a=1,b=2,c=3,d=4,e=5};
WriteOutput("Before struct update:");
WriteDump(myStruct);
StructUpdate(myStruct,"e",6); // Update key-value pair e-5 to e-6
WriteOutput("After struct update:");
WriteDump(myStruct);
</cfscript><cfscript>
myStruct={a=1,b=2,c=3,d=4,e=5};
myStruct.update("e",6);
WriteDump(myStruct);
</cfscript>