Predmet:DoEvents naredba
   
imam 2 pitanja:
1. da li DoEvents naredba zamjenjuje Timer, tj zaustavlja proces i omogucuje druge naredbe?
2. da li sam dobro stavio Tab-ove u ovoj funkciji, koristio sam notepad++ sa sintaksom VB?
PreuzmiIzvorni kôd (Visual Basic):- Public Sub DownloadFile(strURL As String, strDestination As String)  'As Boolean 
-     Const CHUNK_SIZE As Long = 1024 
-     Dim intFile As Integer 
-     Dim lngBytesReceived As Long 
-     Dim lngFileLength As Long 
-     Dim strHeader As String 
-     Dim b() As Byte 
-     Dim i As Integer 
-     Dim ip As String 
-     Dim ipurl As String 
-      
-     ipurl = "http://www.icentar.ba/ip.php" 
-     ip = Inet1.OpenURL(ipurl, icString) 
-     MsgBox ip 
-      
-         DoEvents 
-                 With Inet1 
-                         .url = strURL 
-                         .Execute , "GET", , "Range: bytes=" & CStr(lngBytesReceived) & "-" & vbCrLf 
-                         While .StillExecuting 
-         DoEvents 
-                         Wend 
-                                 strHeader = .GetHeader 
-                 End With 
-                 strHeader = Inet1.GetHeader("Content-Length") 
-                 lngFileLength = Val(strHeader) 
-     DoEvents 
-      
-         lngBytesReceived = 0 
-         intFile = FreeFile() 
-         Open strDestination For Binary Access Write As #intFile 
-                 Do 
-                         b = Inet1.GetChunk(CHUNK_SIZE, icByteArray) 
-                         Put #intFile, , b 
-                         lngBytesReceived = lngBytesReceived + UBound(b, 1) + 1 
-                         DownloadProgress (Round((lngBytesReceived / lngFileLength) * 100)) 
-         DoEvents 
-                 Loop While UBound(b, 1) > 0 
-         Close #intFile 
- End Sub 
 
vazno je napomenuti da funkcija koja se nalazi u modulu radi i nema error, a poziva se sa 
downloadFile url,"fileName.txt". Skinuta je sa interneta. 
Znači, samo objaÅ¡njenje DoEvents i ispravni Tab-ovi.
Hvala   
     zivot je moja domovina.