ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old April 5th, 2005, 10:20 AM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
Replace()

I read the macromedia docs, but they never really help me... I am wanting to replace any *br* on the page with <br> but i don't know what to set the string as

Reply With Quote
  #2  
Old April 5th, 2005, 08:41 PM
mortisRider mortisRider is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 21 mortisRider User rank is Private First Class (20 - 50 Reputation Level)mortisRider User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 25 m 51 sec
Reputation Power: 0
<CFSET FOO = Replace(#BAR#, "<BR>", "br", "ALL")>

Reply With Quote
  #3  
Old April 5th, 2005, 10:09 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,618 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 44 m 33 sec
Reputation Power: 53
I'm not sure how much more clear this can be. There's even an example at the bottom of the page. What more do you want?
Comments on this post
Alas agrees!
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old April 6th, 2005, 03:19 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
You don't have to be rude, this is a place where are are trying to get help. Being new to CF, no I do not understand that page.
'A string or a variable that contains one. String in which to search'
I wanted to search the whole page, so i did not know what to put in the first spot. I tried putting <br> there sicne that's what I wanted replaced, and it gives the error "< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?"
I didn't know what else to try, considering the only examples they give are FORM examples - SORRY.

mortisRider
Thanks for the reply. I was just wondering where you got the #bar# variable from.. because it says it's undefined. Can i just stick this at the top of the page and it will replace them all? Thanks for the help.



Quote:
Originally Posted by kiteless
I'm not sure how much more clear this can be. There's even an example at the bottom of the page. What more do you want?

Last edited by charmed0rz : April 6th, 2005 at 03:29 PM.

Reply With Quote
  #5  
Old April 6th, 2005, 03:52 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,618 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 44 m 33 sec
Reputation Power: 53
Uh, what exactly did I say that was rude? Why is it that you are so thin-skinned that my simply asking "what more do you want" is interpreted by you to be rude? I spend many hours each week answering questions here. Haven't I answered your questions on many occasions (including this one)?

And I hate to break this to you, but if you can't read that documentation page, look at the function arguments, read the example, and then have at least some idea of what the function does and how it works (enough to make some experimental attempts), then you are going to have a really hard time learning CFML (or any programming language for that matter...most are far more difficult than CFML).

However, I don't think this is the case. I think you are smarter than that. I think you just didn't really look the docs over and attempt to figure out how the function works on your own. I am all for helping people when they need it, but I do expect people to read the docs and do some experimenting on their own before they run to the forum to ask a very simple question. Please, next time you have an issue, try to work through it yourself first and if it still doesn't work then post the experimental code that you tried and I or others will be happy to help.

Last edited by kiteless : April 6th, 2005 at 09:14 PM.

Reply With Quote
  #6  
Old April 6th, 2005, 04:05 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,618 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 44 m 33 sec
Reputation Power: 53
Quote:
Originally Posted by charmed0rz
I was just wondering where you got the #bar# variable from.. because it says it's undefined. Can i just stick this at the top of the page and it will replace them all? Thanks for the help.


Back to the question, #bar# is whatever variable you want to do the replacing on. If you have a form variable that you want to replace, it would be #form.whatever#, if it is a query column it would be #myquery.whatever#. In other words, the function only runs on a string or a variable that contains a string...that means that whatever text you want to do the replace on must be fed into the function. If you want to do the replace on some generated content, you can look into using the <cfsavecontent> tag to capture the text into a variable, and you can then pass that variable into the replace() function. Something like:

<cfsavecontent variable="theContent">
Here is some text. It might have a br in it.
</cfsavecontent>
<cfsavecontent variable="theBR"><br/></cfsavecontent>
<cfset theContent = replaceNoCase( theContent, 'br', theBR, 'all' ) />
<cfoutput>#theContent#</cfoutput>

Last edited by kiteless : April 6th, 2005 at 09:11 PM.

Reply With Quote
  #7  
Old April 9th, 2005, 02:45 AM
Alas's Avatar
Alas Alas is offline
Wickedwd.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: wickedwd.com
Posts: 183 Alas Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 16 h 46 m 44 sec
Reputation Power: 0
Roughing up noobs again Kiteless? lol

Reply With Quote
  #8  
Old April 9th, 2005, 12:49 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,618 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 44 m 33 sec
Reputation Power: 53
Only when provoked, Alas.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Replace()


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway