On Wed, 18 May 2011, Luis Krause Mantilla wrote:

Hi Ron and Luis,

> I confirm this fixes the problem.
> Thanks!
> > 2011-03-13 19:01 UTC-0430 Ron Pinkas<ron.pinkas/at/xharbour.com>
> >    * source/rtl/hbtoken.c
> >     ! Fixed hb_tokenCount() to return 0 when processed string is 0 length

The original behavior was intentional and fully consistence.
I can understand that you enabled above exception for situations when no 
delimiter
is passed and the default space stripping mode is enabled. But when user enables
his own delimiter then for me it's odd that in current xHarbour code it's 
hardcoded
that empty token is ignored when only one token exists.

   ? len( hb_aTokens( ""    , "|" ) )
   ? len( hb_aTokens( "|"   , "|" ) )
   ? len( hb_aTokens( "||"  , "|" ) )

do you find above results natural?

Please note that now it's not possible to serialize (convert to text) such array
   { "" }
so later it can be restored from string by hb_aTokens() function.

best regards,
Przemek

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to