function parseSettings(str) {
    var settingTable = {};
    var rawRowArray = str.split("\n");
    // Remove all empty rows:
    var rowArray = new Array();
    for(var i = 0, len = rawRowArray.length; i < len; i++) {
        var row = rawRowArray[i];
        if(row !== "") {
            rowArray.push(row);
        }
    }
    // Parse row-by-row:
    for(var i = 0, len = rowArray.length; i < len; i++) {
        var currentRow = rowArray[i].split("=");
        if(currentRow.length > 0) {
            try {
                var name = currentRow[0];
                var value = readNumerical(currentRow[1]);
            } catch(e) {
                throw "UnableToParseSettingTableException:" + e;
            }
            settingTable[name] = value;
        }
    }
    return settingTable;
}
/*
 Parses a string containing name/value information into a table/object,
 assumes entries are in format name=value and separated by a
 newline character. Returns an object with name/value properties
*/
Parses a string containing name/value information into a table/object,
assumes entries are in format name=value and separated by a
newline character. Returns an object with name/value properties
Parses a string containing name / value information into a table / object assumes entries are in format name = value and separated by a newline character . Returns an object with name / value properties
function parseSettings(str) {
    var settingTable = {};
    var rawRowArray = str.split("\n");
    var rowArray = new Array();
    for(var i = 0, len = rawRowArray.length; i < len; i++) {
        var row = rawRowArray[i];
        if(row !== "") {
            rowArray.push(row);
        }
    }
    for(var i = 0, len = rowArray.length; i < len; i++) {
        var currentRow = rowArray[i].split("=");
        if(currentRow.length > 0) {
            try {
                var name = currentRow[0];
                var value = readNumerical(currentRow[1]);
            } catch(e) {
                throw "UnableToParseSettingTableException:" + e;
            }
            settingTable[name] = value;
        }
    }
    return settingTable;
}
function parseSettings ( str ) { var settingTable = { } ; var rawRowArray = str . split ( "\n" ) ; var rowArray = new Array ( ) ; for ( var i = 0 , len = rawRowArray . length ; i < len ; i ++ ) { var row = rawRowArray [ i ] ; if ( row !== "" ) { rowArray . push ( row ) ; } } for ( var i = 0 , len = rowArray . length ; i < len ; i ++ ) { var currentRow = rowArray [ i ] . split ( "=" ) ; if ( currentRow . length > 0 ) { try { var name = currentRow [ 0 ] ; var value = readNumerical ( currentRow [ 1 ] ) ; } catch ( e ) { throw "UnableToParseSettingTableException:" + e ; } settingTable [ name ] = value ; } } return settingTable ; }
Parses a string containing name/value information into a table/object,
assumes entries are in format name=value and separated by a
newline character.
Parses a string containing name / value information into a table / object assumes entries are in format name = value and separated by a newline character .
// Remove all empty rows: // Parse row-by-row: