|
> -----Original Message----- > From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On > Behalf Of Buck Calabro > Sent: 1. august 2001 15:32 > 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? > One easy way is to define one or more message description with substitution variables (&1 &2 etc) and use a RTVMSGD command (or the corresponding API) with MSGDTA specified to retrieve the resulting string. This will work like an Edit Word for string variables. +--- | 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.