Displaying an expression of unsigned byte as a signed byte by using a Pointer
ID: 44
See: EvaluateA, EvaluateVoid
using uCalcSoftware;
var uc = new uCalc();
var VariableX = uc.DefineVariable("x As Int");
var ParsedExpr = uc.Parse("x + 125", "Int8u");
for (int x = 1; x <= 10; x++) {
VariableX.ValueInt32(x);
Console.WriteLine($"x = {x} Int8 result = {uc.ValueAt(ParsedExpr.EvaluateVoid(), "Int8")}");
}
ParsedExpr.Release();
VariableX.Release();
x = 1 Int8 result = 126
x = 2 Int8 result = 127
x = 3 Int8 result = -128
x = 4 Int8 result = -127
x = 5 Int8 result = -126
x = 6 Int8 result = -125
x = 7 Int8 result = -124
x = 8 Int8 result = -123
x = 9 Int8 result = -122
x = 10 Int8 result = -121 using uCalcSoftware; var uc = new uCalc(); var VariableX = uc.DefineVariable("x As Int"); var ParsedExpr = uc.Parse("x + 125", "Int8u"); for (int x = 1; x <= 10; x++) { VariableX.ValueInt32(x); Console.WriteLine($"x = {x} Int8 result = {uc.ValueAt(ParsedExpr.EvaluateVoid(), "Int8")}"); } ParsedExpr.Release(); VariableX.Release();
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto VariableX = uc.DefineVariable("x As Int");
auto ParsedExpr = uc.Parse("x + 125", "Int8u");
for (int x = 1; x <= 10; x++) {
VariableX.ValueInt32(x);
cout << "x = " << x << " Int8 result = " << uc.ValueAt(ParsedExpr.EvaluateVoid(), "Int8") << endl;
}
ParsedExpr.Release();
VariableX.Release();
}
x = 1 Int8 result = 126
x = 2 Int8 result = 127
x = 3 Int8 result = -128
x = 4 Int8 result = -127
x = 5 Int8 result = -126
x = 6 Int8 result = -125
x = 7 Int8 result = -124
x = 8 Int8 result = -123
x = 9 Int8 result = -122
x = 10 Int8 result = -121 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto VariableX = uc.DefineVariable("x As Int"); auto ParsedExpr = uc.Parse("x + 125", "Int8u"); for (int x = 1; x <= 10; x++) { VariableX.ValueInt32(x); cout << "x = " << x << " Int8 result = " << uc.ValueAt(ParsedExpr.EvaluateVoid(), "Int8") << endl; } ParsedExpr.Release(); VariableX.Release(); }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim VariableX = uc.DefineVariable("x As Int")
Dim ParsedExpr = uc.Parse("x + 125", "Int8u")
For x As Integer = 1 To 10
VariableX.ValueInt32(x)
Console.WriteLine($"x = {x} Int8 result = {uc.ValueAt(ParsedExpr.EvaluateVoid(), "Int8")}")
Next
ParsedExpr.Release()
VariableX.Release()
End Sub
End Module
x = 1 Int8 result = 126
x = 2 Int8 result = 127
x = 3 Int8 result = -128
x = 4 Int8 result = -127
x = 5 Int8 result = -126
x = 6 Int8 result = -125
x = 7 Int8 result = -124
x = 8 Int8 result = -123
x = 9 Int8 result = -122
x = 10 Int8 result = -121 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim VariableX = uc.DefineVariable("x As Int") Dim ParsedExpr = uc.Parse("x + 125", "Int8u") For x As Integer = 1 To 10 VariableX.ValueInt32(x) Console.WriteLine($"x = {x} Int8 result = {uc.ValueAt(ParsedExpr.EvaluateVoid(), "Int8")}") Next ParsedExpr.Release() VariableX.Release() End Sub End Module