cFilt := "(AG->AGDATUM = US->UPRDATV" + IF(US->UVERTODO,")"," .OR. (AG->AGDATUM < US->UPRDATT .AND. !AG->AGAFGESL .AND. AG->AGAGRAP))")
IF UPPER(ALLTRIM(UsTab[LEN(UsTab)])) <> "ALLE GEBRUIKERS"
cFilt += " .AND. ("
FOR i=1 TO LEN(UsTab)
cFilt += ("VAL(AG->AGUSER) = " + ALLTRIM(RIGHT(UsTab[i],7)))
IF i <> LEN(UsTab) ; cFilt += " .OR. " ; ENDIF
NEXT
cFilt += ")"
ENDIF
//Order key = "AGUSERNS+AGUSER+LEFT(AGBTIJD,2)+RIGHT(AGBTIJD,2)+LEFT(AGETIJD,2)+RIGHT(AGETIJD,2)+DTOS(AGDATUM)"
SELECT AG
SET ORDER TO 21
SET FILTER TO &cFilt
//Create Scope
MsgMeter( { | oMeter, oText, oDlg, lEnd | BSeekIndex( oMeter, oText, oDlg, @lEnd ) } )
STATIC FUNCTION BSeekIndex( oMeter, oText, oDlg, lEnd )
Local TmpIndx := ""
Private IndxCount := 0
oMeter:nTotal := BROKERED->(CmxKeyCount())
CursorWait()
TmpIndx := TempPath()+"BRKSEEK.CDX"
IF FILE(TmpIndx)
FERASE(TmpIndx)
ENDIF
TmpIndx := TempPath()+"BRKSEEK"
SELECT BROKERED
INDEX ON STR(SITE_ID,2,0)+ORDER_NO+STR(LINE_NO,4) TO &TmpIndx. FOR !DELETED() .AND. BrokSeekVal() USECURRENT EVAL ( IndxCount++, oMeter:Set( IndxCount ), SysRefresh(), ! lEnd )
SET INDEX TO &TmpIndx.
CursorArrow()
RETURN NIL
FUNCTION BrokSeekVal
LOCAL RetVal := .T.
IF !Empty(mCustFrom) .OR. !Empty(mCustTo)
RetVal := LEFT(BROKERED->ACNT_NBR,LEN(ALLTRIM(mCustFrom))) >= Alltrim(mCustFrom) .AND. ;
LEFT(BROKERED->ACNT_NBR,LEN(ALLTRIM(mCustTo))) <= Alltrim(mCustTo)
ENDIF
IF RetVal .AND. ;
(!Empty(mGradeFrom) .OR. !Empty(mGradeTo))
RetVal := LEFT(BROKERED->GRADE,LEN(ALLTRIM(mGradeFrom))) >= Alltrim(mGradeFrom) .AND. ;
LEFT(BROKERED->GRADE,LEN(ALLTRIM(mGradeTo))) <= Alltrim(mGradeTo)
ENDIF
IF RetVal .AND. ;
(!Empty(mOrdFrom) .OR. !Empty(mOrdTo))
RetVal := LOWER(LEFT(BROKERED->CUST_ORDER,LEN(ALLTRIM(mOrdFrom)))) >= Lower(Alltrim(mOrdFrom)) .AND. ;
LOWER(LEFT(BROKERED->CUST_ORDER,LEN(ALLTRIM(mOrdTo)))) <= Lower(Alltrim(mOrdTo))
ENDIF
IF RetVal .AND. ;
(!Empty(mPurchFrom) .OR. !Empty(mPurchTo))
RetVal := LEFT(BROKERED->PURCH_CUST,LEN(ALLTRIM(mPurchFrom))) >= Alltrim(mPurchFrom) .AND. ;
LEFT(BROKERED->PURCH_CUST,LEN(ALLTRIM(mPurchTo))) <= Alltrim(mPurchTo)
ENDIF
IF RetVal .AND. ;
(!Empty(mTranspFrom) .OR. !Empty(mTranspTo))
RetVal := LEFT(BROKERED->HAULIER,LEN(ALLTRIM(mTranspFrom))) >= Alltrim(mTranspFrom) .AND. ;
LEFT(BROKERED->HAULIER,LEN(ALLTRIM(mTranspTo))) <= Alltrim(mTranspTo)
ENDIF
RETURN RetVal
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 70 guests