|
On 27/06/2006, at 11:04 PM, Turnidge, Dave wrote:
I have changed the "PI" PrcCmd to include the second parameter, AND have changed the ERRC0100 data structure to have all fields. That is, insteadof just having BytPro, I have BytPro, BytAvl, MsgId and MsgDta. Now when I debug my program, the %Error IF statement shows no error, however ERRC0100 does show that there was an error, and MsgId contains the message ID that I am looking for. So, why does the CallP(e) not trigger the %Error any more? And second, and probably more important, what is the "correct" way to accomplish what I am trying to do?
Given that you haven't supplied any of the code showing how this used to be handled and how you now handle it, my GUESS is that Carsten's code set BytPro to zero thus informing the API that it should send exceptions which would cause %ERROR to be turned on. Your code PROBABLY sets BytPro to the length of ERRC0100 thus instructing the API to no longer send exceptions but to populate the error code structure instead.
You'll need to check BytAvl > 0 to determine is an error occurred and process accordingly. %ERROR will never be set unless the API crashes.
You'll also need to determine the number of parameters received (%PARMS) and only populate the MsgIdRtn field if the number of parameters is 2 or more.
As for whether you are "on the right track". This is one possible approach that many would find acceptable.
Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
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.