× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am using the prototypes posted by Scott a couple of years ago in REGEX_H.
I have pasted in the prototype below:

D regexec PR 10I 0 extproc('regexec')
D preg like(regex_t) const
D string * value options(*string)
D nmatch 10U 0 value
D pmatch like(regmatch_t) dim(100)
D options(*varsize)
D eflags 10I 0 value

I am still getting an indication that a match was found but the pmatch
array is still empty. What am I doing wrong? Knowing there is a match isn't
enough, I need to actually be able to loop through the matched words and
act on them.

Thanks,
Robert Newton
EDPS
Electronic Data Processing Services
System Owner
804-353-1900 x2256
rnewton@xxxxxxxxxxxx


|------------>
| From: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|Tom Liotta <qsrvbas@xxxxxxxxxxxx> |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|rpg400-l@xxxxxxxxxxxx |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|06/12/2009 02:58 PM |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|Re: Processing the Regexec() Matches Array |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Sent by: |
|------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|rpg400-l-bounces@xxxxxxxxxxxx |
>--------------------------------------------------------------------------------------------------------------------------------------------------|





RNewton@xxxxxxxxxxxx wrote:

I'm having trouble getting Regexec() to compile in my program. I'm using
the example regex_h that Scott put out a couple years ago.
<snip>
The compiler error...

*RNF7542 30 001060 Parameter 4 is not valid as a parameter passed
by
reference.

*RNF7542 30 1 Parameter cannot be passed by reference when it can be
changed during the call.

Here is what I have...

d buffer s 1000a inz
d pattern s 512a
inz('(?:\s+)(?:#)\s{0,5}([0-9a-z]+)')
d reg ds likeds(regex_t)
d numMatches s 10u 0 inz(100)
d matches ds likeds(regmatch_t) dim(100)
d rc s 10i 0
d len s 5u 0 inz
d foundWord s 100a inz
<snip>
//Execute the regular expression to find pattern matches
rc = regexec(reg :%trim(buffer) :numMatches :matches :0);

Robert:

You described a little of what you're doing, showed the error
messages, provided the variable definitions and showed the function
as used in your program.

The biggest thing missing is the prototype itself, which is perhaps
the only part of the program we need to see.

Can you post the prototype, please?

Tom Liotta

--
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone 253-872-7788 x313
253-479-1416
Fax 253-872-7904
http://www.powertech.com
--
This is the RPG programming on the IBM i / System i (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 communication and any transmitted documents are intended to be confidential. If there is a problem with this transmission, please contact the sender. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.