Smart pascal source code
type
TMyClass = class
end;
var objA: TMyClass = TMyClass.Create;
var objB: TMyClass = TMyClass.Create;
var objC: TMyClass;
if objA = objB then
WriteLn('A = B');
if objA <> objB then
WriteLn('A <> B');
if objA = objC then
WriteLn('A = C');
if objA <> objC then
WriteLn('A <> C');
objC := objA;
if objA = objC then
WriteLn('A = C');
if objA <> objC then
WriteLn('A <> C');
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
A <> B
A <> C
A = C
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}
var TMyClass = {
$ClassName:"TMyClass",$Parent:TObject
,$Init:function ($) {
TObject.$Init($);
}
,Destroy:TObject.Destroy
};
var objA = null,
objB = null,
objC = null;
/* <<< main JS >>> */
objA = TObject.Create($New(TMyClass));
objB = TObject.Create($New(TMyClass));
if (objA===objB) {
WriteLn("A = B");
}
if (objA!==objB) {
WriteLn("A <> B");
}
if (objA===objC) {
WriteLn("A = C");
}
if (objA!==objC) {
WriteLn("A <> C");
}
objC = objA;
if (objA===objC) {
WriteLn("A = C");
}
if (objA!==objC) {
WriteLn("A <> C");
}