I am trying to populate a listicongadget from a file.
This is the code i am using:
Code: Select all
Procedure populate_list()
If ReadFile(0, "Landers.dat") ; if the file could be read, we continue...
While Eof(0) = 0 ; loop as long the 'end of file' isn't reached
landers$ = ReadString(0)
; explode the string
AddGadgetItem(#ListIcon_1,-1,landers$)
Wend
CloseFile(0) ; close the previously opened file
Else
MessageRequester("Information","Couldn't open the file!")
EndIf
EndProcedure