USOClasses can inherit other USOClasses.

Define the class name that the inheritor inherits from.
And write it in the inheritor's constructor code.

$baselist = @();
$baselist += "[ClassNameOfInheritFrom]";

$this | add-member -membertype noteproperty -name BaseClass -value $baselist -force;

For example:
Now we make a class named MyAltTestClass that inherits MyTestClass.
The link file is a text of the example.MyAltTestClass.Constructor.txt

If you did not do in AddUSOClasses, do it before this content.
Download MyAltTestClass.Constructor.txt and rename extension from .txt to .code, place to code folder.
In new session of SALAD, input follows.
$myclass = new myalttestclass;

Echo method in MyAltTestClass works, although no one defined in MyAltTestClass.
This is the inheritance.

Last edited Mar 2, 2013 at 1:01 PM by Tom__S, version 8


No comments yet.