Verifies the direct parent-child relationship between a Transformer and its Rule.
ID: 960
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
var myRule = t.FromTo("A", "B");
// Get the parent from the rule
var parent = myRule.ParentTransformer;
// Check if the parent is the original transformer using its unique memory index
Console.WriteLine(parent.MemoryIndex == t.MemoryIndex);
True using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); var myRule = t.FromTo("A", "B"); // Get the parent from the rule var parent = myRule.ParentTransformer; // Check if the parent is the original transformer using its unique memory index Console.WriteLine(parent.MemoryIndex == t.MemoryIndex);
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
#define tf(IsTrue) ((IsTrue) ? "True" : "False")
int main() {
uCalc uc;
uCalc::Transformer t;
auto myRule = t.FromTo("A", "B");
// Get the parent from the rule
auto parent = myRule.ParentTransformer();
// Check if the parent is the original transformer using its unique memory index
cout << tf(parent.MemoryIndex() == t.MemoryIndex()) << endl;
}
True #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; uCalc::Transformer t; auto myRule = t.FromTo("A", "B"); // Get the parent from the rule auto parent = myRule.ParentTransformer(); // Check if the parent is the original transformer using its unique memory index cout << tf(parent.MemoryIndex() == t.MemoryIndex()) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
Dim myRule = t.FromTo("A", "B")
'// Get the parent from the rule
Dim parent = myRule.ParentTransformer
'// Check if the parent is the original transformer using its unique memory index
Console.WriteLine(parent.MemoryIndex = t.MemoryIndex)
End Sub
End Module
True Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() Dim myRule = t.FromTo("A", "B") '// Get the parent from the rule Dim parent = myRule.ParentTransformer '// Check if the parent is the original transformer using its unique memory index Console.WriteLine(parent.MemoryIndex = t.MemoryIndex) End Sub End Module