|
Hi Jeff - >> DCL &RTVM0100 *CHAR 128 >> DCL &WARNLEN *DEC (3 0) >> DCL &WARNMSG *CHAR 80 >> >> CHGVAR &RTVM0100 ' ' >> CALL QMHRTVM (&RTVM0100 X'00000080' 'RTVM0100' 'EOP1004' + >> 'NVDISCMSG *LIBL ' '' X'00000000' + >> '*NO' '*NO' X'00000000') >> CHGVAR &WARNLEN %BIN(&RTVM0100 9 4) >> IF (&WARNLEN *GT 80) CHGVAR &WARNLEN 80 >> CHGVAR &WARNMSG %SST(&RTVM0100 25 &WARNLEN) > >Ahhh, but you're hardcoding that the message text begins in >position 25. I'm trying to do it via strictly the information >returned from the API call. I'm trying to be just like Brad. <g> Ahhh, but in format RTVM0100, the message DOES always start in position 25! (Believe me, I know all about offsets in API output, and I use the offsets when applicable.) You obviously are using RTVM0200 or RTVM0300. Remember that the offsets in the API documentation are zero-based, but if you are using substringing or something like that in RPG, it is one-based situation. If I were using RTVM0200 in RPG IV and was substringing out the message text, I would have a 10u0 field described over positions 29-32. I would add would 53 to that value to get the start of the message text. I would have a 10u0 field described over positions 37-40 which would be the length of the message that was actually returned in the data structure. OTOH, if I were using a pointer, I would set the pointer to %ADDR(data structure) plus the value from 29-32 plus 52. Notice that in the one case I would use 53 and in the other case I would use 52. Ken Southern Wine and Spirits of Nevada, Inc. Opinions expressed are my own and do not necessarily represent the views of my employer or anyone in their right mind.
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.