× 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've made the changes mentioned by Scott, Bob, Gary, Buck,
and others.

It is finally working!!!

When I run the procedure through the debugger I find that
the last value of the field passed to the procedure when
returned has a hex value contained in the last position of
the field.  The character looks like a little arrow
pointing down and to the left, I assume it's some hex
value.  Is this any reason for concern?

Thanks to everyone for all their time and effort!!!

John



On Mon, 25 Nov 2002 16:46:00 -0600 (CST)
 Scott Klement <klemscot@klements.com> wrote:

This line is wrong:
    F1 = %replace('':F1:%scan(C1:F1):1);

It is setting all 32766 characters of F1.   This is a
problem because F1
may not be that long, and therefore, it will be
overwriting memory that
it should not be.

Also, the RETURN statement:

     Return F1;

This is copying 32766 bytes from the start of F1 to make
a return value.
That's not good because you're reading from memory past
the end of the F1
parameter if it's not the full size.

Not only that, but since F1 is passed by reference, it
really doesn't
make much sense to use it as a return value.   You've
already got the
result in the calling procedure... returning it makes
another copy of
it as well.   If you are assigning that return value back
to the same
variable, you'll cause some nasty problems.

So, here's what I'd do:

    1) Change the F1 = %replace() line to be
%subst(F1:1:InLen) =
               %replace(etc).
    2) Remove the RETURN statement.
    3) Remove the return value from your Prototype (PR)
statement
    4) Remove the return value from your Procedure
Interface (PI)
               statement

See if that works...






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.