> StructAppend()
> If this is what I think it is, then I shall praise (and buy
> beer for) the developer who finally put this in. I have a
> zillion cases of:
> <CFIF NOT StructKeyExists(struct,var)>
> <CFSET struct[var]="">
> </CFIF>
> <CFSET struct[var]=ListAppend(struct[var],value)>
> If this can be shortened to StructAppend(struct,var,value), I
> will be a very happy man.
Be very happy now! You can do this in 4.5.x with StructInsert. If you
specify a fourth argument, you can allow it to both insert and update:
<cfset rs = StructInsert(struct, var, value, "true")>
> (I still want a StructKeys() function that returns a
> list/array of key names, tho. Yes, I know, I can generate
> one, but I want a function for it. :)
Your wish is answered. I'm not sure when StructKeyArray and StructKeyList
were introduced, but they're listed in the documentation within CF Studio
4.5.1.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]