|
That was the problem! Thanks everyone. I was going by previous posts here that said to use cvtch to convert FROM hex and cvthc to convert TO hex, but that is apparently backwards. Anyway, swapping them did the trick. It's also important to note (thanks to an old note from Barbara) that the length always refers to the longer side (the alpha characters). > -----Original Message----- > From: Bob Cozzi [SMTP:cozzi@rpgiv.com] > Sent: Thursday, January 30, 2003 7:55 PM > To: 'RPG programming on the AS400 / iSeries' > Subject: RE: Convert hex to char (cvtch) > > That is probably his problem, Scott. Conceptually to me, CVTCH means > convert > Hex to Character, and CVTHC means convert Character to Hex. > In an RPG programmers mind (i.e., mine) the term Character means it is in > a > single character form and will be converted into two hex characters. > However, the IBM interpretation is the exact opposite. That's what I get > for being left-handed. <g> > > > -----Original Message----- > From: rpg400-l-bounces@midrange.com [mailto:rpg400-l-bounces@midrange.com] > On Behalf Of Scott Klement > Sent: Thursday, January 30, 2003 6:09 PM > To: RPG programming on the AS400 / iSeries > Subject: Re: Convert hex to char (cvtch) > > > > I think you wanted to use cvthc, rather than cvtch > . > I posted samples of calling these functions here: > http://archive.midrange.com/rpg400-l/200205/msg00309.html > > The problem, I believe is that it's trying to read 8 bytes starting > at the beginning of your 'alp4HexBytes' variable. Since that extends > 4 bytes past the end of the parameter, it gives you the error that you > can't > access the memory at that offset. > > > On Thu, 30 Jan 2003, Smith, Nelson wrote: > > > I'm trying to use cvtch to convert hex data to character, and I'm > > getting a space offset error. Does anyone know what causes this > > error? The error does not occur until the CALLP to cvtch. > > > > Space offset X'07FFEFF0' or teraspace offset X'0000000000000000' is > > outside current limit for object QPADEV001WDBANS 751610. > > The call to cvtch ended in error (C G D F). > > > > My prototype looks like this: > > > > D cvtch PR EXTPROC('cvtch') > > D ptrCharReturn * VALUE > > D ptrHexSource * VALUE > > D intCharLength 10I 0 VALUE > > > > The field definitions look like this: > > > > D ds_ZDAQ0200 DS BASED(ptrZDAQ0200) > > D alpUser 10A > > D alpServer 10A > > D alpFormat 8A > > D hexFunctCode 4B 0 > > D alp4HexBytes 4A OVERLAY(ds_ZDAQ0200:29) > > > > D alp8CharBytes S 8A INZ > > > > the pointer is initialized to the address of the incoming parm and all > > the subfields of the data structure look fine, > > > > and my call looks like this: > > > > C CALLP cvtch(%ADDR(alp8CharBytes) > > C :%ADDR(alp4HexBytes) > > C :%Len(alp8CharBytes) ) > > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, > or > change list options, > visit: http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l > or email: RPG400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > > > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo.cgi/rpg400-l > or email: RPG400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. ************************************************************************************************************************************************************************************************************ This message originates from Lincare Holdings Inc. It contains information which may be confidential or privileged and is intended only for the individual or entity named above. It is prohibited for anyone else to disclose, copy, distribute or use the contents of this message. All personal messages express views solely of the sender, which are not to be attributed to Lincare Holdings Inc., and may not be copied or distributed without this disclaimer. If you received this message in error, please notify us immediately at MailAdmin@lincare.com or (800) 284-2006. ************************************************************************************************************************************************************************************************************
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.