Predmet:Re: Ideje i rjesenja iz teme fiskalizacija
   
Ovaj code prilagođavam sebi i radi međutim u 17 liniji ( If .Execute > 0 Then) stane, ustvari traje oko 30 sekundi isto se deÅ¡ava i na 41 liniji koda, a to je predugo.
Pitanje je zašto?
PreuzmiIzvorni kôd (Visual Basic):- Function ProvjeraP(BrojRac As String) As String 
- Dim temp As String 
- Dim ImeF(1 To 2) As String 
- Dim ImeR(1 To 2) As String 
- Dim fs, R, F 
- Dim Brojac As Integer 
- Dim i As Integer 
- Dim Putanja_Filea As String 
-      
- ImeR(1) = "RCP_" & BrojRac & ".XML"  ' Broj rac iz polja me.Me.BROIZD + RCP_ tekst 
- ImeR(2) = "CMD_" & BrojRac & ".ERR" 
- Provjera1: 
- Set fs = Application.FileSearch 
- With fs 
-     .LookIn = PutTO 
-     .FileType = 1 
-     If .Execute > 0 Then 
-         For i = 1 To .foundfiles.Count 
-          F = Right(.foundfiles(i), 3) 
-           If F = "XML" Then 
-           ImeF(1) = .foundfiles(i) 
-           ImeF(1) = ImeFajla(ImeF(1)) 
-             If ImeF(1) = ImeR(1) Then 
-             DoEvents 
-             Brojac = Brojac + 1 
-                If Brojac > 3 Then GoTo Izlaz 
-                Zaustavi (Brojac) 
-                GoTo Provjera1 
-             End If 
-           End If 
-         Next i 
-     End If 
-   
- End With 
-   
- Provjera2: 
- Set fs = Application.FileSearch 
- With fs 
-     .LookIn = PutFrom 
-     .FileType = 1 
-     If .Execute > 0 Then 
-         For i = 1 To .foundfiles.Count 
-         F = Right(.foundfiles(i), 3) 
-             If F = "ERR" Then 
-             ImeF(2) = ImeFajla(.foundfiles(i)) 
-                 If ImeF(2) = ImeR(2) Then 
-                 Putanja_Filea = .foundfiles(i) 
-                 Close #1 
-                 Open Putanja_Filea For Input As 1 
-                 Input #1, temp 
-                 Close #1 
-                 MsgBox temp 
-                 GoTo Kraj 
-                 End If 
-             End If 
-         Next i 
-     End If 
- End With 
-   
- Kraj: 
- Exit Function 
- Izlaz: 
- MsgBox " Ra 
- un nije oštampan" 
- If ImeF(1) <> "" Then 
- GoTo Provjera2 
- End If 
- GoTo Kraj 
- End Function