How about:
UInt16 volts;
SysBatteryKind kind;
char KindStr[20];
volts=SysBatteryInfoV20 (false,NULL,NULL,NULL,&kind,false);
StrIToA (KindStr, kind);
// The KindStr will contain an number from 0..5
Also, you should probably be using SysBatteryInfo()
<[EMAIL PROTECTED]> wrote in message news:64068@palm-dev-forum...
>
> Hey! I am having a little trouble with
> getting what kind of battery the user has.
>
> This is my code.
>
> UInt8 *percentP;
> SysBatteryKind *kindP;
> char *PercentStr;
> char *Percents;
> UInt16 Kind;
> Kind=SysBatteryInfoV20
(false,NULL,NULL,NULL,kindP,false);
> PercentStr=StrIToA (Percents, Kind->kindP);
> fld=(FieldPtr) GetObjectPtr(MainOutputField);
> FldSetTextPtr(fld,Kind.kindP);
>
> FldDrawField(fld);
>
>
>
> My error is here though
> PercentStr=StrIToA (Percents, Kind->kindP);
>
> It says Kind isn't an array.
>
> How do I access kindP and display it as a character string? Thanks!
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/