Why not LastName = ListGetAt(Name,1)
you could even do <CFIF LenLen(Name) GT 1> to test if there's a comma.
> Is there a command similar to Left(string, count) that is
>
> DelemiterLeft(String,Delimeter)
> DelemiterRight(String, Delimeter)
>
> such that if I was to get a variable like
>
> Name = Toohey,Elton
>
> I could do
>
> <CFSET LastName = DelimterLeft(Name, ",")
>
> <CFoutput>#LastName</CFoutput>
>
> would give me
>
> Toohey
>
> ?
>
> thanks...
>
> ethan
>
>
>
> ----- Original Message -----
> From: "Ethan Rosch" <[EMAIL PROTECTED]>
> To: "Fusebox" <[EMAIL PROTECTED]>
> Sent: Friday, February 16, 2001 3:20 PM
> Subject: Re: modules, loops, and fun!
>
>
> > Hi Douglas...thanks for the tip...
> >
> > I still think I need to pass my fields as I will be uploading/deleting
> files
> > and don't want to be running my actions on every field. Perhaps I could
> > just do a test for "://".
> >
> > the evaluate() was what I was looking for.
> >
> > e
> >
> > ----- Original Message -----
> > From: "Douglas Smith" <[EMAIL PROTECTED]>
> > To: "Fusebox" <[EMAIL PROTECTED]>
> > Sent: Friday, February 16, 2001 11:55 AM
> > Subject: Re: modules, loops, and fun!
> >
> >
> > > By the way, you don't need to pass in your list of form fields, since
> they
> > > are globally available to the CFMODULE you are running.
> > >
> > > I think you want to use the EVALUATE function like so:
> > >
> > > <CFLOOP collection="#form#" item="CurFormField">
> > > <CFSET MyFormField = Evaluate("form.#CurFieldField#")>
> > > </cfloop>
> > >
> > > However, if you do a list loop (which is slightly slower), then do this:
> > >
> > > <CFLOOP list="#MyList#" index="CurFormField">
> > > <CFSET MyFormField = Evaluate("form.#CurFieldField#")>
> > > </cfloop>
> > >
> > >
> > > At 10:22 AM 2/16/01, Ethan Rosch wrote:
> > > >hi all...
> > > >
> > > >quick question as I delve into the world of modules and loops...
> > > >
> > > >
> > > >I am trying to build a module that will in turn loop over the
> attributes
> > > >sent to it, which are form fields......this module will take whatever
> > form
> > > >fields are sent to it and then get there values and act via a loop.
> > > >
> > > >my problem is how to get the formfelds to parse to their values in the
> > > >module loop and not their names.
> > > >
> > > >here's a sample code of the idea:
> > > >
> > > ><cfmodule template="test.cfm"
> > > > mylist="firstformfieldname,secondformfieldname,">
> > > >
> > > >---------------------------------------
> > > >
> > > >for this example let's say that
> > > >
> > > >firstformfield's user inputed value = Red
> > > >secondformfield's user inputed value = blue
> > > >
> > > >now the module
> > > >
> > > >-------------------------------
> > > >
> > > ><cfloop index="fieldname" list="#attributes.mylist#">
> > > >
> > > > <cfoutput>#Fieldname#</cfoutput>
> > > >
> > > ></cfloop>
> > > >
> > > >--------------------------------------------------------
> > > >
> > > >what I want is :
> > > >
> > > >Red
> > > >Blue
> > > >
> > > >what I get is:
> > > >
> > > >FirstFormField
> > > >SecondFormField
> > > >
> > > >any idea's would be greatly appreciated...I'm beating myself up and now
> I
> > > >come to you.....
> > > >
> > > >thanks,
> > > >
> > > >ethan
> > > >
> > > >
> > > >
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists