Yep.

Given
   destStr[8] = "";
   txtStr [] = "012345678901234567890";

   StrNCat (destStr, txtStr, min (StrLen (txtStr), 8));
You get
   destStr = "01234567"

Given
   destStr[8] = "";
   txtStr [] = "012345678901234567890";

   StrNCat (destStr, txtStr, 8);
You get
   destStr = "01234567"

Given
   destStr[8] = "";
   txtStr [] = "01234";

   StrNCat (destStr, txtStr, min (StrLen (txtStr), 8));
You get
   destStr = "01234"

Given
   destStr[8] = "";
   txtStr [] = "01234";

   StrNCat (destStr, txtStr, 8);
You get
   destStr = "01234"

The reason is because the 'N' in this function is the maximum number of bytes
in the destination string, and not the number of character concatenated as in
the ANSI standard version (Why? It would be nice to know.). The total moved is
the minimum of either StrLen(source) or 'N' - StrLen(dest) - 1 (for that EOS
character, minimum of 0). So specifying the same min(...) function as the 'N'
parameter is redundant.

--
The Snake Pit - Development
Curtis Clauson    [EMAIL PROTECTED]
Proprietor

"Paul Nevai" <[EMAIL PROTECTED]> wrote in message
news:13652@palm-dev-forum...
>
> I just want to make sure that if we have
>
> destStr[8] = "";
> txtStr [] = "012345678901234567890";
>
> or
>
> txtStr [] = "01234";
>
> i.e., no matter how long txtStr is,
>
> then
>
> StrNCat (destStr, txtStr, min (StrLen (txtStr), 8));
>
> and
>
> StrNCat (destStr, txtStr, 8);
>
> are the same, aren't they? Thanks! Best regards, Paul
>
>
>



-- 
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