Re: string function???

2011-02-21 Thread Richard White

>Are you trying to replace variable placeholders so that you can evaluate the
>code chunk?

yes exactly 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342474
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-21 Thread Dain Anderson

I'm curious what exactly you're trying to do, which might reveal a better
way of doing it.

Are you trying to replace variable placeholders so that you can evaluate the
code chunk?


On Mon, Feb 21, 2011 at 1:24 PM, Richard White  wrote:

>
> thanks dain, this has made me realise i really need to know more about
> regular expressions, as i could have another string that has now() instead
> of the parenthesis:
>
> 
>
> have played around with the expression you suggested to pick up anything
> between the datediff() as then i can run the rematch from example above,
> although my attempts have all failed so far...
>
>


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342472
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-21 Thread Richard White

thanks dain, this has made me realise i really need to know more about regular 
expressions, as i could have another string that has now() instead of the 
parenthesis:



have played around with the expression you suggested to pick up anything 
between the datediff() as then i can run the rematch from example above, 
although my attempts have all failed so far...




>You could use something like this:
>
>
>
>/>
>
>
>
>
>HTH,
>-Dain
>
>
>
>> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342470
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-21 Thread Dain Anderson

You could use something like this:








HTH,
-Dain

On Mon, Feb 21, 2011 at 12:32 PM, Richard White  wrote:

>
> hi, what if I had a string such as:
>
> 
>
> ... and wanted to only get the values enclosed in parenthesis that exist
> inside the datediff() part of the string? so effectively the returned array
> would include only {name2} and {name3}
>
> this must be possible with the rematch that you have already helped me
> with, but i cannot seem to understand how to change the regular expression
> to make it return these results
>
> thanks for the help
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342468
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-21 Thread Richard White

hi, what if I had a string such as:



... and wanted to only get the values enclosed in parenthesis that exist inside 
the datediff() part of the string? so effectively the returned array would 
include only {name2} and {name3}

this must be possible with the rematch that you have already helped me with, 
but i cannot seem to understand how to change the regular expression to make it 
return these results

thanks for the help 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342467
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: string function???

2011-02-15 Thread Bobby Hartsfield

Oh Yeah! ReMatch... forgot about that one for a minute. 
 
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 

-Original Message-
From: Richard White [mailto:rich...@j7is.co.uk] 
Sent: Tuesday, February 15, 2011 12:26 PM
To: cf-talk
Subject: Re: string function???


thanks guys the combination of the 2 answers works perfectly:








~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342293
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-15 Thread Richard White

thanks guys the combination of the 2 answers works perfectly:






~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342292
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: string function???

2011-02-15 Thread Bobby Hartsfield

Check out refind using the returnSubExpressions set to TRUE. It will return
an array of position and length for each of the matched items. You can use
those len and pos values to grab each value with the mid() function.

For example...




 
.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 

-Original Message-
From: Richard White [mailto:rich...@j7is.co.uk] 
Sent: Tuesday, February 15, 2011 11:58 AM
To: cf-talk
Subject: string function???


Hi,

i have various strings in the following format:

'({name1}+{name2})/365.25'

i need to get all the names from in between the curly brackets {} and place
them in an array. (so the above example would put name1 and name2 in an
array)

what would be the best way to do this?

thanks 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342291
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-15 Thread Raymond Camden

Well you have multiple ways you can do this - but you may want to try
reMatch. Given a regex it will return all the matches.

On Tue, Feb 15, 2011 at 11:05 AM, Richard White  wrote:
>
> i understand them to a certain extent but not sure how to split a string 
> using them. do you have any pointers?
>
>>Regular expressions. Have you looked into them?
>>
>>
>>>
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342290
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-15 Thread Richard White

i understand them to a certain extent but not sure how to split a string using 
them. do you have any pointers?

>Regular expressions. Have you looked into them?
>
>
>> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342289
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: string function???

2011-02-15 Thread Raymond Camden

Regular expressions. Have you looked into them?

On Tue, Feb 15, 2011 at 10:57 AM, Richard White  wrote:
>
> Hi,
>
> i have various strings in the following format:
>
> '({name1}+{name2})/365.25'
>
> i need to get all the names from in between the curly brackets {} and place 
> them in an array. (so the above example would put name1 and name2 in an array)
>
> what would be the best way to do this?
>
> thanks
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342288
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: String function question

