none
program faiolure RRS feed

  • Question


  • dirPath = "c:\users\shlomo\documents\SB Progs\"
    fileOne = "ckJournal"
    filePath = dirPath + fileOne
    lines = Fileplus.ReadLContents(filePath, "normal")
    TextWindow.WriteLine(lines)

    File.ReadContents –----------------------------------------- [o]
    Opens a file and reads the entire file's contents.  This method will be fast for small files that are less than a MB in size, but will start to slow down and will be noticeable for files greater than 10MB. 
    File.ReadContents(filePath)
    filePath
    The full path of the file to read.  An example of a full path will be c:\temp\settings.data.
    Returns
    The entire contents of the file.

    NOTE: When this object.Method is used in a program the compiler returns the error message “cannot fine ReadContents in File”. This occured when I copied this snippet from Notepad++ to the SB IDE. When I called the method from intellisnese, the program ran but failed.


    FilePlus.ReadContents –------------------------------------- [o]
    Opens a file and reads the entire file's Contents.  This method will be fast for small files that are less than an MB in size, but will start to slow down and will be noticeable for files greater than 10MB. 
    FilePlus.ReadContents(FilePath)
    FilePath
    The full path of the file to read.  An example of a full path will be c:\temp\settings.data.
    Returns
    The entire Contents of the file or "FAILED".

    NOTE: When this object.Method is used in a program the compiler returns the error message “cannot fine ReadContents in FilePlus”. This occured when I copied this snippet from Notepad++ to the SB IDE. When I called the method from intellisnese, the program ran but produced nothing, not even a "failed" message.
    Wednesday, January 18, 2012 9:14 PM

Answers

  • Some typo errors in your code 'ReadLContents(filePath, "normal")' and perhaps the file extension missing.

    The following works for me:

    dirPath = "c:\temp\"
    fileOne = "test.txt"
    filePath = dirPath + fileOne
    lines = Fileplus.ReadContents(filePath)
    TextWindow.WriteLine(lines)


    Thursday, January 19, 2012 7:28 PM
    Moderator