Search a list of records: Difference between revisions

m
Line 681:
</lang>
=={{header|Elena}}==
ELENA 4.x1 :
<lang elena>import extensions;
import system'routines;
Line 687:
public program()
{
var dataset := new object[]::
{(
new :: { Name = "Lagos"; Population = 21.0r; },
new :: { Name = "Cairo"; Population = 15.2r; },
new :: { Name = "Kinshasa-Brazzaville"; Population = 11.3r; },
new :: { Name = "Greater Johannesburg"; Population = 7.55r; },
new :: { Name = "Mogadishu"; Population = 5.85r; },
new :: { Name = "Khartoum-Omdurman"; Population = 4.98r; },
new :: { Name = "Dar Es Salaam"; Population = 4.7r; },
new :: { Name = "Alexandria"; Population = 4.58r; },
new :: { Name = "Abidjan"; Population = 4.4r; },
new :: { Name = "Casablanca"; Population = 3.98r; }
});
var index := dataset.selectBy:(r => r.Name).toArray().indexOfElement("Dar Es Salaam");
Anonymous user