At 12:38 AM +0100 6-01-00, Alan Walendowski wrote:
>I'm a PalmOS newbie, so I may be doing something wrong, but I
>just noticed that this code:
>
>  AppNetRefnum = -1;
>  error = SysLibFind("Net.Lib", &AppNetRefnum);
>
>does not return an error (ie. it returns 0), and it does not
>set AppNetRefnum (it remains -1 after the call).  If I change
>the call to use the correct name of Net.lib like so:
>
>  error = SysLibFind("Net.lib", &AppNetRefnum);
>
>then it sets AppNetRefnum appropriately.


Looking at the sources, what you report appears to be impossible.  What OS
version did you detect this on?

The code is written such that the routine can't exit with a result of 0
without first setting the return paramater to a positive value.  Also, the
test for name matching is not case sensitive, so both of the above calls
should return the same result.

That is, on OS 3.5 (and possibly earlier, I didn't check) the return code
looks like this:

                // See if it matches
                if (!StrCompare(nameP, libNameP)) {
                        *refNumP = refNum;
                        return 0;
                }

At this point, refNum will always be 0 or greater.

                                --Bob


Reply via email to