On 27 Sie, 13:30, Daniel Garcia-Gil <
danielgarcia...@gmail.com> wrote:
Hi,
> the function hb_tokenCount return incorrect value
> local ctext := "A;B;C:D;E;F"
> ? hb_tokenCount( cText, ":" ) // -> return 2 should be 1
> ? hb_tokenCount( ctext, ";" ) // -> return 5 should be 4
> or is right this behavior
It's expected behavior. The second parameter in hb_tokenCount()
function is token delimiter not token itself.
This code should help you understand what hb_token*()
functions do:
proc main()
local ctext := "A;B;C:D;E;F"
? hb_tokenCount( cText, ":" ), len( hb_aTokens( cText, ":" ) )
? hb_tokenCount( ctext, ";" ), len( hb_aTokens( cText, ";" ) )
? hb_valToExp( hb_aTokens( cText, ":" ) )
? hb_valToExp( hb_aTokens( cText, ";" ) )
return
best regards,
Przemek