Read txt File and Compare

Discussion in 'ASP General' started by Simon Gare, Apr 17, 2007.

  1. Simon Gare

    Simon Gare Guest

    Hi all,

    have a text file that is read in an asp page

    <%
    Dim arrFileLines()
    i = 0
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile =
    objFSO.OpenTextFile("D:\Inetpub\Websites\AmacExpressServices\Constants\areas
    ..txt", 1)

    Do Until objFile.AtEndOfStream
    Redim Preserve arrFileLines(i)
    arrFileLines(i) = objFile.ReadLine
    i = i + 1
    Loop
    objFile.Close

    %>

    What i need to do further down is something like this to change the row bg
    color.

    <<% IF arrFileLines() <> BookingForm.Fields.Item("COLL_CITY_TOWN").Value
    Then response.write "style='background=#CCCCFF'"%>>

    Doesnt work like in this format.

    Regards
    Simon

    --
    Simon Gare
    The Gare Group Limited

    website: www.thegaregroup.co.uk
    website: www.privatehiresolutions.co.uk
     
    Simon Gare, Apr 17, 2007
    #1
    1. Advertising

  2. "Simon Gare" <> wrote in message
    news:...
    > Hi all,
    >
    > have a text file that is read in an asp page
    >
    > <%
    > Dim arrFileLines()
    > i = 0
    > Set objFSO = CreateObject("Scripting.FileSystemObject")
    > Set objFile =
    >

    objFSO.OpenTextFile("D:\Inetpub\Websites\AmacExpressServices\Constants\areas
    > .txt", 1)
    >
    > Do Until objFile.AtEndOfStream
    > Redim Preserve arrFileLines(i)
    > arrFileLines(i) = objFile.ReadLine
    > i = i + 1
    > Loop
    > objFile.Close
    >
    > %>
    >
    > What i need to do further down is something like this to change the row bg
    > color.
    >
    > <<% IF arrFileLines() <> BookingForm.Fields.Item("COLL_CITY_TOWN").Value
    > Then response.write "style='background=#CCCCFF'"%>>
    >
    > Doesnt work like in this format.


    try:- style="background-color:#CCCCFF"

    http://www.w3.org/TR/REC-CSS2/colors.html#background-properties

    Note that an inline style attribute should contain syntax that is valid
    between { } in a style element or a CSS file.

    >
    > Regards
    > Simon
    >
    > --
    > Simon Gare
    > The Gare Group Limited
    >
    > website: www.thegaregroup.co.uk
    > website: www.privatehiresolutions.co.uk
    >
    >
     
    Anthony Jones, Apr 18, 2007
    #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. Sameen
    Replies:
    2
    Views:
    475
    Victor Bazarov
    Aug 29, 2005
  2. King

    Read .txt file like .py file

    King, Jul 27, 2008, in forum: Python
    Replies:
    2
    Views:
    262
  3. Jochen Brenzlinger
    Replies:
    7
    Views:
    5,850
    Roedy Green
    Sep 15, 2011
  4. Replies:
    8
    Views:
    252
    peashoe
    Jan 24, 2005
  5. Ram
    Replies:
    3
    Views:
    278
    Tad McClellan
    Apr 26, 2007
Loading...

Share This Page