Code: Select all
;test
Dim ar$(10)
Dim fieldnm$(20)
Read.s tbl$ ; tablename
Read atfields ; nr of fields
For i=1 To atfields
Read.s fieldnm$(i) ; name of fields
Next
ar$(1)="A\Fido\\Orcheta\s\644160698\fido.es@seznam.cz\bouw\\"
ar$(2)="A\Pedro - water\\Finestrat\s\\\water\65 Euro / camion\"
ar$(3)="D\Parking Ascars\\Alicante\s\965685200 / 616040832\parkingascars@msn.com\parking\contr 781\"
ar$(5)="A\Hilde Buyse\AV. Mediteraneo 58, Coblanca 6\Benidorm\s\966813300\\dokter - Achter apoteek\ma-vr 9-10 / 15-18\"
ar$(4)="A\Alex cars\Calle Lepante\Benidorm\s\965863111\\autohuur\\"
ar$(6)="<eof>"
arptr=6
;------------------------
If OpenWindow(2, 384, 288, 640, 480, "Contactenlijst", #PB_Window_SystemMenu|#PB_Window_Maximize |#PB_Window_SizeGadget)
LVWidth = WindowWidth(2)
LVCWidth = Int(LVWidth/(atfields+1)) ; aantal col
ListIconGadget = ListIconGadget(0, 0, 0, LVWidth, WindowHeight(2), "recnr", LVCWidth, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect)
For i=1 To atfields
AddGadgetColumn(0, i, fieldnm$(i), LVCWidth)
Next
For j= 1 To arptr-1
;If Left(ar$(j),1) <> "D"
R$=""
dsd$=RSet(Str(j), 5, "0")
R$=R$ + dsd$ + Chr(10)
For i=2 To atfields+1
R$ =R$ + StringField(ar$(j), i, "\") + Chr(10)
Next
Debug R$
AddGadgetItem(0, j-1, R$, 0)
; EndIf
Next
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
End
;----------------------------------------------
DataSection
Data.s "persbes.tbl"
Data.i 8
Data.s "Naam:","Adres:","Plaats:","Land:","Telefoon:","Email:","Kategorie:","Divers:"
EndDataSection
Above code is displaying 5 records in a listicongadget.
The first letter of each record is A or D.
when in the lines: ; If Left(ar$(j),1) <> "D" and ;endif the ; is removed , only lines 1,2 and 4 and 5 should be displayed.
Lines 1 and 2 are, but from the lines AFTER the line starting with a D (line 3) , only the first column is displayed.
In the debug window the complete lines are OK.
Why?
Richard