Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Module process is inconsistent and not repeatable

Discussion in 'Information Technology' started by pete2586, Jul 28, 2006.

  1. pete2586

    pete2586
    Expand Collapse
    Guest

    I have a module for extracting data from text files, part of which is shown
    below along with a small sample from one of the text files. It works fine
    some of the time but frequently it does not correctly extract the information
    (X, Y, Z, Size values) from the line starting "X *" while the similar code
    for the rest of the data always seems to work. It is not a problem with the
    text files as I have checked that the formatting is the same in all of them.
    What kind of problems could be causing this?

    Thank you

    ------------------------------------------------------------------------------------------------
    Module extract:

    Do While Not EOF(1)
    Line Input #1, CurrLnTxt
    If CurrLnTxt Like "OFFSET" Or CurrLnTxt Like "RADIUS" Or CurrLnTxt Like
    "CORRECT" Or CurrLnTxt Like "CYCLE" Or _
    CurrLnTxt Like "TIME" Or CurrLnTxt Like "MAIN" Or CurrLnTxt Like
    "*LIFE EXPIRED" Then GoTo loop_next
    If CurrLnTxt Like "M-*" Then
    rcs1.AddNew
    rcs1!Machine = rcs0!Machine
    rcs1!FilePath = rcs0!file_name
    rcs1(1) = Left(CurrLnTxt, 13)
    rcs1.Update
    GoTo loop_next
    End If
    If CurrLnTxt Like " PART*" Then
    rcs1.MoveLast
    rcs1.Edit
    rcs1(2) = (Right(Left(CurrLnTxt, 25), 4))
    Dotpos = InStr(1, CurrLnTxt, ".")
    Hr = Mid(CurrLnTxt, Dotpos - 2, 2)
    Min = Mid(CurrLnTxt, Dotpos + 1, 2)
    d = Right(Left(CurrLnTxt, 34), 2)
    mth = Right(Left(CurrLnTxt, 38), 2)
    yr = Right(Left(CurrLnTxt, 44), 4)
    datev = d & "/" & mth & "/" & yr 'Date literal
    datecheck = IsDate(datev)
    If datecheck = False Then GoTo Date_error_continue
    rcs1(3) = CDate(datev)
    If Hr = " " Then
    Hr = "00"
    End If
    If Min = " " Then
    Min = "00"
    End If
    timev = Hr & ":" & Min & ":00" 'Time literal
    rcs1(4) = CDate(timev)
    rcs1.Update
    GoTo loop_next
    End If
    Date_error_continue:
    If CurrLnTxt Like "FEATURE *" Then
    rcs.AddNew
    rcs!PartID = rcs1!PartID
    rcs(1) = Right(Left(CurrLnTxt, 11), 2)
    rcs.Update
    GoTo loop_next
    End If
    If CurrLnTxt Like "X *" Then
    rcs.MoveLast
    rcs.Edit
    rcs(2) = Right(Left(CurrLnTxt, 13), 8)
    rcs(3) = Right(Left(CurrLnTxt, 29), 8)
    rcs(4) = Right(Left(CurrLnTxt, 45), 8)
    rcs(5) = Right(Left(CurrLnTxt, 61), 6)
    rcs.Update
    GoTo loop_next
    End If
    If CurrLnTxt Like "FINISH" Then
    ii = ii + 1
    End If


    ------------------------------------------------------------------------------------------------
    Text file extract:

    CYCLE
    TIME .103 HRS
    M- 2008- 1010 PART 159T 1822 27 2

    ---------- --------- ---------- --------- ---------- ---------
    PART 160 27 2 2006 18.22
    ---------- --------- ---------- --------- ---------- ---------
    FEATURE 2
    0FFSET 1
    MAIN SPINDLE EXTERNAL ROUGH TURN
    X .013 Y .002 Z .200 SIZE 44.616
    OLD WEAR OFFSET X .053 Y .000 Z .015 R .000
    NEW WEAR OFFSET X .037 Y .000 Z .015 R .000

    FEATURE CORRECT
    ---------- --------- ---------- --------- ---------- ---------
    FEATURE 3
    0FFSET 3
    MAIN SPINDLE INTERNAL ROUGH TURN
    X - .005 Y - .001 Z - 8.444 SIZE 28.753
    OLD WEAR OFFSET X - .003 Y .000 Z - .244 R .000
    NEW WEAR OFFSET X - .026 Y .000 Z - .250 R .000

    FEATURE CORRECT
    ---------- --------- ---------- --------- ---------- ---------
    FEATURE 6
    0FFSET 10
    MAIN SPINDLE INTERNAL FINISH TURN
    X - .014 Y - .008 Z - 8.498 SIZE 29.037
    OLD WEAR OFFSET X - .019 Y .000 Z .027 R .000
    NEW WEAR OFFSET X - .026 Y .000 Z .027 R .000

    etc...
     
  2. Loading...

    Similar Threads Forum Date
    Sikhi Sound In The Process Of Creation Of Universe Sikh Sikhi Sikhism Apr 1, 2016
    UK Sikhs set for Vaisakhi procession West London Breaking News Mar 27, 2014
    Mewa Singh’s Funeral Procession 1915 Sikh Personalities Dec 22, 2013
    Two-Way Process Spiritual Articles Sep 8, 2013
    World Dubai Based Company Withdraws Memos Against Sikh Turban for Visa Processing Breaking News Mar 15, 2013

Share This Page