Re: replace function
ListQualify("bob,carol,ted,alice", '"') On Fri, Apr 8, 2011 at 2:21 PM, Les Irvin wrote: > > How can I convert this string: > > "bob,carol,ted,alice" > > to this: > > "bob","carol","ted","alice" > > my replace() skills are not up to snuff... > > many thanks, > Les > > ~| 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:343626 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
replace function
How can I convert this string: "bob,carol,ted,alice" to this: "bob","carol","ted","alice" my replace() skills are not up to snuff... many thanks, Les ~| 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:343625 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Replace function
It does look like it's supposed to be a carriage return, but the code is expecting cr to be a variable, probably that has the carriage return ASCII code in it. You could try "#chr(13)##chr(10)#" instead, or just chr(10). > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Friday, November 17, 2006 1:40 PM > To: CF-Talk > Subject: Replace function > > All, > > I reusing some code that uses replace to output data from a > textbox datatype in SQL Server > and I'm scratching my head on what "cr" is. Is that suppose > to be a carriage return? Should > I be using a charactor symbol instead of "cr" > > inside of cfoutput of a query... > #ParagraphFormat(Replace(all_recipes.ingredients,cr,"","all"))# > > I'm getting the error ... > > Variable CR is undefined. "EMF " made the following annotations. -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260939 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Replace function
On 11/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I reusing some code that uses replace to output data from a textbox datatype > in SQL Server > and I'm scratching my head on what "cr" is. Is that suppose to be a carriage > return? You probably had a variable called cr, something like this: -- Pete Freitag http://foundeo.com/ - ColdFusion Consulting & Products http://petefreitag.com/ - My Blog http://spendfish.com/ - Fish for Deals ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260938 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Replace function
All, I reusing some code that uses replace to output data from a textbox datatype in SQL Server and I'm scratching my head on what "cr" is. Is that suppose to be a carriage return? Should I be using a charactor symbol instead of "cr" inside of cfoutput of a query... #ParagraphFormat(Replace(all_recipes.ingredients,cr,"","all"))# I'm getting the error ... Variable CR is undefined. The error occurred in D:\Inetpub\wwwroot\website\file.cfm: line 128 126 : 127 : 128 : #ParagraphFormat(Replace(sfc_all_recipes.ingredients,cr,"","all"))# 129 : 130 : Ingredient list second 6 items ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260933 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
>>What if a manager would like a printout of the days of the week and which employees are available to work on each of those days. If I worked for a company and had a manager liable to ask anything after a project has been designed, then of course, I would take a belt and suspenders and use a cross table. For the time being, I'm my own manager, and I have my customers pay for what the need, not for what they could possibly need in a couple of years. If they need new features later (and sometimes they do), I charge them for whatever it takes for doing it. Look, I never said that using cross tables is an heresy. I just say that saying "always use cross table" is abusive for the least, and I would even qualify it as a proof of lack of experience. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257715 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
On 10/21/06, Andrew Tyrone <[EMAIL PROTECTED]> wrote: > > Just put the days in the list, not codes ;-)) > > That will make a field with a max of what? 50 characters may be? Big > > deal! ;-) > > And...? It doesn't matter which types of data you store in those lists. > How would you return a workable query? You can't, and you'd have to jump Well, MySQL has some stuff for working with lists... I don't like it, because it's one of those things that locks you in with a DB, but hell, who are we kidding? At any rate, don't pre-optimize or whatever, neh? Wot Wot (I think that may be brittish for what what, but I'm not certain) I'm not sure it's cut and dry. There are times where it is much easier to use a list than a link table. I guess it's one of those judgement calls. If only we didn't need judgement, neh? *sigh* 'Prolly be boring as hell... G'night folks- strange as it is to say stuff like that in a timeless medium, or whatever. Heh. =] ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257699 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop bo x options?
> Just put the days in the list, not codes ;-)) > That will make a field with a max of what? 50 characters may be? Big > deal! ;-) And...? It doesn't matter which types of data you store in those lists. How would you return a workable query? You can't, and you'd have to jump through a bunch of hoops and use CF code to sort it all out, just because you didn't want to use a link table. This isn't about how much data is stored as much as it is about the efficiency with which you can use the data. From your example, a simple, useful report would take workarounds to produce just because you refused to use a link table and save a few hundred extra kilobytes or so. Andy ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257693 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
>>In this specific case, you have a fixed list of Boolean values. I said a "short list", it doesn't have to be fixed. It can be a list of codes related to a table with codes and description, and this table is expandable. But you don't always need a cross table between them. I use this for permissions to access areas in my CMS system. For the time being, I have about 15 areas to 20, this system could be good for more than 100 different areas, but I KNOW that I'll never need that much, it's as simple as that. I also have in the same database about 7500 photographs, and 2 individuals, each of whom may be identified in several photos, and yes, in THAT case I use a cross table. It's just a matter of judgment. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257681 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Can I use replace function on a string to create form drop bo x options?
>>Before I take short cuts, the first thing that comes to mind is, "I hope I won't need to redo this later." Then if you're not sure, don't do it. >>The purpose of and RDBMS is storing data in a relational way in the first place, Right, when there is a relation worth to be treated as such. >>so using one join to get at additional data isn't taboo; these systems are made for that type of work. Harvesters are also mad to cut grass, though I don't use them to mow my green in my yard ;-) >>You can grab the items from the link table and use ValueList() if you want to put them in a list. This is what I do when the list is worth to be stored in a table. >>What if a manager would like a printout of the days of the week and which employees are available to work on each of those days. Show me, using a single query, how you'd list all employees grouped by the days they work. Just put the days in the list, not codes ;-)) That will make a field with a max of what? 50 characters may be? Big deal! ;-) ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257679 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop bo x options?
> 1º using a (small) list is not a workaround, it is a short cut. Whatever you want to call it, doesn't matter to me. I find that, for me, taking short cuts now often means longer detours later. > 2º updating one field in a table is much more straightforward > than updating a multi records cross table. It takes me less than five minutes to write the logic within a page that updates multiple records. I can't imagine it would take you any longer. Therefore, the time you're saving with your shortcut is negligible. > For instance, if you need to store in an employee table which > days in the week he is ok to work, will you create a table > with the 7 days in the week and a cross table between the > employees and the days? > SURE, just in case some one decides to make an eigth day in > the week, who knows! This example has a couple of characteristics that are clearly identifiable; if you wanted to say that, in the case where you have those characteristics you might take an alternate approach, that's fine. In this specific case, you have a fixed list of Boolean values. But you don't say that, you simply say "take shortcuts" instead of "when you have a fixed list of Boolean values, you can store that within a single field of your existing table". And, in this case, you still wouldn't want to store this as a list, because that's more complicated than necessary. You'd simply use bit fields within your table. Now, that's not a shortcut, it's the proper way to handle a fixed list of Boolean values. So, in summary, your shortcut sucks. > This is ridiculous. ;-) Yes, it is. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257676 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop bo x options?
> 1º using a (small) list is not a workaround, it is a short cut. Before I take short cuts, the first thing that comes to mind is, "I hope I won't need to redo this later." > 2º updating one field in a table is much more straightforward than > updating a multi records cross table. If you mean the SQL is easier to write, then yes, but I would only say it's "faster to write", since most link table queries and code can be re-used with little modification once you've written them before. > 3º you don't need a joined table in the query, just one table; The purpose of and RDBMS is storing data in a relational way in the first place, so using one join to get at additional data isn't taboo; these systems are made for that type of work. > 4º you don't need a query each time you want to check if an > item has a > certain property, > you just check for the property in a list, which you can > even store > in a session variable. You can grab the items from the link table and use ValueList() if you want to put them in a list. > 5º only beginners go by the bible, experienced programmers > know short cuts. Experienced programmers are experienced because they've learned a lot of do's and donts from experienced programmers that came before them. > 6º bibles are made for beginners; One thing that experts and true beginners have in common: they both know they still have a lot to learn. > 7º beginners are supposed to learn from experience, if they keep on > going by the bible, > and don't experiment, they will remain beginners... Beginners learn from a lot of different sources, and one of the major sources is the experience of others who have tried something 10 different ways. > For instance, if you need to store in an employee table which days in > the week he is ok to work, > will you create a table with the 7 days in the week and a cross table > between the employees and the days? > SURE, just in case some one decides to make an eigth day in the week, > who knows! > This is ridiculous. ;-) What if a manager would like a printout of the days of the week and which employees are available to work on each of those days. Show me, using a single query, how you'd list all employees grouped by the days they work. Andy ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257675 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop bo x options?
>>Why bother implementing a bunch of workarounds, etc, when you can just build a table and the appropriate relationship? C'mon, we've discussed this many times, 1º using a (small) list is not a workaround, it is a short cut. 2º updating one field in a table is much more straightforward than updating a multi records cross table. 3º you don't need a joined table in the query, just one table; 4º you don't need a query each time you want to check if an item has a certain property, you just check for the property in a list, which you can even store in a session variable. 5º only beginners go by the bible, experienced programmers know short cuts. 6º bibles are made for beginners; 7º beginners are supposed to learn from experience, if they keep on going by the bible, and don't experiment, they will remain beginners... For instance, if you need to store in an employee table which days in the week he is ok to work, will you create a table with the 7 days in the week and a cross table between the employees and the days? SURE, just in case some one decides to make an eigth day in the week, who knows! This is ridiculous. ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257670 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop bo x options?
> > I'd actually rather brush my teeth with a chainsaw than > > store a delimited list in a database field > > You see? This is unbelievable what kind of weirdness people > can do when they go by the book ;-) I've got to agree with Andrew here. Why bother implementing a bunch of workarounds, etc, when you can just build a table and the appropriate relationship? It would take me less time to do it the right way than the wrong way. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257666 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop box options?
>>I'd actually rather brush my teeth with a chainsaw than store a delimited list in a database field You see? This is unbelievable what kind of weirdness people can do when they go by the book ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257653 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Can I use replace function on a string to create form drop box options?
>>i said GENERALLY Good point ;-) -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257652 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Can I use replace function on a string to create form drop box options?
> Argh... I was affraid someone would indeed :-) > > This is right IN THEORY, and in most cases, but in practice, when the > list has only a few elements, > and is not expected to have many ever, a list in one field is > a much simpler > and more efficient solution. I'd actually rather brush my teeth with a chainsaw than store a delimited list in a database field, even if I was building a small application for myself. I made that mistake a couple times, once in a very large application, and it cost me a good amount of time and money to fix it. Andy ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257651 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Can I use replace function on a string to create form drop box options?
i said GENERALLY :P On 10/20/06, Claude Schneegans <[EMAIL PROTECTED]> wrote: > >>and just because if i don't say it, somebody else will... > > Argh... I was affraid someone would indeed :-) > > This is right IN THEORY, and in most cases, but in practice, when the > list has only a few elements, > and is not expected to have many ever, a list in one field is a much simpler > and more efficient solution. > > -- > ___ > REUSE CODE! Use custom tags; > See http://www.contentbox.com/claude/customtags/tagstore.cfm > (Please send any spam to this address: [EMAIL PROTECTED]) > Thanks. > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257647 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Can I use replace function on a string to create form drop box options?
>>and just because if i don't say it, somebody else will... Argh... I was affraid someone would indeed :-) This is right IN THEORY, and in most cases, but in practice, when the list has only a few elements, and is not expected to have many ever, a list in one field is a much simpler and more efficient solution. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257646 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Can I use replace function on a string to create form drop box options?
That worked perfectly. So simple too. Yes, I understand the practice is not the best, and I see potential problems in the future by storing this string in the field. This is just a one-time thing, used for just two records that I was hoping for a quick shortcut that tutned into a mini-project. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257616 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Can I use replace function on a string to create form drop box options?
#listItem# > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday, October 20, 2006 1:27 PM > To: CF-Talk > Subject: Can I use replace function on a string to create form drop box > options? > > > > I've got a database field called option1 that contains two colors > seperated by a comma: "red,yellow". > > What I'm trying to do is create a drop down form box that takes each color > (delineated by the comma) and puts it into it's own > option value like this: > > > red > yellow > > > My first attempts have been with the replace function: > > ","ALL")#"> > > #size# > > > However, it appears to be more complicated than that, that getting em only > part of the option value line. > > Any suggestions or alternatives I'm not seeing here would be most > appreciated. > > -jeff > > > > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257613 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Can I use replace function on a string to create form drop box options?
and just because if i don't say it, somebody else will... it's generally not a good idea to store lists (delimited data) in relational databases. you've got a one-to-many relationship and would probably run into fewer issues in the future if you were to break it out as such. On 10/20/06, Charlie Griefer <[EMAIL PROTECTED]> wrote: > why not just: > > > #i# > > > On 10/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > I've got a database field called option1 that contains two colors seperated > > by a comma: "red,yellow". > > > > What I'm trying to do is create a drop down form box that takes each color > > (delineated by the comma) and puts it into it's own > > option value like this: > > > > > > red > > yellow > > > > > > My first attempts have been with the replace function: > > > > ","ALL")#"> > > > > #size# > > > > > > However, it appears to be more complicated than that, that getting em only > > part of the option value line. > > > > Any suggestions or alternatives I'm not seeing here would be most > > appreciated. > > > > -jeff > > > > > > > > > > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257614 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Can I use replace function on a string to create form drop box options?
why not just: #i# On 10/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > I've got a database field called option1 that contains two colors seperated > by a comma: "red,yellow". > > What I'm trying to do is create a drop down form box that takes each color > (delineated by the comma) and puts it into it's own > option value like this: > > > red > yellow > > > My first attempts have been with the replace function: > > ","ALL")#"> > > #size# > > > However, it appears to be more complicated than that, that getting em only > part of the option value line. > > Any suggestions or alternatives I'm not seeing here would be most appreciated. > > -jeff > > > > > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257611 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Can I use replace function on a string to create form drop box options?
I've got a database field called option1 that contains two colors seperated by a comma: "red,yellow". What I'm trying to do is create a drop down form box that takes each color (delineated by the comma) and puts it into it's own option value like this: red yellow My first attempts have been with the replace function: ","ALL")#"> #size# However, it appears to be more complicated than that, that getting em only part of the option value line. Any suggestions or alternatives I'm not seeing here would be most appreciated. -jeff ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257610 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: replace function
You need to add the parameter "All" as the scope in your Replace tag -- Replace(get_ing_img.sbclc_item, " ", "", "All") That tells it to replace all occurrences rather than just the first one. -- Josh - Original Message - From: <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Monday, October 02, 2006 9:38 AM Subject: replace function > I'm trying to replace any black spaces in a string with nothing, > essentially removing the black > space. However, when I come accros a string like, "light sour cream", my > code below only > returns lightsour cream. It does replace the second space. Shouldn't it? > > I'm using ... > > get_ing_img.sbclc_item is query result which contains a string > > > Replaces occurrences of substring1 in a string with substring2, in a > specified scope. The search is case-sensitive. > FORMAT:#Replace(FORM.myString, FORM.MySubstring1, FORM.mySubString2)# > > D > > ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255036 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: replace function
That last argument should be "ALL". -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 02, 2006 11:38 AM To: CF-Talk Subject: replace function I'm trying to replace any black spaces in a string with nothing, essentially removing the black space. However, when I come accros a string like, "light sour cream", my code below only returns lightsour cream. It does replace the second space. Shouldn't it? I'm using ... get_ing_img.sbclc_item is query result which contains a string Replaces occurrences of substring1 in a string with substring2, in a specified scope. The search is case-sensitive. FORMAT:#Replace(FORM.myString, FORM.MySubstring1, FORM.mySubString2)# D ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255032 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: replace function
There's a fourth argument, which says to either replace only the first instance of the substring ("ONE"), or all instances of the substring ("ALL"). "ONE" is the default. To replace all the spaces, you need #Replace(get_ing_img.sbclc_itme, " ", "", "ALL)# See the docs for more details. > I'm trying to replace any black spaces in a string with nothing, > essentially removing the black > space. However, when I come accros a string like, "light sour cream", > my code below only > returns lightsour cream. It does replace the second space. Shouldn't > it? > > I'm using ... > > get_ing_img.sbclc_item is query result which contains a string > > > Replaces occurrences of substring1 in a string with substring2, in a > specified scope. The search is case-sensitive. > FORMAT:#Replace(FORM.myString, FORM.MySubstring1, FORM.mySubString2)# > D ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255030 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
replace function
I'm trying to replace any black spaces in a string with nothing, essentially removing the black space. However, when I come accros a string like, "light sour cream", my code below only returns lightsour cream. It does replace the second space. Shouldn't it? I'm using ... get_ing_img.sbclc_item is query result which contains a string Replaces occurrences of substring1 in a string with substring2, in a specified scope. The search is case-sensitive. FORMAT:#Replace(FORM.myString, FORM.MySubstring1, FORM.mySubString2)# D ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255029 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Replace function
#ReplaceList(co1005, "<,>", ",")# Robert Orlini wrote: > I am using the Replace function to clear a "<" character in a > column. > > The line I use to display between is: #replace(col005, > "<", "", "all")#. > > This is probably simple, but the column data contains another > character I want to delete as well a: ">". How do I specify that > in the Replace function line I created above? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Replace function
Works great. Thanks Ben! Robert O. -Original Message- From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 26, 2003 12:16 PM To: CF-Talk Subject: RE: Replace function You do it twice: #replace(replace(col005, "<", "", "all"), ">", "", "all")# -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -Original Message- : From: Robert Orlini [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 26, 2003 11:57 AM : To: CF-Talk : Subject: Replace function : : : I am using the Replace function to clear a "<" character in a column. : : The line I use to display between is: #replace(col005, : "<", "", "all")#. : : This is probably simple, but the column data contains another : character I want to delete as well a: ">". How do I specify that : in the Replace function line I created above? : : Thanks. : : Robert Orlini : HWW : : : ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Replace function
You do it twice: #replace(replace(col005, "<", "", "all"), ">", "", "all")# -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -Original Message- : From: Robert Orlini [mailto:[EMAIL PROTECTED] : Sent: Wednesday, March 26, 2003 11:57 AM : To: CF-Talk : Subject: Replace function : : : I am using the Replace function to clear a "<" character in a column. : : The line I use to display between is: #replace(col005, : "<", "", "all")#. : : This is probably simple, but the column data contains another : character I want to delete as well a: ">". How do I specify that : in the Replace function line I created above? : : Thanks. : : Robert Orlini : HWW : : : ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Replace function
I am using the Replace function to clear a "<" character in a column. The line I use to display between is: #replace(col005, "<", "", "all")#. This is probably simple, but the column data contains another character I want to delete as well a: ">". How do I specify that in the Replace function line I created above? Thanks. Robert Orlini HWW ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: REReplace and Replace function
>This makes the function much more powerful and often more useful, but at the >expense of overhead. To what extent? I mean would I be better off using ReReplace(string, "a|b|c", "", "ALL") or Replace(string, "a", "") Replace(string, "b", "") Replace(string, "c", "") Just curious... I use them both ALOT - Original Message - From: "Ben Doom" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, February 14, 2003 2:51 PM Subject: RE: REReplace and Replace function > Replace() looks for a literal string within another string and replaces it > with yet a third string: > Replace(contentstring, stringtoreplace, replacement); > > With REReplace(), you can search for and replace with regular expressions. > This makes the function much more powerful and often more useful, but at the > expense of overhead. > > For simple replaces, use the simple replace() :-) > > If you want to know more about regular expressions, House of Fusion also > hosts the CF-RegEx list, on which several of the CF Regex Ninjas answer > questions both simple and advanced. We'd be happy to help you out. > http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21 > > > -- Ben Doom > Programmer & General Lackey > Moonbow Software, Inc > > : -Original Message- > : From: Tuan [mailto:[EMAIL PROTECTED]] > : Sent: Friday, February 14, 2003 2:39 PM > : To: CF-Talk > : Subject: REReplace and Replace function > : > : > : Can somebody explain what the difference is between the REReplace > : and Replace function? Im confused when to use one or the other > : and their differences. > : > : > : > : > : > : > : > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re:RE: REReplace and Replace function
Thanks for all the replies. It really helped me understand the difference between the two. I think i need to read more on reg expressions. -- "Ben Doom" <[EMAIL PROTECTED]> writes: Replace() looks for a literal string within another string and replaces it with yet a third string: Replace(contentstring, stringtoreplace, replacement); With REReplace(), you can search for and replace with regular expressions. This makes the function much more powerful and often more useful, but at the expense of overhead. For simple replaces, use the simple replace() :-) If you want to know more about regular expressions, House of Fusion also hosts the CF-RegEx list, on which several of the CF Regex Ninjas answer questions both simple and advanced. We'd be happy to help you out. http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21 -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -Original Message- : From: Tuan [mailto:[EMAIL PROTECTED]] : Sent: Friday, February 14, 2003 2:39 PM : To: CF-Talk : Subject: REReplace and Replace function : : : Can somebody explain what the difference is between the REReplace : and Replace function? Im confused when to use one or the other : and their differences. : : : : : : : ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: REReplace and Replace function
: Regular Expressions can be quite powerful, and I've only scratched the : surface. The syntax can be hard to grok, though. (I don't pretend to be : anything but a Regular Expression amateur.) If you knew the number of times that this particular RENinja learned a new trick from an ameteur who did something completely original -- Ben Doom of the Regex Ninja Clan ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: REReplace and Replace function
Replace() looks for a literal string within another string and replaces it with yet a third string: Replace(contentstring, stringtoreplace, replacement); With REReplace(), you can search for and replace with regular expressions. This makes the function much more powerful and often more useful, but at the expense of overhead. For simple replaces, use the simple replace() :-) If you want to know more about regular expressions, House of Fusion also hosts the CF-RegEx list, on which several of the CF Regex Ninjas answer questions both simple and advanced. We'd be happy to help you out. http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21 -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -Original Message- : From: Tuan [mailto:[EMAIL PROTECTED]] : Sent: Friday, February 14, 2003 2:39 PM : To: CF-Talk : Subject: REReplace and Replace function : : : Can somebody explain what the difference is between the REReplace : and Replace function? Im confused when to use one or the other : and their differences. : : : : : : : ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: REReplace and Replace function
> From: Tuan [mailto:[EMAIL PROTECTED]] > > Can somebody explain what the difference is between the > REReplace and Replace function? Im confused when to use one > or the other and their differences. Here's an example. If I wanted to remove the number 1 from this string, that's simply Replace(myString,"1","","ALL") But if I wanted to remove all the numbers, I'd have to do Replace(myString,"1","","ALL") Replace(myString,"2","","ALL") Replace(myString,"3","","ALL") Replace(myString,"4","","ALL") Replace(myString,"5","","ALL") Replace(myString,"6","","ALL") Replace(myString,"7","","ALL") Replace(myString,"8","","ALL") Replace(myString,"9","","ALL") Replace(myString,"0","","ALL") Or REReplace(myString,"[^0-9]","","ALL") Regular Expressions can be quite powerful, and I've only scratched the surface. The syntax can be hard to grok, though. (I don't pretend to be anything but a Regular Expression amateur.) ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: REReplace and Replace function
Tuan writes: > Can somebody explain what the difference is between the REReplace and Replace >function? Im confused when to use one or the other and their differences. replace() is a simple function to replace one character (or string of characters) with another. for example, in the string "the quick brown fox jumped over the lazy dog", you could replace the word 'fox' with 'goldfish' by doing: reReplace() uses regular expressions (pattern matching) to determine what item/string/characters to replace. Instead of specifying a particular string/character to be replaced, you can specify a pattern (for example, the word 'foo' only if it's the last word in a sentence). I unfortunately still haven't fulfilled my ambition of learning regular expressions...but I'm sure that Ben Doom, the cf-talk RegExp Ninja (tm) will be happy to elaborate there :) Charlie > > > > > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: REReplace and Replace function
reReplace = replaces based on a RE (Regular Expression) and Replace = replaces based on a string literal? or string? ...tony Tony Weeg Senior Web Developer UnCertified Advanced ColdFusion Developer Information System Design Navtrak, Inc. Mobile workforce monitoring, mapping & reporting www.navtrak.net 410.548.2337 -Original Message- From: Tuan [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:39 PM To: CF-Talk Subject: REReplace and Replace function Can somebody explain what the difference is between the REReplace and Replace function? Im confused when to use one or the other and their differences. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
REReplace and Replace function
Can somebody explain what the difference is between the REReplace and Replace function? Im confused when to use one or the other and their differences. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
replace function problem
Hi, Thanx for yr response.. Actually i used it.. but no result.. Pls from the following line onwards copy into cfm page then u can read easily.. Here i explained the problem by giving the comments.. Pls any one faced this type of problem. how we can solve it.. Can we send the "&" data in to CFWDDX (action = wddxtocfml).. 09 "#EZB_PO_WDDX.Header.BillToPerson.Address[1].City#"> 10 #EZB_PO_WDDX.Header.BillToPerson.Address[1].City# 11 12 #aacity# I would appreciate even your valuable suggestions also.. Thanx in advance Ramesh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Replace function(very urgent)
have u try this: -Original Message- From: ramesh deva [mailto:[EMAIL PROTECTED]] Sent: Thursday, 18 January 2001 3:07 PM To: CF-Talk Subject: Replace function(very urgent) Hi Here i have wddx_packet variable, it contains text file So my question is can i replace whole file by using following code. Becos when i use this code Getting this error:- An error occurred while evaluating the expression: EZB_PO_WDDX = Replace(#EZB_PO_WDDX#,"~","&","ALL") Error near line 310, column 11. Parameter 1 of function Replace must be a basic value, i.e., a string, number, logical, or date/time value i am here Thanx in advance Ramesh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Replace function(very urgent)
And calm down! ** Information in this email is confidential and may be privileged. It is intended for the addressee only. If you have received it in error, please notify the sender immediately and delete it from your system. You should not otherwise copy it, retransmit it or use or disclose its contents to anyone. Thank you for your co-operation. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Replace function
Ramesh wddx_packet is a string but output is a complex data type depending on what the packet contains. You could operate on wddx_packet before converting it. Or would the ampersands invalidate the XML?... try it & see. Nick -Original Message- From: ramesh deva [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 18, 2001 7:06 AM To: CF-Talk Subject: Replace function Hi Here i have wddx_packet variable, it contains text file So my question is can i replace whole file by using following code. Becos when i use this code Getting this error:- An error occurred while evaluating the expression: EZB_PO_WDDX = Replace(#EZB_PO_WDDX#,"~","&","ALL") Error near line 310, column 11. Parameter 1 of function Replace must be a basic value, i.e., a string, number, logical, or date/time value i am here Thanx in advance Ramesh ** Information in this email is confidential and may be privileged. It is intended for the addressee only. If you have received it in error, please notify the sender immediately and delete it from your system. You should not otherwise copy it, retransmit it or use or disclose its contents to anyone. Thank you for your co-operation. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Replace function(very urgent)
Hi Here i have wddx_packet variable, it contains text file So my question is can i replace whole file by using following code. Becos when i use this code Getting this error:- An error occurred while evaluating the expression: EZB_PO_WDDX = Replace(#EZB_PO_WDDX#,"~","&","ALL") Error near line 310, column 11. Parameter 1 of function Replace must be a basic value, i.e., a string, number, logical, or date/time value i am here Thanx in advance Ramesh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Replace function
Hi Here i have wddx_packet variable, it contains text file So my question is can i replace whole file by using following code. Becos when i use this code Getting this error:- An error occurred while evaluating the expression: EZB_PO_WDDX = Replace(#EZB_PO_WDDX#,"~","&","ALL") Error near line 310, column 11. Parameter 1 of function Replace must be a basic value, i.e., a string, number, logical, or date/time value i am here Thanx in advance Ramesh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Replace function
Hi Here i have wddx_packet variable, it contains text file So my question is can i replace whole file by using following code. Becos when i use this code Getting this error:- An error occurred while evaluating the expression: EZB_PO_WDDX = Replace(#EZB_PO_WDDX#,"~","&","ALL") Error near line 310, column 11. Parameter 1 of function Replace must be a basic value, i.e., a string, number, logical, or date/time value i am here Thanx in advance Ramesh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Replace function
Hi Here i have wddx_packet variable, it contains text file So my question is can i replace whole file by using following code. Becos when i use this code Getting this error:- An error occurred while evaluating the expression: EZB_PO_WDDX = Replace(#EZB_PO_WDDX#,"~","&","ALL") Error near line 310, column 11. Parameter 1 of function Replace must be a basic value, i.e., a string, number, logical, or date/time value i am here Thanx in advance Ramesh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Escaping quotes in Replace function for SQL Server 7
Escape single quotes to SQL with \' -Original Message- From: Dixon, Aidan [mailto:[EMAIL PROTECTED]] Sent: Monday, November 06, 2000 7:08 AM To: CF-Talk Subject: Escaping quotes in Replace function for SQL Server 7 We have a classified ads section on our intranet currently running on MS Access. I'm trying to upgrade it to use MS SQL Server 7. Testing threw up one problem. Data entry is via a standard HTML form, using a textbox for the body of the ad. Unfortunately, if anybody uses a double quote mark anywhere in the text, all text following and including the first double quote mark is truncated. The code works fine with Access--I can post the full code if need be, but there's nothing unexpected--so it seems to be a SQL Server problem. Now, if there's a setting in SQL Server I can change to fix this, I'd love to know. (Owing to Computer Services parsimony, I have no SQL Server documentation.) But this is a CF mailing list so I'm trying for a CF solution. I'd like to use the Replace function to replace any double quotes with single quotes (preferably two single quotes together, since SQL Server has no problem with single quotes), unfortunately I can't work out how to (or even if I can) escape the single quotes in the CF code. I've managed to replace double quotes with spaces, like so: Replace(FORM.Ad_Body,""""," ","ALL") but the result looks ugly. However, no amount of doubling single quotes in the above code will escape them successfully. Am I barking up the wrong tree here? TIA, Aidan. - Aidan Dixon Web Developer, Electronic Media Unit The Royal Veterinary College, Royal College St., London NW1 0TU. Tel: +44 (0)20 7468 5173 Fax: +44 (0)20 7383 0615 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Escaping quotes in Replace function for SQL Server 7
Not sure if this would work, but you could convert it to Chr(34).. -- Billy Cravens [EMAIL PROTECTED] "Dixon, Aidan" wrote: > > We have a classified ads section on our intranet currently running on MS > Access. I'm trying to upgrade it to use MS SQL Server 7. Testing threw up > one problem. Data entry is via a standard HTML form, using a textbox for > the body of the ad. Unfortunately, if anybody uses a double quote mark > anywhere in the text, all text following and including the first double > quote mark is truncated. The code works fine with Access--I can post the > full code if need be, but there's nothing unexpected--so it seems to be a > SQL Server problem. > > Now, if there's a setting in SQL Server I can change to fix this, I'd love > to know. (Owing to Computer Services parsimony, I have no SQL Server > documentation.) But this is a CF mailing list so I'm trying for a CF > solution. > > I'd like to use the Replace function to replace any double quotes with > single quotes (preferably two single quotes together, since SQL Server has > no problem with single quotes), unfortunately I can't work out how to (or > even if I can) escape the single quotes in the CF code. I've managed to > replace double quotes with spaces, like so: > > Replace(FORM.Ad_Body,""""," ","ALL") > > but the result looks ugly. However, no amount of doubling single quotes in > the above code will escape them successfully. Am I barking up the wrong > tree here? > > TIA, > > Aidan. > > - > Aidan Dixon > Web Developer, Electronic Media Unit > The Royal Veterinary College, > Royal College St., London NW1 0TU. > Tel: +44 (0)20 7468 5173 > Fax: +44 (0)20 7383 0615 > > > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ > Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message >with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Re: Escaping quotes in Replace function for SQL Server 7
I would replace the double quote with " Replace(FORM.Ad_Body,"""",""","ALL") It is better html anyway. Marc Stormes Relocate-US.com, LLC - Original Message - From: "Dixon, Aidan" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, November 06, 2000 10:07 AM Subject: Escaping quotes in Replace function for SQL Server 7 > We have a classified ads section on our intranet currently running on MS > Access. I'm trying to upgrade it to use MS SQL Server 7. Testing threw up > one problem. Data entry is via a standard HTML form, using a textbox for > the body of the ad. Unfortunately, if anybody uses a double quote mark > anywhere in the text, all text following and including the first double > quote mark is truncated. The code works fine with Access--I can post the > full code if need be, but there's nothing unexpected--so it seems to be a > SQL Server problem. > > Now, if there's a setting in SQL Server I can change to fix this, I'd love > to know. (Owing to Computer Services parsimony, I have no SQL Server > documentation.) But this is a CF mailing list so I'm trying for a CF > solution. > > I'd like to use the Replace function to replace any double quotes with > single quotes (preferably two single quotes together, since SQL Server has > no problem with single quotes), unfortunately I can't work out how to (or > even if I can) escape the single quotes in the CF code. I've managed to > replace double quotes with spaces, like so: > > Replace(FORM.Ad_Body,""""," ","ALL") > > but the result looks ugly. However, no amount of doubling single quotes in > the above code will escape them successfully. Am I barking up the wrong > tree here? > > TIA, > > Aidan. > > - > Aidan Dixon > Web Developer, Electronic Media Unit > The Royal Veterinary College, > Royal College St., London NW1 0TU. > Tel: +44 (0)20 7468 5173 > Fax: +44 (0)20 7383 0615 > -- -- > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ > Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Escaping quotes in Replace function for SQL Server 7
What about replace " with "? You can reverse the replacement if you need to output the ad in a form control, text file, report file, etc. -Original Message- From: Dixon, Aidan [mailto:[EMAIL PROTECTED]] Sent: Monday, November 06, 2000 9:08 AM To: CF-Talk Subject: Escaping quotes in Replace function for SQL Server 7 We have a classified ads section on our intranet currently running on MS Access. I'm trying to upgrade it to use MS SQL Server 7. Testing threw up one problem. Data entry is via a standard HTML form, using a textbox for the body of the ad. Unfortunately, if anybody uses a double quote mark anywhere in the text, all text following and including the first double quote mark is truncated. The code works fine with Access--I can post the full code if need be, but there's nothing unexpected--so it seems to be a SQL Server problem. Now, if there's a setting in SQL Server I can change to fix this, I'd love to know. (Owing to Computer Services parsimony, I have no SQL Server documentation.) But this is a CF mailing list so I'm trying for a CF solution. I'd like to use the Replace function to replace any double quotes with single quotes (preferably two single quotes together, since SQL Server has no problem with single quotes), unfortunately I can't work out how to (or even if I can) escape the single quotes in the CF code. I've managed to replace double quotes with spaces, like so: Replace(FORM.Ad_Body,""""," ","ALL") but the result looks ugly. However, no amount of doubling single quotes in the above code will escape them successfully. Am I barking up the wrong tree here? TIA, Aidan. - Aidan Dixon Web Developer, Electronic Media Unit The Royal Veterinary College, Royal College St., London NW1 0TU. Tel: +44 (0)20 7468 5173 Fax: +44 (0)20 7383 0615 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Escaping quotes in Replace function for SQL Server 7
Aiden You shouldn't have a problem if you are using SQL 7. I assume you are using a CFQUERY rather than a stored proc if you have migrated from Access. Lets say for example you want to insert a string containing your name in double quotes into a varchar field your SQL needs to be: INSERT INTO tablename(testfield) Values('Hello "Aiden"') this should work as long as the whole string is contained within single quotes. I'm guesing that at the mo you are putting double quotes around all of your strings rather than single qoutes. If you change it to single this will solve this problem although you will then have the problem that users will not be able to enter text containing a single quote!there is a way around this (I've done it before) but I can't remeber off the top of my head. I'll have a think and get back to you -- Andrew Ewings Project Manager Thoughtbubble Ltd http://www.thoughtbubble.net -- United Kingdom http://www.thoughtbubble.co.uk/ Tel: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Tel: +64 (0) 9 419 4235 -- The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s). Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0)207 387 8890. -Original Message- From: Dixon, Aidan [mailto:[EMAIL PROTECTED]] Sent: 06 November 2000 15:08 To: CF-Talk Subject: Escaping quotes in Replace function for SQL Server 7 We have a classified ads section on our intranet currently running on MS Access. I'm trying to upgrade it to use MS SQL Server 7. Testing threw up one problem. Data entry is via a standard HTML form, using a textbox for the body of the ad. Unfortunately, if anybody uses a double quote mark anywhere in the text, all text following and including the first double quote mark is truncated. The code works fine with Access--I can post the full code if need be, but there's nothing unexpected--so it seems to be a SQL Server problem. Now, if there's a setting in SQL Server I can change to fix this, I'd love to know. (Owing to Computer Services parsimony, I have no SQL Server documentation.) But this is a CF mailing list so I'm trying for a CF solution. I'd like to use the Replace function to replace any double quotes with single quotes (preferably two single quotes together, since SQL Server has no problem with single quotes), unfortunately I can't work out how to (or even if I can) escape the single quotes in the CF code. I've managed to replace double quotes with spaces, like so: Replace(FORM.Ad_Body,""""," ","ALL") but the result looks ugly. However, no amount of doubling single quotes in the above code will escape them successfully. Am I barking up the wrong tree here? TIA, Aidan. - Aidan Dixon Web Developer, Electronic Media Unit The Royal Veterinary College, Royal College St., London NW1 0TU. Tel: +44 (0)20 7468 5173 Fax: +44 (0)20 7383 0615 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Escaping quotes in Replace function for SQL Server 7
We have a classified ads section on our intranet currently running on MS Access. I'm trying to upgrade it to use MS SQL Server 7. Testing threw up one problem. Data entry is via a standard HTML form, using a textbox for the body of the ad. Unfortunately, if anybody uses a double quote mark anywhere in the text, all text following and including the first double quote mark is truncated. The code works fine with Access--I can post the full code if need be, but there's nothing unexpected--so it seems to be a SQL Server problem. Now, if there's a setting in SQL Server I can change to fix this, I'd love to know. (Owing to Computer Services parsimony, I have no SQL Server documentation.) But this is a CF mailing list so I'm trying for a CF solution. I'd like to use the Replace function to replace any double quotes with single quotes (preferably two single quotes together, since SQL Server has no problem with single quotes), unfortunately I can't work out how to (or even if I can) escape the single quotes in the CF code. I've managed to replace double quotes with spaces, like so: Replace(FORM.Ad_Body,""""," ","ALL") but the result looks ugly. However, no amount of doubling single quotes in the above code will escape them successfully. Am I barking up the wrong tree here? TIA, Aidan. - Aidan Dixon Web Developer, Electronic Media Unit The Royal Veterinary College, Royal College St., London NW1 0TU. Tel: +44 (0)20 7468 5173 Fax: +44 (0)20 7383 0615 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Re: replace function
Try this: \1", "ALL")> #TargetString# HTH Dick At 2:08 PM -0400 8/16/00, Eli Shechter wrote: >Hi > >i am using the replace function with a search interface, > >that when the results come out, if the search word is within the results, to >turn that word "red" > >However, >it replaces the word with a Red version of the search_word >#ReplaceNoCase(Description, Search_Word, theReplacedWord , 'ALL')# > >the problem with this is that it replaces the Case of the word with the case >of the Search_word, Meaning if i search "pens" it will replace a instance of >the word "Pens" (uppercase) with the search_word version. > >is there a way to search for the word and just replace the color without >replacing the word?? > >Thanx >-Eli- > -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.
RE: replace function
Alright, figure out the index of the search string in your larger string. Then.. Figure out the length of the search string. Now try something like this. ", Insert("", BigStr, Pos+(searchStrLen-1)), (Pos-1))> #BigStr# The complicated part is the insert. It basically says Insert a begin font tag into the follow string (which just happens to be another insert. the innser insert inserts a string which is a close BOLD and FONT tag at the END of your search word (given that you know the length and its beginning position). Jeremy Allen [EMAIL PROTECTED] [Insert cool title here] -Original Message- From: Chapman, Katrina [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 16, 2000 2:39 PM To: [EMAIL PROTECTED] Subject: RE: replace function Look at cf_highlight in the tag gallery. --K -Original Message- From: Eli Shechter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 16, 2000 11:08 AM To: [EMAIL PROTECTED] Subject: replace function Hi i am using the replace function with a search interface, that when the results come out, if the search word is within the results, to turn that word "red" However, it replaces the word with a Red version of the search_word #ReplaceNoCase(Description, Search_Word, theReplacedWord , 'ALL')# the problem with this is that it replaces the Case of the word with the case of the Search_word, Meaning if i search "pens" it will replace a instance of the word "Pens" (uppercase) with the search_word version. is there a way to search for the word and just replace the color without replacing the word?? Thanx -Eli- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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/cf-talk@houseoffusion.com/ 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/cf-talk@houseoffusion.com/ 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.
RE: replace function
Look at cf_highlight in the tag gallery. --K -Original Message- From: Eli Shechter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 16, 2000 11:08 AM To: [EMAIL PROTECTED] Subject: replace function Hi i am using the replace function with a search interface, that when the results come out, if the search word is within the results, to turn that word "red" However, it replaces the word with a Red version of the search_word #ReplaceNoCase(Description, Search_Word, theReplacedWord , 'ALL')# the problem with this is that it replaces the Case of the word with the case of the Search_word, Meaning if i search "pens" it will replace a instance of the word "Pens" (uppercase) with the search_word version. is there a way to search for the word and just replace the color without replacing the word?? Thanx -Eli- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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/cf-talk@houseoffusion.com/ 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.
replace function
Hi i am using the replace function with a search interface, that when the results come out, if the search word is within the results, to turn that word "red" However, it replaces the word with a Red version of the search_word #ReplaceNoCase(Description, Search_Word, theReplacedWord , 'ALL')# the problem with this is that it replaces the Case of the word with the case of the Search_word, Meaning if i search "pens" it will replace a instance of the word "Pens" (uppercase) with the search_word version. is there a way to search for the word and just replace the color without replacing the word?? Thanx -Eli- -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 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.