2008-03-24 Thread Bruce Sorge
Let me put something together and I will send it to you.

C S wrote:
>> Original code: newValue was being created inside the cfif's, but was 
>> not there in the last CFSET. 
>> 
>
> You are right. It should before the cfif. 
>
>   
>> Also, form.FieldNames were not being found 
>> until I added the loop before the CFIF's.
>> 
>
> That should not happen. As long as the form was submitted, I believe the 
> form.fieldNames variable should always exist. Also the extra loop is not 
> needed and may even produce the wrong results. 
>
>   
>> What I get though are x's in  the first column only if the 
>> first column stayed selected. 
>> 
>
> I think the previous code should work. At least once you get rid of the extra 
> loop and move the newValue variable declaration. But maybe I am not 
> understanding what you mean by "columns". Any way you can provide a small 
> example?
>
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301989
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-24 Thread C S
> Original code: newValue was being created inside the cfif's, but was 
> not there in the last CFSET. 

You are right. It should before the cfif. 

> Also, form.FieldNames were not being found 
> until I added the loop before the CFIF's.

That should not happen. As long as the form was submitted, I believe the 
form.fieldNames variable should always exist. Also the extra loop is not needed 
and may even produce the wrong results. 

> What I get though are x's in  the first column only if the 
> first column stayed selected. 

I think the previous code should work. At least once you get rid of the extra 
loop and move the newValue variable declaration. But maybe I am not 
understanding what you mean by "columns". Any way you can provide a small 
example?


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301988
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-24 Thread Bruce Sorge
Yes I did. Had to make some changes though. Still did not produce the 
desired result. Here is what I did:

Original code: newValue was being created inside the cfif's, but was not 
there in the last CFSET. Also, form.FieldNames were not being found 
until I added the loop before the CFIF's. What I get though are x's in 
the first column only if the first column stayed selected. Once I 
selected one of the other two coluns, all fields are blank. And the text 
fields are always blank.


]*>","","ALL")>
]*>', NewContentBlock)>



 




















Changed code:



   




   
   
   
 











  
   
  
   


 --->

C S wrote:
> Did you ever try my last suggestion. It is not ideal, but it should work. 
>   

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301980
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-24 Thread C S
>The biggest problem I am having is getting the columns for the form to 
>line up properly (they are a series of radio buttons). I can get all of 
>the values and the text fields fill in properly. The radio button values 
>fill in with what I select, just not in the correct column.

Did you ever try my last suggestion. It is not ideal, but it should work. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301975
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-24 Thread Bruce Sorge
The biggest problem I am having is getting the columns for the form to 
line up properly (they are a series of radio buttons). I can get all of 
the values and the text fields fill in properly. The radio button values 
fill in with what I select, just not in the correct column.

Bruce

Charlie Griefer wrote:
> so just out of curiosity... the backreferences thing didn't pan out at all?
>
> On Mon, Mar 24, 2008 at 3:17 PM, Bruce Sorge <[EMAIL PROTECTED]> wrote:
>   
>> Appreciate it. I will give it a try.
>>
>>
>>  denstar wrote:
>>  > This is probably too late to help, but I did a similar hackish job:
>>  >
>>  > 
>>  > #thisForm.editForm(url.formnum)#
>>  > 
>>  > 
>>  > contents = rereplace(thisForm,"]*>(.*?)",">  > style='background-color:silver;'>\1","all");
>>  > contents = rereplace(contents,']+text[^>]+value[
>>  > =]+["'']([^"]*)[^>]+>',">  > style='background-color:silver;'>\1","all");
>>  > contents = rereplacenocase(contents,"(.*?)","","all");
>>  > 
>>  >
>>  > The cfsavecontent contains the rendered form, with values, and I just
>>  > chopped the inputs off the values, basically, leaving the value there
>>  > "alone".
>>  >
>>  > The select box stuff was commented out, so I bet I never got that 
>> working...
>>  > this is a nasty way of doing things, but worked for what it was needed 
>> for.
>>  >
>>  > Figured I'd put the code out there, anyways. *shrug*  =]
>>  >
>>  > -denny
>>  >
>>  >
>>  >
>>
>>
>>
>> 
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301960
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-24 Thread Charlie Griefer
so just out of curiosity... the backreferences thing didn't pan out at all?

