Demonstrates the basic true/false state of the WasModified flag.
ID: 1150
See: WasModified = [bool]
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("a", "*a good*");
// Case 1: A match occurs, text is modified.
t.Text = "This is a test";
t.Transform();
Console.WriteLine($"Modified: {t.WasModified}");
// Case 2: No match occurs, text is unchanged.
t.Text = "This is another test";
t.Transform();
Console.WriteLine($"Modified: {t.WasModified}");
Modified: True
Modified: False using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.FromTo("a", "*a good*"); // Case 1: A match occurs, text is modified. t.Text = "This is a test"; t.Transform(); Console.WriteLine($"Modified: {t.WasModified}"); // Case 2: No match occurs, text is unchanged. t.Text = "This is another test"; t.Transform(); Console.WriteLine($"Modified: {t.WasModified}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
#define tf(IsTrue) ((IsTrue) ? "True" : "False")
int main() {
uCalc uc;
uCalc::Transformer t;
t.FromTo("a", "*a good*");
// Case 1: A match occurs, text is modified.
t.Text("This is a test");
t.Transform();
cout << "Modified: " << tf(t.WasModified()) << endl;
// Case 2: No match occurs, text is unchanged.
t.Text("This is another test");
t.Transform();
cout << "Modified: " << tf(t.WasModified()) << endl;
}
Modified: True
Modified: False #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; #define tf(IsTrue) ((IsTrue) ? "True" : "False") int main() { uCalc uc; uCalc::Transformer t; t.FromTo("a", "*a good*"); // Case 1: A match occurs, text is modified. t.Text("This is a test"); t.Transform(); cout << "Modified: " << tf(t.WasModified()) << endl; // Case 2: No match occurs, text is unchanged. t.Text("This is another test"); t.Transform(); cout << "Modified: " << tf(t.WasModified()) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
t.FromTo("a", "*a good*")
'// Case 1: A match occurs, text is modified.
t.Text = "This is a test"
t.Transform()
Console.WriteLine($"Modified: {t.WasModified}")
'// Case 2: No match occurs, text is unchanged.
t.Text = "This is another test"
t.Transform()
Console.WriteLine($"Modified: {t.WasModified}")
End Sub
End Module
Modified: True
Modified: False Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() t.FromTo("a", "*a good*") '// Case 1: A match occurs, text is modified. t.Text = "This is a test" t.Transform() Console.WriteLine($"Modified: {t.WasModified}") '// Case 2: No match occurs, text is unchanged. t.Text = "This is another test" t.Transform() Console.WriteLine($"Modified: {t.WasModified}") End Sub End Module