|
In RPG IV you can use the EnQuote() procedure from RPG xTools (www.rpgxtools.com) which was built just for that purpose (doubling up quotes in AS/400 strings) or if you don't have xTools you can use the FindReplace() procedure that I published a year or two ago. The URL for the source code is: http://www.rpgiv.com/newsletter/index.html The FindReplace utility was published in December 2002. To use it: Eval myString = FindReplace('''':'''''':myString) -Bob Cozzi -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPower@xxxxxxxxxx Sent: Thursday, June 10, 2004 12:15 PM To: RPG programming on the AS400 / iSeries Subject: Re: Scan And Replace Not really writing I guess. More like, correcting someone else's stuff. I wanted to do all what you said, but we can't change the model...... sigh. Ron Power Programmer Information Services City Of St. John's, NL P.O. Box 908 St. John's, NL A1C 5M2 Tel: 709-576-8132 Email: rpower@xxxxxxxxxx Website: http://www.stjohns.ca/ ___________________________________________________________________________ Success is going from failure to failure without a loss of enthusiasm. - Sir Winston Churchill Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 06/10/2004 02:40 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject Re: Scan And Replace Hi Ron, > Just had a program of mine blow up when the user keyed a subject line for > an email message and used the " ' " in the field. So when the CL program > built the string for the submit job, the dang " ' " (single quote) caused > the string to be built incorrectly. For now I have the user keying two > single quotes to indicate one quote. Whaahuh? Why are you submitting a job with a string like this? Obviously if you do that, you're going to have to be VERY VERY VERY careful about the user's input. Not just quotes, but all sorts of things could cause problems. Why not use something like a file, user space, data queue, data area... anything... to pass this data. Or write the program so that it doesn't need to submit a job? > If this were an RPGLE program I'd use Scan and Replace to make each > single quote two single quotes. Looking for a more permanent solution > that I could code so that I could replace the single quotes with dual > single quotes. Does anyone have any ideas? What language is it written in? This is the RPG mailing list. If you're question is "how do I scan for and replace a character in language XXXX" then you should be asking it on the mailing list for language XXXX. Language Mailing List ------------ ----------------------- RPG RPG400-L CL MIDRANGE-L C C400-L COBOL COBOL400-L Java JAVA400-L MI MI400 Perl PERL400 The following web page lists all of Midrange.com's mailing lists, and you can click the appropriate mailing list name to sign up for it: http://www.midrange.com/lists.htm -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. This OutBound email has been scanned for Viruses -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.