yes but the real freaky part is in my code even though i do StructNew() 3 times in 3 different code waypoints as i like to call em, the StructClear() over-rides the first 2 declarions ie..
If i dumped the theCart out it goes theCart.firstarray = empty theCart.secondarry = emtpy thecart.thirdarray = last version of the "form" or what i now call "baselevel" even though the first/second have structures key/values??? Just doesn't make sense. Scott "Steve Onnis" <[EMAIL PROTECTED]> wrote in message news:22057@cfaussie... > > Scott > > From what I have experienced, FORM is a reserved Struct > > Even if there is no form submitted, the FORM structure still exists, buts > its empty. So if you do <cfset Form = StructNew()>, it will do nothing as > the form allready exists anyway. > > So...... in relation to your code, you have a form, but want to create an > independent structure called "FORM" to hold some information, but if a form > has been submitted, and the form variable allready exists in the form > structure, it will just overwrite it as you have expressed in your email. > > So i think what you will have to do is either add then new values to the > existing form structure or use a different structure name. > > Regards > > Steve Onnis > Domain Concept Designs > +61 422 337 685 > +61 3 9444 7504 > > http://www.domainconceptdesigns.com <http://www.domainconceptdesigns.com> > > ("If you think it can't be done, you haven't asked me!") - Steve Onnis > > > > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Scott > Barnes > Sent: Monday, January 20, 2003 4:06 PM > To: CFAussie Mailing List > Subject: [cfaussie] Structures > > > How do i reset a structure completely for re-use? > > Basically what happens is the last form.structure build resets all > "Previous" structures to its value? when in fact i just want it to have each > of its own instance.. ie like a tmp variable in a loop if you will. > > Scott. > > --- Code here -- > <cfscript> > > // Emulate the Form > form = StructNew(); > form.ItemID = "22"; > form.Qty = "10"; > form.ChckInDate = "14/12/2002"; > form.Duration = "3"; > form.Price = "$300.00"; > form.Inclusions = "blah"; > form.NoTraveling = "1"; > form.Notes = "blash"; > form.Rooms = "2"; > form.TravelNames = "Agnus, Delila"; > > // Define the Objects Instance > theCart = createObject("component","comp.shopcart.cart"); > theCart.Add(form); > > > StructClear(form); > form = StructNew(); > form.ItemID = "12"; > form.Qty = "1"; > form.Price = "$600.00"; > form.Inclusions = "blah"; > form.NoTraveling = "1"; > form.Notes = "blash"; > form.TravelNames = "Agnus, Delila2"; > > theCart.Add(form); > </cfscript> > > <cfdump var="#theCart#"> > > > -- > Freelance Application Developer / Designer > -- > ph: 07 3288 6702 > mob: 04040 32812 > -- > url: http://www.spidaweb.com > > > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MX Downunder AsiaPac DevCon - http://mxdu.com/ > > > --- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] MX Downunder AsiaPac DevCon - http://mxdu.com/
