The final steps needed to create the csv data for my createcsv() function are the following.  Set the subject variable, consisting of the team name and the tshirt color (aka if the team is home or away that game).  Second, setting the description variable, including the current game number of the season and whom the competitor is.  Then identify if this event is an “all day” event that many calendars include.  This data is to be input as either true or false, which is here entered as false.  

function createcsv (schedule){

//Other needed strings

  var subject = schedule[i].teamname + " " + schedule[i].tshirtcolor;

  var description = "Game #" + schedule[i].game + " vs " + schedule[i].competitor;

  var alldayevent = "False";

  var location = "Corvallis Sports Park";

  var pprivate = "True"

  var newcsventry = subject + "," + startdate + "," + starttime + "," + enddate + "," + endtime + "," + alldayevent + "," + description + "," + location + "," + pprivate + "\r\n";

  finalcsv += newcsventry;

}

return finalcsv

};


Next a variable is made called location which is simply a string, “Corvallis Sports Park”.  Then pprivate is identified as true so that the event will show up on your calendar automatically as a private event.  The last part of setting up the CSV file is to concatenate all of these parts, following the original example shown here on the Google Help Forum, and add it to the final list.  Please note that the last bits added to this string is ‘\r\n’ to make sure that the ‘feed line’ and ‘cartridge return’ (read: hitting the enter button) occurs.  Once the for loop has finished processing, it will return a long string called finalcsv.  

Up Next Time: Issues and edits of code thus far