function readFile(filePath) {
    var fileObj = new File();
    var content;
    try {
        fileObj.Open(filePath, 0, 0);
        content = fileObj.Read();
    } catch(e) {
        // IO error
        throw "UnableToReadFile(" + filePath + "):" + e;
    } finally {
        fileObj.Close();
    }
    return content;
}
/*
 Parse a text file and return the contents in a string
*/
Parse a text file and return the contents in a string
Parse a text file and return the contents in a string
function readFile(filePath) {
    var fileObj = new File();
    var content;
    try {
        fileObj.Open(filePath, 0, 0);
        content = fileObj.Read();
    } catch(e) {
        throw "UnableToReadFile(" + filePath + "):" + e;
    } finally {
        fileObj.Close();
    }
    return content;
}
function readFile ( filePath ) { var fileObj = new File ( ) ; var content ; try { fileObj . Open ( filePath , 0 , 0 ) ; content = fileObj . Read ( ) ; } catch ( e ) { throw "UnableToReadFile(" + filePath + "):" + e ; } finally { fileObj . Close ( ) ; } return content ; }
Parse a text file and return the contents in a string
Parse a text file and return the contents in a string
// IO error