On Mon, Mar 24, 2008 at 3:17 PM, Bruce Sorge <[EMAIL PROTECTED]> wrote:
> Appreciate it. I will give it a try.
>
>
>  denstar wrote:
>  > This is probably too late to help, but I did a similar hackish job:
>  >
>  > 
>  > #thisForm.editForm(url.formnum)#
>  > 
>  > 
>  > contents = rereplace(thisForm,"]*>(.*?)","  > style='background-color:silver;'>\1","all");
>  > contents = rereplace(contents,']+text[^>]+value[
>  > =]+["'']([^"]*)[^>]+>',"  > style='background-color:silver;'>\1","all");
>  > contents = rereplacenocase(contents,"(.*?)","","all");
>  > 
>  >
>  > The cfsavecontent contains the rendered form, with values, and I just
>  > chopped the inputs off the values, basically, leaving the value there
>  > "alone".
>  >
>  > The select box stuff was commented out, so I bet I never got that 
> working...
>  > this is a nasty way of doing things, but worked for what it was needed for.
>  >
>  > Figured I'd put the code out there, anyways. *shrug*  =]
>  >
>  > -denny
>  >
>  >
>  >
>
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301957
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String function question

2008-03-24 Thread Bruce Sorge
Appreciate it. I will give it a try.

denstar wrote:
> This is probably too late to help, but I did a similar hackish job:
>
> 
> #thisForm.editForm(url.formnum)#
> 
> 
> contents = rereplace(thisForm,"]*>(.*?)"," style='background-color:silver;'>\1","all");
> contents = rereplace(contents,']+text[^>]+value[
> =]+["'']([^"]*)[^>]+>'," style='background-color:silver;'>\1","all");
> contents = rereplacenocase(contents,"(.*?)","","all");
> 
>
> The cfsavecontent contains the rendered form, with values, and I just
> chopped the inputs off the values, basically, leaving the value there
> "alone".
>
> The select box stuff was commented out, so I bet I never got that working...
> this is a nasty way of doing things, but worked for what it was needed for.
>
> Figured I'd put the code out there, anyways. *shrug*  =]
>
> -denny
>
>   
>

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301953
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-24 Thread denstar
This is probably too late to help, but I did a similar hackish job:


#thisForm.editForm(url.formnum)#


contents = rereplace(thisForm,"]*>(.*?)","\1","all");
contents = rereplace(contents,']+text[^>]+value[
=]+["'']([^"]*)[^>]+>',"\1","all");
contents = rereplacenocase(contents,"(.*?)","","all");


The cfsavecontent contains the rendered form, with values, and I just
chopped the inputs off the values, basically, leaving the value there
"alone".

The select box stuff was commented out, so I bet I never got that working...
this is a nasty way of doing things, but worked for what it was needed for.

Figured I'd put the code out there, anyways. *shrug*  =]

-denny

On Fri, Mar 21, 2008 at 8:35 AM, Bruce Sorge <[EMAIL PROTECTED]> wrote:
> I have googled this all morning and I cannot find the answer, and I am
>  running out of time. Here is my situation:
>  I have an HTML form that is being pulled from a database table. When the
>  form is submitted, they want the form submitted to them in a PDF that is
>  emailed as an attachment. I know how to do that part. What they want is
>  for the submitted PDF to look exactly like the HTML form that they
>  submitted, replacing the form elements with the submitted values. I am
>  able to query the database and get the HTML form, using REReplace I can
>  strip out all of the input and form elements as well, leaving me with
>  the layout in tact. minus the input elements. What I cannot figure out
>  though is how to get the submitted values to replace the void left when
>  I strip the input elements.
>  I know that I need to find the form field names and then match them up
>  to the submitted names and insert the values, but I don't exactly know
>  how to go about this. Does this make sense?
>
>  Thanks,
>
>  Bruce
>
>  

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301948
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-21 Thread C S
>CF 8

All I am coming up with is looping.  A regex guru might be able to come up with 
a better alternative.


]*>","","ALL")>
]*>', NewContentBlock)>



 






















~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301774
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-21 Thread Bruce Sorge
CF 8

C S wrote:
>> The extra replaces are for the radio buttons. Basically what I am trying 
>> to do now is match the submitted radio to the column it corresponds to 
>> but it is not working correctly. I thought that if I found the header 
>> field from the form they would match up but that is not correct. Can 
>> anyone see what I am doing wrong here?
>> 
>
> The only thing coming to mind is a series of ugly loops. Either matching on 
> input name+value or input+type.  What version of CF are you using, btw? 
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301767
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-21 Thread C S
>The extra replaces are for the radio buttons. Basically what I am trying 
>to do now is match the submitted radio to the column it corresponds to 
>but it is not working correctly. I thought that if I found the header 
>field from the form they would match up but that is not correct. Can 
>anyone see what I am doing wrong here?

