Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Verifica se o arquivo está no diretorio saida
  2.    Cont_i = 0
  3.     Do
  4.     Cont_i = Cont_i + 1
  5.     Verifica = Dir("C:\ACBrMonitorPLUS\Arquivos\SAIDA\Terminal2-Venda-resp.ini")
  6. '    If Cont_i = 10 Then
  7. '        Exit Sub
  8. '    End If
  9.    Loop Until Verifica <> ""
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. 'Abre o arquivo
  17.    Open Saida_ini_Str & "\" & "Terminal2-Venda-resp.ini" For Input As #1
  18.         Arquivo_Texto = Input(LOF(1), #1)
  19.     Close #1
  20.     'Remove texto OK: do arquivo ini
  21.    Arquivo_Texto = Replace(Arquivo_Texto, "OK: ", "")
  22.     sText = Arquivo_Texto
  23.         lPos1 = InStr(1, sText, "|")
  24.         i = 0
  25.         Do While lPos1 > 0 And lPos1 < 120
  26.         lPos2 = InStr(lPos1 + 1, sText, "|")
  27.         If lPos2 > 0 Then
  28.           sSubString = Mid$(sText, lPos1 + 1, lPos2 - lPos1 - 1)
  29.           Debug.Print sSubString
  30.           If i = 1 Then
  31.             txtFields(4).Text = sSubString
  32.             End If
  33.         Else
  34.           Exit Do
  35.         End If
  36.         lPos1 = InStr(lPos2 + 1, sText, "|")
  37.         i = i + 1
  38.         Loop
  39.     DoEvents
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement