Welll... I'm not sure if this made it or not, cause I posted to the group,
but I got bounces back...

structetc() for anything except individual keys has always given me grief.
single key actions looped through the scope normally cleans it up for me
though. Appears to work

 <cfloop collection="#form#" item="formParam">
 <cfset request.Temp1 = structdelete(form, "#formParam#", true)>
 </cfloop>

seems to work for clearing form scope... Attached the test script I used
below. Let me know (gently! ;>) if I'm completely missing the point. Cause I
am truly fux0r'd right ATM (Foo fighters mosh, about 2 feet to the left of
Center Stage, 2nd row baby! Only had to shoot, stab or bludgeon a couple
hundred people to get there.)

<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";

</cfscript>

<!--- Produce a list so we can see whats in the struct now. --->

 <CFSET request.temp1 = "">
 <cfloop collection="#form#" item="formParam">
 <cfset request.Temp1 =
ListAppend(request.temp1,"#formParam#=#form[formParam]#")>
 </cfloop>

<!--- Loop through a struct delete --->
 <CFSET request.temp2 = "">
 <cfloop collection="#form#" item="formParam">
 <cfset request.Temp2 = structdelete(form, "#formParam#", true)>
 </cfloop>

<!--- Produce a list so we can see what's left in the struct --->

 <CFSET request.temp3 = "">
 <cfloop collection="#form#" item="formParam">
 <cfset request.Temp3 =
ListAppend(request.temp3,"#formParam#=#form[formParam]#")>
 </cfloop>

<cfscript>
 // Emulate the Form again to see if it produces the last lot of data or
different data
 form     = StructNew();
 form.ItemID   = "55";
 form.Qty   = "20";
 form.ChckInDate   = "14/12/2003";
 form.Duration    = "5";
 form.Price   = "$700.00";
 form.Inclusions  = "blahblahblah";
 form.NoTraveling = "1234";
 form.Notes   = "blashblashblingblibg";
 form.Rooms   = "234";
 form.TravelNames = "Agnus, Delila, Cletus, Billy-Bob";
</cfscript>

<!--- Produce a list so we can see whats in the struct now. --->

 <CFSET request.temp4 = "">
 <cfloop collection="#form#" item="formParam">
 <cfset request.Temp4 =
ListAppend(request.temp4,"#formParam#=#form[formParam]#")>
 </cfloop>


<!--- Print the lot --->

<cfoutput>
Should be first values - #request.temp1#<BR>
Should be Yes - #request.temp2#<BR>
Should be Blank - #request.temp3#<BR>
Should be New Values - #request.temp4#<BR>
</cfoutput>
-----end snip here ------



"gary menzel" <[EMAIL PROTECTED]> wrote in message
news:22072@cfaussie...








OK - I have not tried this (and I admit I have not really been following
the conversation - so I may be way off base regarding what is being asked)
but every variable has a Scope (even if you dont explicitly give it one).

Why not try:

StructDelete(Variables,"yourStructName")

Of course, if you Scope it to something like Request......

StructDelete(Request,"yourStructName")

I use this method in a couple of pages I have to let me dump and delete
Application and Session variables (it also works for Form and Cookie - so
no reason it would not work for Request and Variables).


Gary Menzel
IT Operations Brisbane -+- ABN AMRO Morgans Limited
Level 29, 123 Eagle Street BRISBANE QLD 4000
PH: 07 333 44 828 FX: 07 3834 0828






---
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/

Reply via email to