#1   Report Post  
Posted to microsoft.public.excel.programming
mk mk is offline
external usenet poster
 
Posts: 2
Default eof

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default eof

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 :

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"