mirror of
https://github.com/PetroProtsyk/SSharp
synced 2026-06-08 12:11:10 +00:00
33 lines
755 B
Plaintext
33 lines
755 B
Plaintext
//Implementation of classes in Script.NET
|
|
//Please use latest version to run this sample
|
|
//
|
|
//
|
|
//S#
|
|
//09.04.2008
|
|
//http://www.protsyk.com/scriptdotnet
|
|
|
|
|
|
school =
|
|
[
|
|
classes ->
|
|
[
|
|
A->['Alexey', 'Ivan','John'],
|
|
B->['Petr','Valya','Masha','Joe']
|
|
],
|
|
|
|
GetClasses->function ()
|
|
{
|
|
foreach(class in body.classes.Fields)
|
|
Console.WriteLine(class);
|
|
},
|
|
|
|
GetClass->function (name)
|
|
{
|
|
foreach(student in body.classes[name] )
|
|
Console.WriteLine(student);
|
|
}
|
|
|
|
];
|
|
|
|
school.GetClasses();
|
|
school.GetClass('B'); |