|
Rick, On other packed fields this works correctly. What is the largest packed field of the others? You pass a 7 byte field to return into a 4 byte integer. methinks, you pass a higher value than a 4 byte integer (10i 0) can handle. And the API bombs without returning a value at all. Regards, Carel Teijgeler. *********** BEGIN FORWARDED MESSAGE *********** On 23-7-04 at 18:13 Rich Dotson <rich_dotson@xxxxxxxxxxx> wrote: >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.
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.