|
Buck, This might be stupid answer but, if your delimiter is ~, can't you use STRTOK function to parse the string specifying ~ as the delimter? -----Original Message----- From: Buck Calabro [mailto:Buck.Calabro@commsoft.net] Sent: Wednesday, August 01, 2001 9:32 AM To: RPG400-L@midrange.com Subject: Ideas for parameters that are lists? [PROC] Hi! I have a string parsing problem that I'd like to apply some intelligence against. Input is a single string and output is a list of keywords. This is similar to extracting a list of words from a sentence, except that not all the words are "interesting". Further, I am going to perform substitutions on the resulting list, replacing the original keyword with a variable-length value. An example: GET 1234567890 (~PHONE_NPA~) ~PHONE_EXCH~-~PHONE_NUMB~$DONE$ will become GET 1234567890 (518) 555-1212$DONE$ I'm leaning toward three procedures in a loop like this: dow rc=FOUND eval rc=findKwd(inpString: outPosition: outKwd) eval rc2=substValue(inpKwd: outValue) eval rc2=replKwdWithValue(inpValue: inpPosition: updString) enddo Opinions? Buck Calabro Commsoft; Albany, NY Visit the Midrange archives and FAQ at http://www.midrange.com "The foolish and the dead alone never change their opinions" -- James Russell Lowell +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.