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



I am using the QXXPTOI API to convert a packed number in a character field to an integer. I have it defined as:

D PackedToInt     pr            10i 0 extproc('QXXPTOI')
D   PTR                           *   value options(*string)
D   Digits                      10i 0 value
D   Fraction                    10i 0 value

This procedure works correctly for all my packed fields except one.

The field is defined in the file as 13P 0. The hex value for the field in error is:

0435065
209140F

The returned value is -123063971 when it should be 240,395,104,605.

The RPG code being executed is:

NumberFld = PackedToInt(DataPtr+FldOffset:FldLen:0);

FldOffset=363 which is the place in the data record and
FldLen = 7

I'm assuming that since the number is so large I should be using the QXXPTOD API. If so, does anyone have a prototype definition for that API. I can't seem to get it setup correctly.

Thanks,


Rich Dotson RT3 Consulting Services, Inc. P.O. Box 126 Lorain, OH 44052-0126

eMail: Rich_Dotson@xxxxxxxxxxx

_________________________________________________________________
Overwhelmed by debt? Find out how to ?Dig Yourself Out of Debt? from MSN Money. http://special.msn.com/money/0407debt.armx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.