I seem to remember last time I did something like this that ArrayAppend
worked. Either way I know I found another way around this without using the
duplicate function sense I was not using cfs 4.5. Let me know if you are in
a similar situation and I will look up the code I used.
Rick
-----Original Message-----
From: Hal Helms [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 02, 2001 11:08 AM
To: CF-Talk
Subject: RE: setting structures into arrays
The problem is that setting the array variable as you have just puts a
pointer to "order". When that changes, so will your reference. Instead, use
"history[1] = Duplicate( order )".
Hal Helms
== See www.ColdFusionTraining.com for info on "Best Practices with
ColdFusion & Fusebox" training, Jan 22-25 ==
-----Original Message-----
From: Greg Wolfinger [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 02, 2001 12:05 PM
To: CF-Talk
Subject: setting structures into arrays
Hey Guys:
I am having problems creating an array of structures and serializing it into
a wddx package for client storage in a db. My code looks like this:
<cfscript>
history=ArrayNew(1);
order=StuctNew();
StructInsert(order, "id", "0001");
StructInsert(order, "date", "01/01/2001");
history[1]=order;
StructClear(order);
StuctInsert(order, "id", "0002");
StrictInsert(order, "date", "01/02/2001");
history[2]=order;
</cfscript>
I then serialize and store the data. However what happends is that the
"history" array has a length of two, but both are set to the second
structures values. Any ideas??
Thanks in advance,
Greg
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server! Instant Activation for $99/month w/Free
Setup from SoloServer PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support
Visit SoloServer, https://secure.irides.com/clientsetup.cfm.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists