len an array

len an array

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: len an array

Postby nageswaragunupudi » Mon May 06, 2024 11:26 am

give me 1 instead of zero

Because that is the correct answer.

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: len an array

Postby karinha » Mon May 06, 2024 11:41 am

Code: Select all  Expand view

   ? LEN( cString )
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7824
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: len an array

Postby Silvio.Falconi » Mon May 06, 2024 11:41 am

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: len an array

Postby nageswaragunupudi » Mon May 06, 2024 1:27 pm

Code: Select all  Expand view
aLines := hb_ATokens( cString,"|" )
if empty(aLines[1] )
alines:= {}
 

This doesn't help either.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: len an array

Postby Silvio.Falconi » Wed May 08, 2024 7:31 am

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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7061
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 62 guests