× 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 experiencing a weird error when debugging a subprocedure. The program
runs through properly then after it hits the return statement, it runs
again, and again, and again. I have not manually run it until it "pukes" but
when it finally returns data back to my calling app, I get bad data.

Calling statement:
tempChar = ParseEmailAddresses(cEmail); //receiver field defined
as 100A dim(327)


Called subprocedure which takes a semicolon delimited string of email
addresses and breaks them into an array.
P ParseEmailAddresses...
P B EXPORT
D ParseEmailAddresses...
D PI 32700A
D toParse 32767A CONST

D* Local fields
D x S 5P 0 Inz(1)
D b S 5P 0 Inz(0)
D e S 5P 0 Inz(0)
D dim S 3P 0 Inz(0)
D retField DS
D email 100A DIM(327)

/free

b = x;

dow x < %len(toParse);

if %subst(toParse:x) = ' ';
leave;
endif;

if %subst(toParse:x:1) = ';';
dim += 1;
email(dim) = %trim(%subst(toParse:b:(x - b)));
b = x + 1;
endif;

x += 1;

enddo;

dim += 1;
email(dim) = %trim(%subst(toParse:b:(x - b)));

return retField;

/end-free
P ParseEmailAddresses...
P E

At the point of when I hit "return retField," I have the data I expect in
there. When I hit F6 in the debugger in WDSc to "go to the next line," it
lands on the P-Spec, I hit F6 again and I go to the first line of code, "b =
x". I have deleted all affected objects and recompiled everything a couple
times. I have signed off and on in WDSc and the green-screen to make sure
there are no old object/caching errors. I wanted this as a generic
subprocedure so I can use it in many places.

Any thoughts? I can't figure this one out.


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.