Steve,

You are abusing pointers.  Your code should read

 void foo()
 {
     // Verify field attributes
     FieldAttrType fldAttr;
     FldGetAttributes(fldP, &fldAttr);

-E

> -----Original Message-----
> From: Steve K [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 13, 2003 7:25 PM
> To: Palm Developer Forum
> Subject: Re: Palm Emulator
> 
> 
> In that case, I'm curious what is wrong with this code that 
> runs fine on the palm handheld but is rejected by the 
> emulator with the following error on line marked with *:
> 
> Project (1.0) called SysFatalAlert with the message: 
> "Field.c, Line: 7221, NULL parameter".
> 
> Is there something wrong with setting fldAttr to NULL before 
> calling FldGetAttributes?
> 
> void foo()
> {
>     // Verify field attributes
>     FieldAttrType* fldAttr = NULL;
>     FldGetAttributes(fldP, fldAttr);
> 
> *   if(fldAttr->numeric && (strP[0] < '0' || strP[0] > '9')) {
>         // Field is set to numeric only and strP is not a 
> numeric value
>         // Alert with error beep
>         SndPlaySystemSound (sndError);
>         return false;
>     }
> }
> 
> tia,
> 
> Steve
> 
> "Dave Carrigan" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> On Wed, Aug 13, 2003 at 04:45:28PM -0700, Steve K wrote:
>
> > Why is it that some things run on the palm just fine, however, cause
errors
> > on the Palm emulator?  Is the emulator more strict on what you can 
> > and cannot do?
>
> Yes, for good reason. The emulator is designed to catch a lot of bugs 
> in your code that may not cause problems the device you happen to have

> right now, but might cause problems on other devices or other versions

> of PalmOS. A well-written app will not trigger any errors from the 
> emulator.
>
> --
> Dave Carrigan
> Seattle, WA, USA
> [EMAIL PROTECTED] | http://www.rudedog.org/ | ICQ:161669680
> UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQ
> UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++L
>
> Dave is currently listening to Crosby, Stills, Nash & Young - 
> Shadowland
(American Dream)
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to