The only thing coming to mind is a series of ugly loops. Either matching on 
input name+value or input+type.  What version of CF are you using, btw? 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301766
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String function question

2008-03-21 Thread Bruce Sorge
OK, with the help of Hatton and others I am closer. I have this:


 ]*>","","all")#>
 ]*>","","all")#>

 
]*type="radio"[^>]*>', 
"x","ONE")#>

]*type="radio"[^>]*>', 
" ","ONE")#>

 ]*name="#field#"[^>]*>', 
form[field],"ONE")#>
 ]*name="#field#"[^>]*>', 
" ","ALL")#>
 


The extra replaces are for the radio buttons. Basically what I am trying 
to do now is match the submitted radio to the column it corresponds to 
but it is not working correctly. I thought that if I found the header 
field from the form they would match up but that is not correct. Can 
anyone see what I am doing wrong here?

Thanks again for the answers,

Bruce

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301763
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String function question

2008-03-21 Thread Charlie Griefer
quick update... the following code does get me "bob" as the output.

concerns:
1) evaluate()  (ugh)
2) my regex needs to be tweaked.  if the  self-closes, it picks
up the slash (e.g. if it's , the
regex matches firstname" / ... it grabs the closing quote and the
slash).









]*name=\"(.*?)\"*>',"form['\1']","all")#>
]*>","","all")#>
]*>","","all")#>

#evaluate(newContentBlock)#

-- 
Evelyn the dog, having undergone further modification pondered the
significance of short-person behaviour in pedal depressed,
pan-chromatic resonance, and other highly ambient domains. "Arf," she
said.

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301754
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String function question

2008-03-21 Thread Charlie Griefer
with the caveat that i'm no regex guru either (which will become
abundantly clear when you see my code below)... you should be able to
capture the 'name' attribute of the input element using backreferences
and then spit out the value.

here's what i have so far, which unfortunately doesn't work... but
might lead you in the right direction.  unfortunately, i don't have
too much time to play around with it more.  gotta catch a flight in a
couple of hours.









]*name=\"(.*?)\"*>',"form[\1]","all")#>
]*>","","all")#>
]*>","","all")#>

#newContentBlock#

what i'm unable to do... which seems to be the key here, is getting
form[firstname] (which should actually have quotes around the
'firstname') to evaluate to "bob".  i've tried a few combinations
(including "#form['\1']#" in the rereplace), but haven't had any luck
:\


-- 
Evelyn the dog, having undergone further modification pondered the
significance of short-person behaviour in pedal depressed,
pan-chromatic resonance, and other highly ambient domains. "Arf," she
said.

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301753
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String function question

2008-03-21 Thread C S
>Regex is not a strong suite for me.
>
>Bruce

I am not a regex expert either, but what about using form.fieldNames to replace 
the input fields by name? To be safe you might follow it up with another 
blanket " replace. Just in case some of the field names do not match 
for some reason.

]*>","","ALL")>

 ]*name="#field#"[^>]*>', 
form[field],"ALL")>



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301752
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String function question

2008-03-21 Thread Bruce Sorge
This is not exactly what I am looking for. I already know how to create 
the PDF and attach it to an email. What I am doing is stripping the 
input elements from the form, and I want to replace them with what was 
submitted. And remember, the form is actually stored in the DB. This is 
what I have to strip the form elements:
In the output below, the query result is the actual HTML for the entire 
form.


 ]*>","","ALL")#>
]*>","","ALL")#>
]*>","","ALL")#>


Since the first cfset strips all the input elements, I am thinking that 
I can replace those with what was submitted, but this is the part where 
I am stuck. Regex is not a strong suite of mine I admit. Am I taking the 
right approach here or am I over-complicating things? I guess what I am 
trying to say is that I need to match the input elements name to the 
submitted form element name, and replace the input with the submitted 
value. There are text fields and radio buttons on this form.

Thanks again for the answers.

Bruce

Bobby Hartsfield wrote:
> Try here:
> http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54241
>
> ..:.:.:.:.:.:.:.:.:.:.:.
> Bobby Hartsfield
> http://acoderslife.com
>
>
>
>   

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301751
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String function question

