|
On 2014-10-15 11:09, Gary Thompson wrote:
Birgitta, I guess the conversion to 'packed' happens during the API call (the
compile listing shows B(4,0) )
The binary field wouldn't be converted to packed for the API call. The
address of the binary field would be passed to the API which would then
look at the storage of the binary field followed by the next 2 bytes of
storage. If the binary field had the value 4096 (x'1000') and the
following 2 bytes were x'0000', the API would see the 4-byte binary
value x'10000000' which is decimal 268435456.
Binary fields are only converted to/from packed when they are used in
calculations. For example, if you have a 4B0 field NUM, and code
NUM = NUM + 1
the compiler defines a 4P0 temporary, call it temp4p.
temp4p = NUM
add 1 to temp4p
NUM = temp4p
If NUM was a 5I, the compiler would just add 1 to NUM directly.
--
Barbara
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.