Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
This post shows how to read data from each row in a spreadsheet. You grab the Rows property, have to do something "fancy" to get them as DataRows, and then loop through them. Then in each row you can address each column by index via row[0], row[1], etc. Look near the bottom for example in LoadStandings.
https://atvo.appgineering.com/Forum/Thread/69?postId=451#451

For most laps led I think the easiest way is just to sort the results by LapsLed and grab the first one. It is probably not the most efficient but it's not gonna matter, sorting max 60 items should take a microsecond or less. Something like this perhaps:
var results = sim.Session.Current?.Results;
var sorted = results?.OrderBy(r => r.LapsLed)?.ToList();
if (sorted != null && sorted.Count > 0)
{
var most = sorted[0];
// Do what you want with this result
}