Hi, I have an old TP binary record, that consist of integer, real and byte data types. After reading the byte variable from the record I get wrong numbers. Does anyone know if there's any difference between the byte type in GPC and TP? Thanx
On Mon, Dec 12, 2005 at 12:53:09PM +0100, xstang@post.cz wrote:
Hi, I have an old TP binary record, that consist of integer, real and byte data types. After reading the byte variable from the record I get wrong numbers. Does anyone know if there's any difference between the byte type in GPC and TP? Thanx
The type behaves the same way, but in GPC it takes as much space as an integer for efficiency reasons. Define the record as "packed" to get binary compatibility (assuming that different sizes of integer and real types have been already taken care of). You may use "SizeOf" to check that the layout is correct.
Emil Jerabek
On 12 Dec 2005 at 12:53, xstang@post.cz wrote:
Hi, I have an old TP binary record, that consist of integer, real and byte data types. After reading the byte variable from the record I get wrong numbers. Does anyone know if there's any difference between the byte type in GPC and TP? Thanx
There is no difference between a byte in GPC and TP (or any other language, AFAICS).
Like I said, the problem is likely with regard to the Real (and integer, if you don't declare it as a 16-bit type for GPC).
Perhaps a sample of your code would help shed more light on this?
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Web: http://www.greatchief.plus.com/