listview sequential read


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

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?



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]