Prikazi cijelu temu 18.03.2011 22:09
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Lokacija:Tuzla


Predmet:Re: Ideje i rjesenja iz teme fiskalizacija
Evo sad probaj.
PreuzmiIzvorni kôd (Visual Basic):
  1. Function ProvjeraP(BrojRac As String) As String
  2. Dim temp As String
  3. Dim ImeF(1 To 2) As String
  4. Dim ImeR(1 To 2) As String
  5. Dim fs, R, F
  6. Dim Brojac As Integer
  7. Dim i As Integer
  8. Dim Putanja_Filea As String
  9.    
  10. ImeR(1) = "RCP_" & BrojRac & ".XML"  ' Broj rac iz polja me.Me.BROIZD + RCP_ tekst
  11. ImeR(2) = "CMD_" & BrojRac & ".ERR"
  12. Provjera1:
  13. Set fs = Application.FileSearch
  14. With fs
  15.     .LookIn = PutTO
  16.     .FileType = 1
  17.     If .Execute > 0 Then
  18.         For i = 1 To .foundfiles.Count
  19.          F = Right(.foundfiles(i), 3)
  20.           If F = "XML" Then
  21.           ImeF(1) = .foundfiles(i)
  22.           ImeF(1) = ImeFajla(ImeF(1))
  23.             If ImeF(1) = ImeR(1) Then
  24.             DoEvents
  25.             Brojac = Brojac + 1
  26.                If Brojac > 3 Then GoTo Izlaz
  27.                Zaustavi (Brojac)
  28.                GoTo Provjera1
  29.             End If
  30.           End If
  31.         Next i
  32.     End If
  33.  
  34. End With
  35.  
  36. Provjera2:
  37. Set fs = Application.FileSearch
  38. With fs
  39.     .LookIn = PutFrom
  40.     .FileType = 1
  41.     If .Execute > 0 Then
  42.         For i = 1 To .foundfiles.Count
  43.         F = Right(.foundfiles(i), 3)
  44.             If F = "ERR" Then
  45.             ImeF(2) = ImeFajla(.foundfiles(i))
  46.                 If ImeF(2) = ImeR(2) Then
  47.                 Putanja_Filea = .foundfiles(i)
  48.                 Close #1
  49.                 Open Putanja_Filea For Input As 1
  50.                 Input #1, temp
  51.                 Close #1
  52.                 MsgBox temp
  53.                 GoTo Kraj
  54.                 End If
  55.             End If
  56.         Next i
  57.     End If
  58. End With
  59.  
  60. Kraj:
  61. Exit Function
  62. Izlaz:
  63. MsgBox " Ra
  64. un nije oštampan"
  65. GoTo Provjera2
  66. GoTo Kraj
  67. End Function

Podrška samo putem foruma, jer samo tako i ostali imaju koristi od toga.