function parseTransferTable(str, delimiter) {
    if(typeof delimiter === "undefined") {
        delimiter = ",";
    }
    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);
        }
    }
    var transferTable = new Array();
    // Parse row-by-row:
    for(var i = 0, len = rowArray.length; i < len; i++) {
        var currentRow = rowArray[i].split(delimiter);
        if(currentRow.length > 0) {
            try {
                var source = convertCoords(currentRow[0]);
                var volume = readNumerical(currentRow[1]);
                var destination = convertCoords(currentRow[2]);
            } catch(e) {
                throw "UnableToParseTransferTableException:" + e;
            }
            transferTable[i] = new Transfer(source, volume, destination);
        }
    }
    return transferTable;
}
/*
 Parses a string containing position and volume information
 into an array, assumes format is <source,volume,destination>,
 e.g. 'A6,25,B8'
*/
Parses a string containing position and volume information
into an array, assumes format is ,
e.g.
Parses a string containing position and volume information into an array assumes format is e . g .
function parseTransferTable(str, delimiter) {
    if(typeof delimiter === "undefined") {
        delimiter = ",";
    }
    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);
        }
    }
    var transferTable = new Array();
    for(var i = 0, len = rowArray.length; i < len; i++) {
        var currentRow = rowArray[i].split(delimiter);
        if(currentRow.length > 0) {
            try {
                var source = convertCoords(currentRow[0]);
                var volume = readNumerical(currentRow[1]);
                var destination = convertCoords(currentRow[2]);
            } catch(e) {
                throw "UnableToParseTransferTableException:" + e;
            }
            transferTable[i] = new Transfer(source, volume, destination);
        }
    }
    return transferTable;
}
function parseTransferTable ( str , delimiter ) { if ( typeof delimiter === "undefined" ) { delimiter = "," ; } 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 ) ; } } var transferTable = new Array ( ) ; for ( var i = 0 , len = rowArray . length ; i < len ; i ++ ) { var currentRow = rowArray [ i ] . split ( delimiter ) ; if ( currentRow . length > 0 ) { try { var source = convertCoords ( currentRow [ 0 ] ) ; var volume = readNumerical ( currentRow [ 1 ] ) ; var destination = convertCoords ( currentRow [ 2 ] ) ; } catch ( e ) { throw "UnableToParseTransferTableException:" + e ; } transferTable [ i ] = new Transfer ( source , volume , destination ) ; } } return transferTable ; }
Parses a string containing position and volume information
into an array, assumes format is <source,volume,destination>,
e.g.
Parses a string containing position and volume information into an array assumes format is <source volume destination > e . g .
// Remove all empty rows: // Parse row-by-row: