Richard,

That was my question. I wasn't sure what to use. 'a' is presently an UInt,
although when I read it through StrPrintF and then through a UpdateField
function it counts from 0 to 127 and then goes from -127 back up to 0. How
can this be when I have specified a Uint variable, and I'm making sure the
char coming in is in (UInt) form?

Here's the actual code:

tele_input.battery_charge=(65536*(Int)packet[1])+(256*(Int)packet[2])+(Int)p
acket[3];

where 'tele_input.battery_charge' is defined as a UInt, and it running
through a '%d' in a StrPrintF to convert it back to characters for the
display. 'packet' is a character string.

What do you make of it?

Stuart Norton

-----Original Message-----
From: Richard Hartman [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 19, 1999 6:02 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Data Formats


The types for "a" and "b" would help.  Better yet,
post a code fragment or two with structures, variable
declarations & the lines of code you're having
problems with.

--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi./sec ... not just a good idea, it's the LAW!


> -----Original Message-----
> From: Stuart Norton [mailto:[EMAIL PROTECTED]]
>
> I'm trying read data stored as 'chars' into a structure with suitable
> numeric formats. Firstly, how come when I assigned the data
> using a= (UInt)
> b; (for example) it comes up with some negative values on
> doing a StrPrintF
> for the data (using %d)? Am I missing something obvious?
>
> Thanks
>
> Stuart Norton
>
>


Reply via email to