FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour check columns array - Resolved -
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
check columns array - Resolved -
Posted: Tue May 24, 2022 08: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







Code (fw): Select all Collapse
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 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