A simple demonstration of retrieving the data type name from a defined variable.
ID: 616
using uCalcSoftware;
var uc = new uCalc();
var myInt = uc.DefineVariable("myInt As Int");
var myIntType = myInt.DataType;
Console.WriteLine($"Variable 'myInt' has type: {myIntType.Name}");
Variable 'myInt' has type: int using uCalcSoftware; var uc = new uCalc(); var myInt = uc.DefineVariable("myInt As Int"); var myIntType = myInt.DataType; Console.WriteLine($"Variable 'myInt' has type: {myIntType.Name}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto myInt = uc.DefineVariable("myInt As Int");
auto myIntType = myInt.DataType();
cout << "Variable 'myInt' has type: " << myIntType.Name() << endl;
}
Variable 'myInt' has type: int #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto myInt = uc.DefineVariable("myInt As Int"); auto myIntType = myInt.DataType(); cout << "Variable 'myInt' has type: " << myIntType.Name() << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim myInt = uc.DefineVariable("myInt As Int")
Dim myIntType = myInt.DataType
Console.WriteLine($"Variable 'myInt' has type: {myIntType.Name}")
End Sub
End Module
Variable 'myInt' has type: int Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim myInt = uc.DefineVariable("myInt As Int") Dim myIntType = myInt.DataType Console.WriteLine($"Variable 'myInt' has type: {myIntType.Name}") End Sub End Module