eof

  • Thread starter Thread starter mk
  • Start date Start date
M

mk

Hi
I'm opening txt file where I have information abaut products
Already I have:

Private Sub PLServer1_DataArrived(ByVal id As Long, ByVal frameid As
Integer)
Dim retval As Boolean
Dim odczyt, odczyt2, odczyt3, odczyt4, odczyt5, odczyt6, odczyt7, kod As
String
code = PLServer1.GetData(id, 46)
Open "c:\test.txt" For Input As #1
pozycja:
Input #1, odczyt, odczyt2, odczyt3, odczyt4, odczyt5, odczyt6, odczyt7, kod
If EOF(1) = True Then
GoTo niema
ElseIf kod <> code Then
GoTo pozycja
Else
Label1.Caption = odczyt
Label2.Caption = odczyt2
Label3.Caption = kod
Close
retval = PLServer1.Text(id, 40, odczyt2)
retval = PLServer1.Send(id, -1)
End If
niema:
retval = PLServer1.Text(id, 1, "ERROR")
End Sub

___________________
"code" is barcode value from hand terminal, "kod" is barcode field from
txt file
"retval" is sending information to terminal (In thise case value field
"odczyt2" from txt file)

Every thing is ok when "code" value exist in txt file, but I want to
sent to terminal information "ERROR" if "code" value not exist in txt
file (like in "niema:"). How I can do it?
thanks for any help.
mk
 
normally:

Open strFile For Input As #1
While Not EOF(1)
Input #1, myVar
Wend
'or
Do While Not EOF(1)
Input #1, myVar
Loop

Close


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


mk wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top