Jon,
I am sorry, I made some incorrect assumptions about what you were trying to
do. I think what you want to do is check to see if an Item exists in the
Structure and then update its' value if it does. If this is correct the
following code should help you out.
<cfscript>
// Create your structure...
MyStruct = StructNew();
MyStruct.FName = "Chris";
MyStruct.LName = "Cortes";
</cfscript>
<!--- Lets output the structure to see how it looks... --->
Before the update:<br>
<cfloop list="#structKeyList(MyStruct)#" index="i">
<cfoutput>MyStruct.#i#</cfoutput> = <cfoutput>#evaluate("MyStruct.
#i#")#</cfoutput><br>
</cfloop>
<br>
<cfscript>
// Lets find the key and make the update if it exists...
Form.Field = "Fname";
if(StructKeyExists(MyStruct,Form.Field)){
"MyStruct.#Form.Field#" = "Christopher";
}
</cfscript>
<!--- Lets output the structure to see if the update was successfull... --->
After the update:<br>
<cfloop list="#structKeyList(MyStruct)#" index="i">
<cfoutput>MyStruct.#i#</cfoutput> = <cfoutput>#evaluate("MyStruct.
#i#")#</cfoutput><br>
</cfloop>
PS I think that there is no function named StructFindNoCase(). There really
is no need for it, because in ColdFusion, variable names are not
CaseSensitive...
Chris Cortes
Consultant
[EMAIL PROTECTED]
Direct 713-985-6244
Cell 832-723-6485
Stonebridge Technologies
...The Fast Track to e-Business.
visit us at www.sbti.com
----- Original Message -----
From: "Jon Tillman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 08, 2000 10:31 PM
Subject: Re: Setting structure values
> On Fri, 08 Sep 2000, Chris Cortes spake thusly:
> > <cfif StructFindNoCase(session.basket, FORM.productID)>
> >
> > <cfset myStructure.key = "#MyNewValue#">
> >
> > </cfif>
> >
> > All you need to do is set the structure key to the new value.
>
> So to update the found record to the form record would go something like:
>
> <cfset #StructFindNoCase(session.basket, FORM.productID)# = #MyFormValue#>
>
> ??
>
> --
> ***********************************************
> Jon Tillman
> LINUX USER: #141163
> ICQ: 4015362
> http://www.eruditum.org
> [EMAIL PROTECTED]
> ***********************************************
> Help Jon build a network!
> Looking for giveaway computers & parts
> Current Need: Tape Drive & PI/PII processors
> Email me to find out how you can help
> ***********************************************
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.