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



Hi Wim,

The reason you're having problems is the following line of code in your
program:

>             P#QIFRVal = %str(W#QIFRVal: P#QIFRValLen);

If you change it to look like this, the problem will go away:

   %subst(P#QIFRVal: 1: P#QIFRValLen) = %str(W#QIFRVal: P#QIFRValLen);

The problem with your original code is that it overwrites 2048 bytes of
memory, no matter what the value of P#QIFRValLen is.

If the value of P#QIFRValLen is 14, as in your example code, then the
first 14 bytes of P#QIFRVal are being set to whatever data is returned
from the GetQFKeyVal procedure.   The remaining 2034 bytes are being set
to blanks!

Like I said in a previous post in this thread -- whenever you work with
fields that can vary in size, you MUST BE VERY CAREFUL not to overwrite
anything beyond the space that's been given to you.

In the example above, 2034 blanks are being written to memory that you do
not own.  It's clobbering other data, possibly important data, and causing
you to get that MCH5003 error.   It's actually quite lucky that you got an
error instead of simply damaging something that's important without any
notification.


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.