Page 1 of 1

len an array

PostPosted: Mon May 06, 2024 10:43 am
by Silvio.Falconi
local cString:=""
aLines := hb_ATokens( cString,"|" )

?len(aLines)


give me 1 instead of zero

why ?

Re: len an array

PostPosted: Mon May 06, 2024 11:26 am
by nageswaragunupudi
give me 1 instead of zero

Because that is the correct answer.

Code: Select all  Expand view
aLines  := HB_ATokens( "one", "|" )
? aLines // -> { "one" }

Re: len an array

PostPosted: Mon May 06, 2024 11:41 am
by karinha
Code: Select all  Expand view

   ? LEN( cString )
 


Regards, saludos.

Re: len an array

PostPosted: Mon May 06, 2024 11:41 am
by Silvio.Falconi
nageswaragunupudi wrote:
give me 1 instead of zero

Because that is the correct answer.

Code: Select all  Expand view
aLines  := HB_ATokens( "one", "|" )
? aLines // -> { "one" }


I not Know how I Have on String
now I made

aLines := hb_ATokens( cString,"|" )
if empty(aLines[1] )
alines:= {}
Endif

Re: len an array

PostPosted: Mon May 06, 2024 1:27 pm
by nageswaragunupudi
Code: Select all  Expand view
aLines := hb_ATokens( cString,"|" )
if empty(aLines[1] )
alines:= {}
 

This doesn't help either.

Re: len an array

PostPosted: Wed May 08, 2024 7:31 am
by Silvio.Falconi
nageswaragunupudi wrote:
Code: Select all  Expand view
aLines := hb_ATokens( cString,"|" )
if empty(aLines[1] )
alines:= {}
 

This doesn't help either.


ok and if the cString is empty ( i not Know what is on Cstring, so it can be also empty) How set alines ?
because then I must set another two array from alines

oImage:=array(len(aLines)+1)
aImages:=array(len(aLines)+1)

how I can resolve ?