StructUpdate

Updates the specified key with the specified value. Returns Yes if the function is successful and throws an exception if an error occurs.

See also StructClear, StructDelete, StructFind, StructInsert, StructIsEmpty, StructKeyArray, StructCount, and StructKeyExists.

Syntax

StructUpdate(structure, key, value)
structure

Structure to be updated.

key

Key whose value is updated.

value

New value.

Usage

This function throws an exception if structure does not exist.

Example

<!---------------------------------------------------------------------- 
This example illustrates the use of StructUpdate. 
It assumes that you have created and assigned values to the fields of a 
structure named EMPINFO within an include file.
----------------------------------------------------------------------->

<CFIF StructIsEmpty(EMPINFO)>
        <CFOUTPUT>Error. No employee data was passed.</CFOUTPUT>
<CFELSEIF StructFind(EMPINFO, "department") EQ "">
                <CFSET rCode=StructUpdate(EMPINFO, "department", "Unassigned")>
<CFELSE>            
        ...