long text in variable

Discussion in 'ASP General' started by joe, Apr 20, 2005.

  1. joe

    joe Guest

    I am using some code like the one below to work with a text file, modifying
    its lines one by one:

    Set objFS = Server.CreateObject("Scripting.FileSystemObject")

    Set objF = objFS.OpenTextFile("MyText.txt", 1)

    Do While objF.Line <= 26 ' --- I am reading only certain lines

    '--- get entire line
    strTemp = objF.ReadLine
    '--- do some other stuff here

    Loop

    Now, I'd like to do the same with similar data that's been stored in a
    variable instead of a file.
    I guess I could split the variable into an array by using line break as the
    splitting character, and
    loop the array elements. Any other suggestion? Thanks in advance.
    joe, Apr 20, 2005
    #1
    1. Advertising

  2. Hi joe,

    Your splitting on vbCrLf sounds like a good solution to me.

    Ray at work

    "joe" <> wrote in message
    news:d0u9e.10853$...
    > I am using some code like the one below to work with a text file,

    modifying
    > its lines one by one:
    >
    > Set objFS = Server.CreateObject("Scripting.FileSystemObject")
    >
    > Set objF = objFS.OpenTextFile("MyText.txt", 1)
    >
    > Do While objF.Line <= 26 ' --- I am reading only certain lines
    >
    > '--- get entire line
    > strTemp = objF.ReadLine
    > '--- do some other stuff here
    >
    > Loop
    >
    > Now, I'd like to do the same with similar data that's been stored in a
    > variable instead of a file.
    > I guess I could split the variable into an array by using line break as

    the
    > splitting character, and
    > loop the array elements. Any other suggestion? Thanks in advance.
    >
    >
    >
    >
    >
    >
    Ray Costanzo [MVP], Apr 20, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    674
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,186
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    473
    santosh
    Jul 24, 2007
  4. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    797
    Peter Nilsson
    Jan 15, 2008
  5. veryhotsausage
    Replies:
    1
    Views:
    1,799
    veryhotsausage
    Jul 4, 2008
Loading...

Share This Page