Internal Test: Verifies the layering and precedence of multiple format rules using `InsertAt`.
ID: 353
using uCalcSoftware;
var uc = new uCalc();
var strType = uc.DataTypeOf("String");
// Rule A (will be applied second)
uc.Format("val = '[' + val + ']'");
// Rule B (will be applied first)
uc.Format("val = 'inner:(' + val + ')'");
Console.WriteLine($"Default layering: {uc.EvalStr("'text'")}");
// Rule C: Insert this rule at position 0, making it apply LAST.
uc.Format("InsertAt: 0, Def: val = 'outer: {' + val + '}'");
Console.WriteLine($"With InsertAt: {uc.EvalStr("'text'")}");
Default layering: [inner:(text)]
With InsertAt: outer: {[inner:(text)]} using uCalcSoftware; var uc = new uCalc(); var strType = uc.DataTypeOf("String"); // Rule A (will be applied second) uc.Format("val = '[' + val + ']'"); // Rule B (will be applied first) uc.Format("val = 'inner:(' + val + ')'"); Console.WriteLine($"Default layering: {uc.EvalStr("'text'")}"); // Rule C: Insert this rule at position 0, making it apply LAST. uc.Format("InsertAt: 0, Def: val = 'outer: {' + val + '}'"); Console.WriteLine($"With InsertAt: {uc.EvalStr("'text'")}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto strType = uc.DataTypeOf("String");
// Rule A (will be applied second)
uc.Format("val = '[' + val + ']'");
// Rule B (will be applied first)
uc.Format("val = 'inner:(' + val + ')'");
cout << "Default layering: " << uc.EvalStr("'text'") << endl;
// Rule C: Insert this rule at position 0, making it apply LAST.
uc.Format("InsertAt: 0, Def: val = 'outer: {' + val + '}'");
cout << "With InsertAt: " << uc.EvalStr("'text'") << endl;
}
Default layering: [inner:(text)]
With InsertAt: outer: {[inner:(text)]} #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto strType = uc.DataTypeOf("String"); // Rule A (will be applied second) uc.Format("val = '[' + val + ']'"); // Rule B (will be applied first) uc.Format("val = 'inner:(' + val + ')'"); cout << "Default layering: " << uc.EvalStr("'text'") << endl; // Rule C: Insert this rule at position 0, making it apply LAST. uc.Format("InsertAt: 0, Def: val = 'outer: {' + val + '}'"); cout << "With InsertAt: " << uc.EvalStr("'text'") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim strType = uc.DataTypeOf("String")
'// Rule A (will be applied second)
uc.Format("val = '[' + val + ']'")
'// Rule B (will be applied first)
uc.Format("val = 'inner:(' + val + ')'")
Console.WriteLine($"Default layering: {uc.EvalStr("'text'")}")
'// Rule C: Insert this rule at position 0, making it apply LAST.
uc.Format("InsertAt: 0, Def: val = 'outer: {' + val + '}'")
Console.WriteLine($"With InsertAt: {uc.EvalStr("'text'")}")
End Sub
End Module
Default layering: [inner:(text)]
With InsertAt: outer: {[inner:(text)]} Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim strType = uc.DataTypeOf("String") '// Rule A (will be applied second) uc.Format("val = '[' + val + ']'") '// Rule B (will be applied first) uc.Format("val = 'inner:(' + val + ')'") Console.WriteLine($"Default layering: {uc.EvalStr("'text'")}") '// Rule C: Insert this rule at position 0, making it apply LAST. uc.Format("InsertAt: 0, Def: val = 'outer: {' + val + '}'") Console.WriteLine($"With InsertAt: {uc.EvalStr("'text'")}") End Sub End Module