[DONE] Adding items from a file to a ListIconGadget,
Posted: Sat Apr 03, 2010 5:47 pm
Hello,
I am trying to populate a listicongadget from a file.
This is the code i am using:
The procedure works, but it loops endlessly, instead of stopping at the end of the file, showing the same line over and over again. Why is it doing this?
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