Sets the default data type to `Int32` for implicit variable definitions.
ID: 530
using uCalcSoftware;
var uc = new uCalc();
var intType = uc.DataTypeOf("Int32");
intType.IsDefault = true;
// Define a variable without specifying a type or initial value.
var myVar = uc.DefineVariable("myVar");
// Check the variable's type.
Console.WriteLine($"Default type is now: {uc.DefaultDataType.Name}");
Console.WriteLine($"myVar's type is: {myVar.DataType.Name}");
Default type is now: int
myVar's type is: int using uCalcSoftware; var uc = new uCalc(); var intType = uc.DataTypeOf("Int32"); intType.IsDefault = true; // Define a variable without specifying a type or initial value. var myVar = uc.DefineVariable("myVar"); // Check the variable's type. Console.WriteLine($"Default type is now: {uc.DefaultDataType.Name}"); Console.WriteLine($"myVar's type is: {myVar.DataType.Name}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto intType = uc.DataTypeOf("Int32");
intType.IsDefault(true);
// Define a variable without specifying a type or initial value.
auto myVar = uc.DefineVariable("myVar");
// Check the variable's type.
cout << "Default type is now: " << uc.DefaultDataType().Name() << endl;
cout << "myVar's type is: " << myVar.DataType().Name() << endl;
}
Default type is now: int
myVar's type is: int #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto intType = uc.DataTypeOf("Int32"); intType.IsDefault(true); // Define a variable without specifying a type or initial value. auto myVar = uc.DefineVariable("myVar"); // Check the variable's type. cout << "Default type is now: " << uc.DefaultDataType().Name() << endl; cout << "myVar's type is: " << myVar.DataType().Name() << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim intType = uc.DataTypeOf("Int32")
intType.IsDefault = true
'// Define a variable without specifying a type or initial value.
Dim myVar = uc.DefineVariable("myVar")
'// Check the variable's type.
Console.WriteLine($"Default type is now: {uc.DefaultDataType.Name}")
Console.WriteLine($"myVar's type is: {myVar.DataType.Name}")
End Sub
End Module
Default type is now: int
myVar's type is: int Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim intType = uc.DataTypeOf("Int32") intType.IsDefault = true '// Define a variable without specifying a type or initial value. Dim myVar = uc.DefineVariable("myVar") '// Check the variable's type. Console.WriteLine($"Default type is now: {uc.DefaultDataType.Name}") Console.WriteLine($"myVar's type is: {myVar.DataType.Name}") End Sub End Module