× 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.



Since you did not post the code for getToken, I can only guess.

The biggest problem I see in this code is the first paramter in the getToken
procedure. This paramter appears to be a pointer type and your code is
passing the address of a 1000-byte fix length variable to it. Since it is a
fix length and you are passing it as pointer, how can your getToken
procedure know that this is a fix length 1000-byte variable that your are
passing to him? Should you be passing the address of a String type variable
to the getToken, or may be you just need to change the prototype of the
getToken to indicate that the first paramter is a *string type?



"Kelly, John (Limerick)" <John.Kelly@xxxxxxxxxxx> wrote in message
news:mailman.9541.1266532679.2580.rpg400-l@xxxxxxxxxxxxxxx
I am new to the whole are of service programs/binding source members. My
company are in the process of moving from OS/400 V4R5 to V5R4 after
which we commence technical training. In the meantime I need help!

I am testing a utility to help us manage character string variables used
to store emails. We had some guidance in putting together a quick
service program to do this for us but have run into problems testing it.


To begin with the email information is stored in an alphanumeric field,
with a semi colon used a separator - e.g.
'joeblogs@xxxxxxxxx;john.doe@xxxxxxx;royrogers@xxxxxxxxxx'. The
following is an extract of the code used to extract each individual
email address (which is then returned to an RPG program to display the
information for maintenance) ...

0002.07 d delimiters s 2a inz('; ')
0002.08
0003.00 p get_eMail_Addresses...
0004.00 p B export
0004.01 d PI
0004.02 d forSplit 1000a const
0004.03 d numEmails 5i 0
0004.04 d emails 75a dim(13)
0004.05
0004.06 d pToken s *
0004.07 d split s like(forSplit)
0004.08 d emailIs s like(emails)
0004.09
0004.10 /free
0004.11 split = forSplit;
0004.12 pToken = getToken(%addr(split): %addr(delimiters));
0004.13 numEMails = 0;
0004.14 doW (pToken <> *null);
0004.15 emailIs = %str(pToken);
0004.16 if (emailIs <> *blanks);
0004.17 numEmails += 1;
0004.18 if (numEmails <= %elem(emails));
0004.19 emails(numEmails) = emailIs;
0004.20 endIf;
0004.21 endIf;
0004.22 pToken = getToken(*null: %addr(delimiters));
0004.23 endDo;
0004.24 return;
0004.25 /end-Free

If the that string
'joeblogs@xxxxxxxxx;john.doe@xxxxxxx;royrogers@xxxxxxxxxx' is read the
'doW' reads in each of the 3 emails correctly but the ends up doing an
extra 'loop' returning a fourth address into the 'emails' variable which
contains corrupt data.

Please perform a code review and see if you can find why it returns the
extra 'ambiguous' data.


Kind regards,
John.


John Kelly
IT Project Manager
Stryker Orthopaedics
Raheen Business Park
Limerick
Ireland
Phone: +353 (0)61 498326
Fax: +353 (0)61 229941
E-mail: john.kelly@xxxxxxxxxxx




This message (and any associated files) is intended only for the
use of the individual or entity to which it is addressed and may
contain information that is confidential. If you have received this
message in error, please notify us immediately by replying to the
message and then deleting it from your computer. Any views presented
are solely those of the author and do not necessarily represent
those of the company.

Howmedica International S. de R. L. Registered in Ireland,
Registered No. 901582.
Incorporated in Panama with Limited Liability.
Vat No. IE9/Z/33717B.
Registered Office Raheen Business Park, Limerick, Ireland.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.