FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with FW_ArrayAsList - Resolved -
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Problem with FW_ArrayAsList - Resolved -
Posted: Sat Nov 02, 2024 05:52 PM


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

I explain you

I have a array where I save if is true or false
Code (fw): Select all Collapse
 
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 (fw): Select all Collapse
 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?
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: Problem with FW_ArrayAsList
Posted: Sat Nov 02, 2024 08:27 PM
Code (fw): Select all Collapse
cNew := CharRem( "-", cString )
also
Code (fw): Select all Collapse
cStr := FW_ArrayAsList( aList, "" )
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with FW_ArrayAsList
Posted: Sun Nov 03, 2024 11:14 AM
nageswaragunupudi wrote:
Code (fw): Select all Collapse
cNew := CharRem( "-", cString )
also
Code (fw): Select all Collapse
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



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 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: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with FW_ArrayAsList
Posted: Sun Nov 03, 2024 04:48 PM
nageswaragunupudi wrote:
Code (fw): Select all Collapse
cNew := CharRem( "-", cString )
also
Code (fw): Select all Collapse
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 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: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with FW_ArrayAsList
Posted: Sun Nov 03, 2024 05:01 PM
Now I corrected with
Code (fw): Select all Collapse
 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, "-" )
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