Notch Notch Manual 0.9.23
 Light | Dark
GetCSVFileContents2D()

GetCSVFileContents2D()

Purpose #

Gets the contents of a CSV as a 2-dimensional array, if the resource object is a CSV File resource. Otherwise returns a null object.

Syntax #

Array GetCSVFileContents2D();

Example #

function Update()  { 
    csv = Document.FindResourceByName("test.csv");
    if(csv != null)
    {
        csvData = csv.GetCSVFileContents2D();
        for (a = 0; a < csvData.length; a = a + 1)
        {
            csvRow = csvData[a];
            for (b = 0; b < csvRow.length; b = b + 1)
            {
                val = csvRow[b];
                Log("entry " + a + ", " + b + ": " + val);
            }
        }
    }
}