FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour len an array
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
len an array
Posted: Mon May 06, 2024 10:43 AM

local cString:=""

aLines := hb_ATokens( cString,"|" )

?len(aLines)

give me 1 instead of zero

why ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: len an array
Posted: Mon May 06, 2024 11:26 AM
give me 1 instead of zero
Because that is the correct answer.
Code (fw): Select all Collapse
aLines  := HB_ATokens( "one", "|" )
? aLines // -> { "one" }
Regards



G. N. Rao.

Hyderabad, India
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: len an array
Posted: Mon May 06, 2024 11:41 AM
Code (fw): Select all Collapse
   ? LEN( cString )
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: len an array
Posted: Mon May 06, 2024 11:41 AM
nageswaragunupudi wrote:
give me 1 instead of zero
Because that is the correct answer.
Code (fw): Select all Collapse
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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: len an array
Posted: Mon May 06, 2024 01:27 PM
Code (fw): Select all Collapse
aLines := hb_ATokens( cString,"|" )
if empty(aLines[1] )
alines:= {}
This doesn't help either.
Regards



G. N. Rao.

Hyderabad, India
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: len an array
Posted: Wed May 08, 2024 07:31 AM
nageswaragunupudi wrote:
Code (fw): Select all Collapse
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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion