On Fri, 27 Jul 2001, Paul Nevai wrote:
> Dear Palm:
> 
> I noticed that some functions such as "Err DmOpenDatabaseInfo (...);" always
> return the same value no matter what. E.g., DmOpenDatabaseInfo () always
> returns errNone. Why not "void" then? Am I missing something? Do you want to
> keep your future options open? Thanks!

  well, maybe in *future* versions of the os, they may include a check
  and have an error code for such a function (even if it is not there 
  now) - for example, in 5.0, they may protect some databases so you
  cannot use the DmOpenDatabaseInfo call, and maybe return an error
  code like errDmAccessDenied

  making it return void would now allow this "expandability" :(

> Example. Is it still prudent to use
> 
> if (DmOpenDatabaseInfo (...) == errNone)
>  ...
> 
> ???

  well, errNone is 0 - so, you can probably just do this:

    if (DmOpenDatabaseInfo(...))
      ... // failed
    else
      ... // worked :)
  
  but, thats bad coding style :) == errNone is definately better. 

// az
[EMAIL PROTECTED]
http://www.ardiri.com/


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

Reply via email to