read data from file error message

Discussion in 'C#' started by t7584, Mar 28, 2006.

  1. #1
    read data from file error message

    this program, that reads data from file , works
    <%const forreading = 1
    const tristateusedefault = -2

    Dim FSO, TextStream, S
    set FSO = server.createobject("Scripting.FileSystemObject")


    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set TextStream = FS:confused:pentextfile("c:\testfile.txt",forreading, tristateusedefault)
    %>
    <A NAME="closereadfromfile"></A><%

    S = TextStream.ReadAll & NewLine & NewLine

    TextStream.Close

    response.write(S)

    %>

    But when I try to use it in another program it doesn't work
    error message - Microsoft VBScript runtime error '800a01f4'

    Variable is undefined: 'NewLine'
     
    t7584, Mar 28, 2006 IP
  2. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you're treating "newline" as a variable but not defining it in your dim, or adding any values to it. try "+ newline" instead of "& newline", or remove the "& newline & newline" from your S variable.
     
    vectorgraphx, Mar 28, 2006 IP