|
If you really, really, want an all RPGIV solution -- here is a snippet from a Procedure I use, based on code by Bob Fike... *===================================================================== * .IsLike: Scan text looking for LIKE pattern * If pattern matches, returns *ON * If pattern does not match, returns *OFF *===================================================================== * Based on code originally appearing in Midrange Computing by BFike *===================================================================== P IsLike B EXPORT D IsLike PI 1N * public parms D iaText 32767A VARYING CONST D iaPattern 32767A VARYING CONST D oiBegTxtMPos 10I 0 OPTIONS(*NOPASS) D oiEndTxtMPos 10I 0 OPTIONS(*NOPASS) D oiBegPatMPos 10I 0 OPTIONS(*NOPASS) D oiEndPatMPos 10I 0 OPTIONS(*NOPASS) D iaEscape 1A OPTIONS(*NOPASS) CONST * private parms (intended for use by recursive calls by this *SRVPGM) D iiTextLen 10I 0 OPTIONS(*NOPASS) CONST D iiPatLen 10I 0 OPTIONS(*NOPASS) CONST D iiTxtIndx 10I 0 OPTIONS(*NOPASS) CONST D iiPatIndx 10I 0 OPTIONS(*NOPASS) CONST I believe all the RPGIV code is here... http://www.mcpressonline.com/mc?50@45.RZuLa1jhXD0.3@.214a3133 NOTE: I tweaked it a little and fixed a couple of bugs. They are logged below... *Modifications: * When Who and What * -------- ------------------------------------------- * 03/05/01 Jewel - Rewrote downloaded Like procedure: * o renamed Like to IsLike and changed * variable naming convention * o fixed Escape parm (checks NOTSPECIFIED) * o fixed length of private parms: 4P -> 10I * o changed to return boolean value * o added opt parms to return beg/end text * position and beg/end pattern position Regards, Jerry Jewel Better living through fine code and hot coffee! -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup "Free price comparison tool gives you the best prices and cash back!" http://www.bestbuyfinder.com/download.htm
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.