// this is definition of UserClass "Test"
// class contains two numeric properties: X and Y
// class contains 4 methods: PowerSum, IsNonZero, ToString and Print
class Test {
→000001double X;
→000002double Y;
// you can define input parameters of the method
double PowerSum(double eX, double eY)
{
return X↑eX←+Y↑eY←;
}
bool IsNonZero() {
return (X != 0) && (Y != 0);
}
string ToString()
{
return X.ToString("0.00") & ", " & Y.ToString("0.00");
}
// this method export content of the class to output
object Print(string Caption)
{
→000037TEXT(Caption);
→000035TEXT("X = " & X);
→000036TEXT("Y = " & Y);
return null; // this method is not intended to return value.
}
}
// we create two instances of UserClass "Test" and try to call methods:
object O1 →000038= new Test(); O1.X →000012= 0; O1.Y →000013= 4; // initialize first instance of UserClass "Test"
double D1 →000040= O1.PowerSum(2, 0.5); // call numeric function
bool B1 →000041= O1.IsNonZero(); // call boolean function
string S1 →000042= O1.ToString(); // call string function
→000043O1.Print("Printing object O1:"); // call procedure which print out the content of the class
object O2 →000018= new Test(); O2.X →000019= 9; O2.Y →000020= 10; // initialize second instance of UserClass "Test"
double D2 →000044= O2.PowerSum(2, 3); // call numeric function
bool B2 →000045= O2.IsNonZero(); // call boolean function
string S2 →000046= O2.ToString(); // call string function
→000047O2.Print("Printing object O2:"); // call procedure which print out the content of the class
Layout 0
Layout 1
Layout 2
Layout 3
Layout 4
Layout 5
http://sciadesignforms.com/
Caption
"X = " & X
"Y = " & Y