dbEval()
Posted: Sat Mar 17, 2018 3:26 pm
I try to convert this loop to dbeval() but certain records are omitted in the dbeval() routine below.
Static Function _GetBatchTotals()
Local aBT[0], cJVN
Select("MyTable")
Do While !Eof()
cJVN := MyTable->JVN
aBT := {0,0}
Do While cJVN == MyTable->JVN
aBT[1] += Mytable->dr
aBT[2] += Mytable->cr
DBSkip()
Enddo
Enddo
Return(aBT)
Static Function _GetBatchTotals()
Local aBT[0], cJVN
Select("MyTable")
DbEval({|| cJVN := MyTable->JVN, aBT := {0,0}, DC_Dowhile({|| cJVN == MyTable->JVN}, {||aBT[1] += Mytable->dr, aBT[2] += Mytable->cr, dbSkip() })})
Return aBt
Static Function _GetBatchTotals()
Local aBT[0], cJVN
Select("MyTable")
Do While !Eof()
cJVN := MyTable->JVN
aBT := {0,0}
Do While cJVN == MyTable->JVN
aBT[1] += Mytable->dr
aBT[2] += Mytable->cr
DBSkip()
Enddo
Enddo
Return(aBT)
Static Function _GetBatchTotals()
Local aBT[0], cJVN
Select("MyTable")
DbEval({|| cJVN := MyTable->JVN, aBT := {0,0}, DC_Dowhile({|| cJVN == MyTable->JVN}, {||aBT[1] += Mytable->dr, aBT[2] += Mytable->cr, dbSkip() })})
Return aBt