This topic contains 4 replies, has 2 voices, and was last updated by  Cornel 3 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1074

    Cornel
    Participant

    I have the following code in CATScript Reading Date. What I miss from file TestFile? I can not run the correct code.

    Sub CATMain()

    Dim iStream As TextStream
    Set iStream = TestFile.OpenAsTextStream (“ForReading”)
    Do While Not (iStream.AtEndOfStream)
    Dim Row As CATBSTR
    Row = iStream.ReadLine
    MsgBox (Row)
    Loop
    iStream.Close

    End Sub

    #1076

    Emmett Ross
    Keymaster

    Hi. What exactly are you trying to accomplish? Maybe try something like this using a Do Until loop:

    #1077

    Cornel
    Participant

    I want all data to be read in the TestFile and displayed in a window, row by row.
    TestFile defined as object are needs a path?
    How to write this path for TestFile? TestFile is saved in a specific location?
    It is a text file with *.txt extension (TestFile.txt) ?!

    #1078

    Emmett Ross
    Keymaster

    Oh ok. Yes, the testFile is a txt.

    #1079

    Cornel
    Participant

    Hello, thank you very much for your answer.

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘CATIA Macro Programming’ is closed to new topics and replies.