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



Jamey,

In my experience, there are 2 reasons why something works in debug and
doesn't work otherwise:

1. Timing. Running a program in debug takes longer - mainly because you're
stopping it every so often to check field values. In programs that make use
of things like semaphores, mutexes, shared memory and where there are other
programs accessing the same data or sending receiving signals, data queue
entries etc from your program, this can change things drastically.

2. Memory initialization. When a program is loaded , it allocates whatever
memory it needs from the OS to do its thing. If you run it in debug, the
memory may be allocated differently than when not in debug. I think the
debugger may pre-initialize the memory heap in some way, but I'm not sure.

You're almost certainly a victim of #2. Check your numeric variables,
specifically those that are subfields in a data-structure? Do you
explicitly initialize them? If not, then in debug, the memory over which
they are overlaid may be set to hex zeroes anyway, so they implicitly
initialize to 0, but when not in debug, it may be some other value.

Do you check/set QUSEC prior to calling QMHSNDPM? If so, do you check it
afterwards?

If necessary, add a DUMP statement to your program (and or multiple
DSPLY's) - I'm assuming this is RPG - although that may cause a different
memory layout anyway.

HTH,

Rory

On Mon, Feb 6, 2012 at 11:46 AM, Jamey Saunders <
jsaund@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi Everyone,

Here's something that has had me stumped for two days. I have a display
file with a message subfile. I am sending the messages using QMHSNDPM
wrapped in a service program. I have a block of code that does some
sanity checks on the subfile control data and sends messages to the
program queue for display as appropriate. I am also clearing the
message queue whenever the subfile is acted on and control is returned
to the program (i.e.: someone does something and presses Enter).

My issue is this: Some of my messages display properly. Some of my
messages do not display at all. It is always the same messages that
display, and always the same messages that do not. Here's the kicker,
though: If I put my program into debug, and step past the call to the
ShowMsg procedure in my service program, then hit F12, every single
message displays properly.

None of my colleagues can figure this one out, though one of them says
that he's seen this happen before where something worked in debug that
didn't work otherwise, and he thinks it was subfile-related. He doesn't
remember what the fix was, though.

Anybody ever run into something like this? I'll post any code that
anyone deems relevant, even though the messaging is working properly
some of the time.

Best Regards,
Jamey Saunders
--
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.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.