this code are slow reading 8940 lines of text to ListIcon.
made some mistake to be so slow???
here is text file: http://www.mediafire.com/?tdpzkb2bvhulwpr
anyone can text this.
thanks...
Code: Select all
Procedure OpenPlayerLista(*retinort)
Pattern$ = "playerlist.txt (*.txt)|playerlist.txt"
Pattern = 0
FileR$ = OpenFileRequester("Please choose the playerlist...", "", Pattern$, Pattern)
If OpenFile(6, FileR$)
If ReadFile(6, FileR$) ; if the file could be read, we continue...
ClearGadgetItems(#ListIcon_41)
StatusBarText(#StatusBar_wndMain, 1, "Loading Playerlist wait...", #PB_StatusBar_Center)
DisableMenuItem(#Menu_wndMain, #Menu_wndMain_OpenPlayerlist, 1)
IDN = 0
length = Lof(6)
While Eof(6) = 0
IDN = IDN + 1
Texto$ = Trim(ReadString(6))
NomesID$ = Trim(StringField(Texto$, 1, ":"))
NsID$ = Trim(StringField(Texto$, 2, ":"))
StatusBarProgress(#StatusBar_wndMain, 2, Loc(6) , #PB_StatusBar_Raised, 0,length)
AddGadgetItem(#ListIcon_41, -1, Str(IDN)+Chr(10)+NomesID$+Chr(10)+NsID$)
Wend
CloseFile(6)
DisableMenuItem(#Menu_wndMain, #Menu_wndMain_OpenPlayerlist, 0)
StatusBarText(#StatusBar_wndMain, 2, "PlayerList Load Successfully", #PB_StatusBar_Center)
StatusBarText(#StatusBar_wndMain, 1, "PlayerList Loaded", #PB_StatusBar_Center)
EndIf
EndIf
EndProcedure