check columns array - Resolved -

check columns array - Resolved -

Postby Silvio.Falconi » Tue May 24, 2022 8:48 am

I must check if there are all numbers from 1 to 90 on each column

and I made this function but it not run ok


Image




Code: Select all  Expand view


FOR n= 2 TO 56
          lCompleto:=Controllo_90(aTab,n)
       next

       If lCompleto

....

endif
oDbf:skip(-1)

enddo

Function Controllo_90(aTab,nCol)
    local conta
    local aCount:={}

    LOCAL nRows := len( aTab )
    LOCAL nR, nC,k
    local num
    local lreturn


        //  save on array the numbers 90
              conta:= 1
              do while (conta <= 90)
                aadd(aCount, {conta,.f.} )
                conta:= conta + 1
              enddo

       for nR := 1 to nRows
             for nC := nCol to nCol
                  num:= aTab[nR, nC]
                    For k:=1 to len(aCount)
                         If aCount[k][1] = num
                            aCount[k][2] :=.t.
                         Endif
                      next
                next
             next

         nConta:=0
         For j:=1 to len(aCount)
                   If aCount[j][2]
                     nConta:=nConta+1
                  Endif
             next

             If nConta=90
                lreturn := .t.
                else
                lreturn := .f.
             Endif

         return  lreturn


 
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: 6897
Joined: Thu Oct 18, 2012 7:17 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 31 guests