Problem with FW_ArrayAsList - Resolved -

Problem with FW_ArrayAsList - Resolved -

Postby Silvio.Falconi » Sat Nov 02, 2024 5:52 pm

Image

Happen I have -CA-FI-----RM---NZ

I explain you

I have a array where I save if is true or false

Code: Select all  Expand view  RUN

ba:=IIF(oBrw:aArrayData[ 1 ][1]=.t.,"S","N")
                ca:=IIF(oBrw:aArrayData[ 2 ][1]=.t.,"S","N")
                fi:=IIF(oBrw:aArrayData[ 3 ][1]=.t.,"S","N")
                ge:=IIF(oBrw:aArrayData[ 4 ][1]=.t.,"S","N")
                mi:=IIF(oBrw:aArrayData[ 5 ][1]=.t.,"S","N")
                na:=IIF(oBrw:aArrayData[ 6 ][1]=.t.,"S","N")
                pa:=IIF(oBrw:aArrayData[ 7 ][1]=.t.,"S","N")
                rm:=IIF(oBrw:aArrayData[ 8 ][1]=.t.,"S","N")
                to:=IIF(oBrw:aArrayData[ 9 ][1]=.t.,"S","N")
                ve:=IIF(oBrw:aArrayData[ 10 ][1]=.t.,"S","N")
                nz:=IIF(oBrw:aArrayData[ 11 ][1]=.t.,"S","N")

aReturn:= {ba,ca,fi,ge,mi,na,pa,rm,to,ve,nz}

 


on my func I must make a string with the name of wheel selected

Code: Select all  Expand view  RUN
Function InsertString(aLista)
      local ba,ca,fi,ge,mi,na,pa,rm,to,ve,nz
      local aNew:={}
      local  cstring

      ba:=IIF(aLista[1]="S","BA","")
      ca:=IIF(aLista[2]="S","CA","")
      fi:=IIF(aLista[3]="S","FI","")
      ge:=IIF(aLista[4]="S","GE","")
      mi:=IIF(aLista[5]="S","MI","")
      na:=IIF(aLista[6]="S","NA","")
      pa:=IIF(aLista[7]="S","PA","")
      rm:=IIF(aLista[8]="S","RM","")
      to:=IIF(aLista[9]="S","TO","")
      ve:=IIF(aLista[10]="S","VE","")
      nz:=IIF(aLista[11]="S","NZ","")
      aNew:= {ba,ca,fi,ge,mi,na,pa,rm,to,ve,nz}
      cstring := FW_ArrayAsList( aNew, "-" )
    return cstring


if I use cstring := FW_ArrayAsList( aNew, "-" ) how do I remove the "-" when I don't have the wheel selected?
Last edited by Silvio.Falconi on Sun Nov 03, 2024 5:02 pm, edited 1 time in total.
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: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with FW_ArrayAsList

Postby nageswaragunupudi » Sat Nov 02, 2024 8:27 pm

Code: Select all  Expand view  RUN
cNew := CharRem( "-", cString )


also

Code: Select all  Expand view  RUN
cStr := FW_ArrayAsList( aList, "" )
Regards

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

Re: Problem with FW_ArrayAsList

Postby Silvio.Falconi » Sun Nov 03, 2024 11:14 am

nageswaragunupudi wrote:
Code: Select all  Expand view  RUN
cNew := CharRem( "-", cString )


also

Code: Select all  Expand view  RUN
cStr := FW_ArrayAsList( aList, "" )



If I made cstring := FW_ArrayAsList( aNew, "" ) I have CAFIRMNZ

I wish the same "-" but only the record true

on original I have oBrw:aArrayData where I use chackbox

Image

then I create the array {ba,ca,fi,ge,mi,na,pa,rm,to,ve,nz}
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: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with FW_ArrayAsList

Postby Silvio.Falconi » Sun Nov 03, 2024 4:48 pm

nageswaragunupudi wrote:
Code: Select all  Expand view  RUN
cNew := CharRem( "-", cString )


also

Code: Select all  Expand view  RUN
cStr := FW_ArrayAsList( aList, "" )


can I make a condition sample alist[n]=="S" ?
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: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with FW_ArrayAsList

Postby Silvio.Falconi » Sun Nov 03, 2024 5:01 pm

Now I corrected with

Code: Select all  Expand view  RUN

 aNew:= {ba,ca,fi,ge,mi,na,pa,rm,to,ve,nz}
cstring:=""
      for n= 1 to len(aNew)
         IF  empty(aNew[n])
            else
               cstring+= aNew[n]
               cstring+="-"
          endif
       next
      cString := RemRight( cString, "-" )


Image
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: 7070
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 45 guests