Description

Gets metadata values for key(s) in a struct.

Returns

Struct of metadata information and the struct type.

Category

History

Added in ColdFusion (2016 release) Update 2

See also

Syntax

StructSetMetaData(Struct struct)

Parameters

Parameters Description
struct (Required) The input structure.

Example

<cfscript>
       example = structnew("ordered");
       example.firstname = "Yes";
       example.lastname = "Man";
       // set the metadata for the struct keys
       metadata = {firstname: {type:"string",name:"fname"},lastname:{name:"lname"}};
       StructSetMetaData(example,metadata);
       // retrieve the metadata for the keys and display
       myMetadata=StructGetMetaData(example);
       writedump(mymetadata);
</cfscript>

Output

structgetmetadata output
structgetmetadata output

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy