Posted by Grant Foraker on January 14, 2010 at 12:20:15:
1st time I've needed to read a ListView sequentially.
Based on other programs and samples, I came up with ...
-----------------------------------------------------------------
cosCtlId = IDC.LISTVIEW.02
NextLineNo = 0
cosItemId = 0 ! Start with first item
Do
Gosub COS.ListView.GetItem
ListItem = cosItemID
!!!!! If (cosItemId EQ -1)
!!!!! If (NextLineNo EQ 0)
!!!!! LET MBMSG$ = "No Cleared Checks were selected for updating."
!!!!! MSGBOX(MBMSG$)
!!!!! ENDIF
!!!!! Break
!!!!! Endif
cosSubItem = 0 ! get check number
Gosub COS.ListView.GetItemText
If STRIP(cosCtlText$) EQ ''
If (NextLineNo EQ 0)
LET MBMSG$ = "No Cleared Checks were selected for updating."
MSGBOX(MBMSG$)
ENDIF
Break
Endif
NextLineNo = NextLineNo + 1
LET CHKNO$ = SUB(cosCtlText$,1,8)
LET CHKNO$ = PAD(CHKNO$)
LET N20KEY$ = TORG$ + TGLNO$ + CHKNO$
LET EXREC$ = N20KEY$
EXTRACT (N20,1420) KEY = N20KEY$
cosSubItem = 1 ! get cleared date
Gosub COS.ListView.GetItemText
LET CKCLRDT$ = SUB(cosCtlText$,1,10) ! SET CLEARED DATE
LET CKCLR$ = 'C' ! SET CLEARED FLAG
WRITE (N20,1420) KEY = N20KEY$
!-------------- DELETED FROM CLEARED LIST -----------------------------
cosCtlId = IDC.LISTVIEW.02
GOSUB COS.ListView.DeleteItem
Loop
-----------------------------------------------------
I thought that "(cosItemId EQ -1)" was the same as an E2 but apparently not. I determined, via Debugger, that "STRIP(cosCtlText$) EQ ''" was the way to stop the DO/LOOP.
Am I missing a better way to do this?
Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.