2008-03-21 Thread Bruce Sorge
Two forms is not an option. The entire HTML is stored in the db. I will 
work on the regex some more to replace the in put elements with the 
submitted values. Regex is not a strong suite for me.

Bruce

Brad Wood wrote:
> If you know the form fields and their names ahead of time, you could lop
> over the names, replacing them one at a time pulling them out by name in
> your regex.  There may be a monster regex to do this in one fell swoop,
> but I wouldn't know it.
>
> Is there any chance you can have two version of the HTML form:  One with
> from fields, and one with form scoped output variables.  Then you could
> simply include the second file inside a cfsavecontent after the form
> post and the resultant HTML variable would contain all the values.
>
> The latter approach may be doable on-the-fly by converting your regex to
> strip out form fields and replace them with a CF variable of the same
> name.
>
> 
>   
> 
>
> Would become
>
>
> 
>   #form.my_form_field#
> 
>
> Just thoughts...
>
> ~Brad
>
>
>   

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301749
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: String function question

2008-03-21 Thread Bobby Hartsfield
Try here:
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54241

..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com



-Original Message-
From: Brad Wood [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2008 10:43 AM
To: CF-Talk
Subject: RE: String function question

If you know the form fields and their names ahead of time, you could lop
over the names, replacing them one at a time pulling them out by name in
your regex.  There may be a monster regex to do this in one fell swoop,
but I wouldn't know it.

Is there any chance you can have two version of the HTML form:  One with
from fields, and one with form scoped output variables.  Then you could
simply include the second file inside a cfsavecontent after the form
post and the resultant HTML variable would contain all the values.

The latter approach may be doable on-the-fly by converting your regex to
strip out form fields and replace them with a CF variable of the same
name.





Would become



#form.my_form_field#


Just thoughts...

~Brad


-Original Message-
From: Bruce Sorge [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2008 9:36 AM
To: CF-Talk
Subject: String function question

I have googled this all morning and I cannot find the answer, and I am 
running out of time. Here is my situation:
I have an HTML form that is being pulled from a database table. When the

form is submitted, they want the form submitted to them in a PDF that is

emailed as an attachment. I know how to do that part. What they want is 
for the submitted PDF to look exactly like the HTML form that they 
submitted, replacing the form elements with the submitted values. I am 
able to query the database and get the HTML form, using REReplace I can 
strip out all of the input and form elements as well, leaving me with 
the layout in tact. minus the input elements. What I cannot figure out 
though is how to get the submitted values to replace the void left when 
I strip the input elements.
I know that I need to find the form field names and then match them up 
to the submitted names and insert the values, but I don't exactly know 
how to go about this. Does this make sense?



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301748
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: String function question

2008-03-21 Thread Brad Wood
If you know the form fields and their names ahead of time, you could lop
over the names, replacing them one at a time pulling them out by name in
your regex.  There may be a monster regex to do this in one fell swoop,
but I wouldn't know it.

Is there any chance you can have two version of the HTML form:  One with
from fields, and one with form scoped output variables.  Then you could
simply include the second file inside a cfsavecontent after the form
post and the resultant HTML variable would contain all the values.

The latter approach may be doable on-the-fly by converting your regex to
strip out form fields and replace them with a CF variable of the same
name.





Would become



#form.my_form_field#


Just thoughts...

~Brad


-Original Message-
From: Bruce Sorge [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 21, 2008 9:36 AM
To: CF-Talk
Subject: String function question

I have googled this all morning and I cannot find the answer, and I am 
running out of time. Here is my situation:
I have an HTML form that is being pulled from a database table. When the

form is submitted, they want the form submitted to them in a PDF that is

emailed as an attachment. I know how to do that part. What they want is 
for the submitted PDF to look exactly like the HTML form that they 
submitted, replacing the form elements with the submitted values. I am 
able to query the database and get the HTML form, using REReplace I can 
strip out all of the input and form elements as well, leaving me with 
the layout in tact. minus the input elements. What I cannot figure out 
though is how to get the submitted values to replace the void left when 
I strip the input elements.
I know that I need to find the form field names and then match them up 
to the submitted names and insert the values, but I don't exactly know 
how to go about this. Does this make sense?

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301747
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String Function

2007-03-09 Thread Matt Quackenbush
Oooops... my bad.  I think I misread the email.  Refer back to what Charlie
said.  :-)



Actually, CF totally ignores "empty" list elements.  So, if you're using
> listToArray(), you'd just use it like normal.
>
> 
> 
> 


~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272258
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String Function

2007-03-09 Thread Matt Quackenbush
Actually, CF totally ignores "empty" list elements.  So, if you're using
listToArray(), you'd just use it like normal.






you'd need to do a replace() function on the string first to replace
> any instances of the delimiter appearing twice in succession with
> something like a space.
>
> 
> 
>
>
>
> On 3/9/07, Deepak Gupta <[EMAIL PROTECTED]> wrote:
> > What if i have
> > AB__BC_CD
> >
> > and instead of that blank after AB_ i want to replace this with a new
> value when i update this in database. Using arrays it won't take it right?
> >
> > and when i make a check in my update statement for neq "" . it doesnt
> work because it doesnt have any?
> >
> > do you have any suggestion then of storing these values and then looping
> them, and finally updating in DB
> >
> >
> > DG
>


~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272257
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String Function

2007-03-09 Thread Charlie Griefer
you'd need to do a replace() function on the string first to replace
any instances of the delimiter appearing twice in succession with
something like a space.






On 3/9/07, Deepak Gupta <[EMAIL PROTECTED]> wrote:
> What if i have
> AB__BC_CD
>
> and instead of that blank after AB_ i want to replace this with a new value 
> when i update this in database. Using arrays it won't take it right?
>
> and when i make a check in my update statement for neq "" . it doesnt work 
> because it doesnt have any?
>
> do you have any suggestion then of storing these values and then looping 
> them, and finally updating in DB
>
>
> DG
>
> >A one stop solution might be listToArray()
> >
> >
> >
> >#stringAry[2]#
> >--
> >Ian Skinner
> >Web Programmer
> >BloodSource
> >www.BloodSource.org
> >Sacramento, CA
> >
> >-
> >| 1 |   |
> >-  Binary Sudoku
> >|   |   |
> >-
> >
> >"C code. C code run. Run code run. Please!"
> >- Cynthia Dunning
> >
> >Confidentiality Notice:  This message including any
> >attachments is for the sole use of the intended
> >recipient(s) and may contain confidential and privileged
> >information. Any unauthorized review, use, disclosure or
> >distribution is prohibited. If you are not the
> >intended recipient, please contact the sender and
> >delete any copies of this message.
>
> 

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272176
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String Function

2007-03-09 Thread Deepak Gupta
What if i have
AB__BC_CD

and instead of that blank after AB_ i want to replace this with a new value 
when i update this in database. Using arrays it won't take it right?

and when i make a check in my update statement for neq "" . it doesnt work 
because it doesnt have any?

do you have any suggestion then of storing these values and then looping them, 
and finally updating in DB


DG

>A one stop solution might be listToArray()
>
>
>
>#stringAry[2]#
>--
>Ian Skinner
>Web Programmer
>BloodSource
>www.BloodSource.org
>Sacramento, CA
>
>-
>| 1 |   |
>-  Binary Sudoku
>|   |   |
>-
> 
>"C code. C code run. Run code run. Please!"
>- Cynthia Dunning
>
>Confidentiality Notice:  This message including any
>attachments is for the sole use of the intended
>recipient(s) and may contain confidential and privileged
>information. Any unauthorized review, use, disclosure or
>distribution is prohibited. If you are not the
>intended recipient, please contact the sender and
>delete any copies of this message.

~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272134
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String Function

2007-03-08 Thread Charlie Griefer
but you can determine that just as easily using the listLen() function :)

altho I do think Ian (and Eric's) suggestion about using listToArray()
is the most concise and straightforward.

On 3/8/07, Scott Weikert <[EMAIL PROTECTED]> wrote:
> Might be good to use an array to store the vars instead. That way you
> can always quickly determine the number of vars present.
>
> 
> 
>
> 
>  
> 
>
> I have #ArrayLen(myArray)# variables.
>
>
>
> 

~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272055
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String Function

2007-03-08 Thread Jon Clausen
Yep, that thread's good 'n dead. :-)   I don' t think I've seen a  
thread jumped on so fast since the one about the new Firefox logo.

Good call on  listToArray(), Ian, BTW.

-Jon

On Mar 8, 2007, at 2:40 PM, Jon Clausen wrote:

> Deepak,
>
> You should be able to use:
>
> 
> 
> 
> 
> 
>
> Or you can use listChangeDelims() : http://www.cfquickdocs.com/?
> sourceid=cfQDSearch1.02&getDoc=listChangeDelims
>
> HTH,
>
> Jon
>
> On Mar 8, 2007, at 1:19 PM, Deepak Gupta wrote:
>
>> Hi
>>
>> I have a string like this
>> AB_BC_DE
>>
>> Now i have to extract AB, BC, DE in seperate variables. How can I
>> do that? which function i can use.
>>
>>
>> DG
>>
>>
>
> 

~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272054
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String Function

2007-03-08 Thread Scott Weikert
Might be good to use an array to store the vars instead. That way you 
can always quickly determine the number of vars present.





 


I have #ArrayLen(myArray)# variables.



~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272053
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String Function

2007-03-08 Thread Charlie Griefer
On 3/8/07, Ian Skinner <[EMAIL PROTECTED]> wrote:
> A one stop solution might be listToArray()
>
> 
>
> #stringAry[2]#

nice!

-- 
Charlie Griefer


"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."

~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272052
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: String Function

2007-03-08 Thread Jones Eric R Ctr 8 AF Det 1/AFNOC



Then you can reference each as an array element to further process. 


---_

Eric R. Jones
Senior Web Application Developer, AFNOC/NCD
Barksdale AFB, LA
DSN 781-7784
Comm (318) 456-7784
NIPRNET: [EMAIL PROTECTED]
SIPRNET: [EMAIL PROTECTED] 


-Original Message-
From: Mosh Teitelbaum [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 08, 2007 1:36 PM
To: CF-Talk
Subject: RE: String Function

Deepak:

You can use the various List functions as long as you specify an
underscore
as the delimiter.  If the string is always going to have 3 elements to
it,
you could simply do something like:






If the string will not always be 3 elements long, combine ListGetAt()
with
ListLen() and loop over the length of the "list" to dynamically pull out
the
elements.

HTH

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


Deepak Gupta wrote:
> I have a string like this
> AB_BC_DE
> 
> Now i have to extract AB, BC, DE in seperate variables. How can I do
> that? which function i can use.





~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272051
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: String Function

2007-03-08 Thread Jones Eric R Ctr 8 AF Det 1/AFNOC


Then you can reference each as an array element to further process. 


---_

Eric R. Jones
Senior Web Application Developer, AFNOC/NCD
Barksdale AFB, LA
DSN 781-7784
Comm (318) 456-7784
NIPRNET: [EMAIL PROTECTED]
SIPRNET: [EMAIL PROTECTED] 


-Original Message-
From: Mosh Teitelbaum [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 08, 2007 1:36 PM
To: CF-Talk
Subject: RE: String Function

Deepak:

You can use the various List functions as long as you specify an
underscore
as the delimiter.  If the string is always going to have 3 elements to
it,
you could simply do something like:






If the string will not always be 3 elements long, combine ListGetAt()
with
ListLen() and loop over the length of the "list" to dynamically pull out
the
elements.

HTH

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


Deepak Gupta wrote:
> I have a string like this
> AB_BC_DE
> 
> Now i have to extract AB, BC, DE in seperate variables. How can I do
> that? which function i can use.





~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272050
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: String Function

2007-03-08 Thread Ian Skinner
A one stop solution might be listToArray()



#stringAry[2]#
--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Sudoku
|   |   |
-
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272048
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String Function

2007-03-08 Thread Jon Clausen
Deepak,

You should be able to use:







Or you can use listChangeDelims() : http://www.cfquickdocs.com/? 
sourceid=cfQDSearch1.02&getDoc=listChangeDelims

HTH,

Jon

On Mar 8, 2007, at 1:19 PM, Deepak Gupta wrote:

> Hi
>
> I have a string like this
> AB_BC_DE
>
> Now i have to extract AB, BC, DE in seperate variables. How can I  
> do that? which function i can use.
>
>
> DG
>
> 

~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272047
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: String Function

2007-03-08 Thread Ben Doom
Use the standard list functions (like listgetat()) using "_" as the 
delimiter.  So, to get BC, you could use

listgetat(list, 2, "_")

--Ben Doom


Deepak Gupta wrote:
> Hi
> 
> I have a string like this
> AB_BC_DE
> 
> Now i have to extract AB, BC, DE in seperate variables. How can I do that? 
> which function i can use.
> 
> 
> DG
> 
> 

~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272046
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: String Function

2007-03-08 Thread Andy Matthews
Use ListGetAt:

ListGetAt(string,1,"_")  would give you AB
ListGetAt(string,2,"_")  would give you BC, etc.

-Original Message-
From: Deepak Gupta [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 08, 2007 12:20 PM
To: CF-Talk
Subject: String Function

Hi

I have a string like this
AB_BC_DE

Now i have to extract AB, BC, DE in seperate variables. How can I do that? 
which function i can use.


DG



~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272045
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: String Function

2007-03-08 Thread Charlie Griefer
loop over it treating as a list delimited by the underscore character.





 
 



#myVar1#
#myVar2#
#myVar3#


On 3/8/07, Deepak Gupta <[EMAIL PROTECTED]> wrote:
> Hi
>
> I have a string like this
> AB_BC_DE
>
> Now i have to extract AB, BC, DE in seperate variables. How can I do that? 
> which function i can use.
>
>
> DG
>
> 

~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272044
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: String Function

2007-03-08 Thread Mosh Teitelbaum
Deepak:

You can use the various List functions as long as you specify an underscore
as the delimiter.  If the string is always going to have 3 elements to it,
you could simply do something like:






If the string will not always be 3 elements long, combine ListGetAt() with
ListLen() and loop over the length of the "list" to dynamically pull out the
elements.

HTH

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


Deepak Gupta wrote:
> I have a string like this
> AB_BC_DE
> 
> Now i have to extract AB, BC, DE in seperate variables. How can I do
> that? which function i can use.



~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272043
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: String Function in Update Form

2004-09-15 Thread Eric Davis
BINGO!

 
Thanks...

Eric Davis 
Webmaster, Worthington Public Library 
820 High St. 
Worthington, Ohio 43085 
E-mail: [EMAIL PROTECTED] 
WWW: http://www.worthingtonlibraries.org
  
Phone: 614-645-2620 Ext. 236 
Fax: 614-645-2629 

-Original Message-
From: Joe Rinehart [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 15, 2004 2:15 PM
To: CF-Talk
Subject: Re: String Function in Update Form

I think this is done automatically in MX, but if you're pre-mx, try:


value="#HTMLEditFormat(Title)#">

-joe

- Original Message -
From: Eric Davis <[EMAIL PROTECTED]>
Date: Wed, 15 Sep 2004 14:02:05 -0400
Subject: String Function in Update Form
To: CF-Talk <[EMAIL PROTECTED]>

I have a record where the Title field is:

Marysville "Monarchs" vs. Worthington "Cardinals"

This string is passed to the database with no problem using my input form.

The problem arises when I try to populate an update form with this same
string.

Here's the code for the update form:



Here's what this code outputs: 

Title: Marysville

Obviously I need to add some sort of a string function to accommodate the
quotes in the title data.

Any recommendations?

Eric Davis 
Webmaster, Worthington Public Library 
820 High St. 
Worthington, Ohio 43085 
E-mail: [EMAIL PROTECTED] 
WWW: http://www.worthingtonlibraries.org
  
Phone: 614-645-2620 Ext. 236 
Fax: 614-645-2629 
  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: String Function in Update Form

2004-09-15 Thread Joe Rinehart
I think this is done automatically in MX, but if you're pre-mx, try:


value="#HTMLEditFormat(Title)#">

-joe

- Original Message -
From: Eric Davis <[EMAIL PROTECTED]>
Date: Wed, 15 Sep 2004 14:02:05 -0400
Subject: String Function in Update Form
To: CF-Talk <[EMAIL PROTECTED]>

I have a record where the Title field is:

Marysville "Monarchs" vs. Worthington "Cardinals"

This string is passed to the database with no problem using my input form.

The problem arises when I try to populate an update form with this same
 string.

Here's the code for the update form:



Here's what this code outputs: 

Title: Marysville

Obviously I need to add some sort of a string function to accommodate the
 quotes in the title data.

Any recommendations?

Eric Davis 
 Webmaster, Worthington Public Library 
 820 High St. 
 Worthington, Ohio 43085 
 E-mail: [EMAIL PROTECTED] 
 WWW: http://www.worthingtonlibraries.org
   
 Phone: 614-645-2620 Ext. 236 
 Fax: 614-645-2629
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]