+ Reply to Thread
Results 1 to 2 of 2

eof

  1. #1
    mk
    Guest

    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. #2
    keepITcool
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1