SetVariableValueDblMethod
Sets the value of a double precision floating point variable
Syntax
SetVariableValueDbl(Value)
Parameters
Value
double
Double precision floating point value that the variable will be set to
Example 1: Setting a variable value
Dim var = uc.DefineVariable("Var")
Dim ByteVar = uc.DefineVariable("ByteVar As Int8")
Dim Int16uVar = uc.DefineVariable("Int16uVar As Int16u")
Dim Int32uVar = uc.DefineVariable("Int32uVar As Int32u")
Dim Int64uVar = uc.DefineVariable("Int64uVar As Int64u")
Dim SingleVar = uc.DefineVariable("SingleVar As Single")
Dim DoubleVar = uc.DefineVariable("DoubleVar As Double")
Dim StringVar = uc.DefineVariable("StringVar As String")
var.SetVariableValue(1.25)
ByteVar.SetVariableValueByte(255)
Int16uVar.SetVariableValueInt16(-1)
Int32uVar.SetVariableValueInt32(-1)
Int64uVar.SetVariableValueInt64(-1)
SingleVar.SetVariableValueSng(1.5)
DoubleVar.SetVariableValueDbl(2.5)
StringVar.SetVariableValueStr("Test")
Console.WriteLine("Var value: " + uc.EvalStr("Var"))
Console.WriteLine("ByteVar value: " + uc.EvalStr("ByteVar"))
Console.WriteLine("Int16uVar value: " + uc.EvalStr("Int16uVar"))
Console.WriteLine("Int32uVar value: " + uc.EvalStr("Int32uVar"))
Console.WriteLine("Int64uVar value: " + uc.EvalStr("Int64uVar"))
Console.WriteLine("SingleVar value: " + uc.EvalStr("SingleVar"))
Console.WriteLine("DoubleVar value: " + uc.EvalStr("DoubleVar"))
Console.WriteLine("StringVar value: " + uc.EvalStr("StringVar"))
var var = uc.DefineVariable("Var");
var ByteVar = uc.DefineVariable("ByteVar As Int8");
var Int16uVar = uc.DefineVariable("Int16uVar As Int16u");
var Int32uVar = uc.DefineVariable("Int32uVar As Int32u");
var Int64uVar = uc.DefineVariable("Int64uVar As Int64u");
var SingleVar = uc.DefineVariable("SingleVar As Single");
var DoubleVar = uc.DefineVariable("DoubleVar As Double");
var StringVar = uc.DefineVariable("StringVar As String");
var.SetVariableValue(1.25);
ByteVar.SetVariableValueByte(255);
Int16uVar.SetVariableValueInt16(-1);
Int32uVar.SetVariableValueInt32(-1);
Int64uVar.SetVariableValueInt64(-1);
SingleVar.SetVariableValueSng((float)1.5);
DoubleVar.SetVariableValueDbl(2.5);
StringVar.SetVariableValueStr("Test");
Console.WriteLine("Var value: " + uc.EvalStr("Var"));
Console.WriteLine("ByteVar value: " + uc.EvalStr("ByteVar"));
Console.WriteLine("Int16uVar value: " + uc.EvalStr("Int16uVar"));
Console.WriteLine("Int32uVar value: " + uc.EvalStr("Int32uVar"));
Console.WriteLine("Int64uVar value: " + uc.EvalStr("Int64uVar"));
Console.WriteLine("SingleVar value: " + uc.EvalStr("SingleVar"));
Console.WriteLine("DoubleVar value: " + uc.EvalStr("DoubleVar"));
Console.WriteLine("StringVar value: " + uc.EvalStr("StringVar"));
var.SetVariableValue(1.25);
ByteVar.SetVariableValueByte(255);
Int16uVar.SetVariableValueInt16(-1);
Int32uVar.SetVariableValueInt32(-1);
Int64uVar.SetVariableValueInt64(-1);
SingleVar.SetVariableValueSng(1.5);
DoubleVar.SetVariableValueDbl(2.5);
StringVar.SetVariableValueStr('Test');
WriteLn('Var value: ' + uc.EvalStr('Var'));
WriteLn('ByteVar value: ' + uc.EvalStr('ByteVar'));
WriteLn('Int16uVar value: ' + uc.EvalStr('Int16uVar'));
WriteLn('Int32uVar value: ' + uc.EvalStr('Int32uVar'));
WriteLn('Int64uVar value: ' + uc.EvalStr('Int64uVar'));
WriteLn('SingleVar value: ' + uc.EvalStr('SingleVar'));
WriteLn('DoubleVar value: ' + uc.EvalStr('DoubleVar'));
WriteLn('StringVar value: ' + uc.EvalStr('StringVar'));
auto var = uc.DefineVariable("Var");
auto ByteVar = uc.DefineVariable("ByteVar As Int8");
auto Int16uVar = uc.DefineVariable("Int16uVar As Int16u");
auto Int32uVar = uc.DefineVariable("Int32uVar As Int32u");
auto Int64uVar = uc.DefineVariable("Int64uVar As Int64u");
auto SingleVar = uc.DefineVariable("SingleVar As Single");
auto DoubleVar = uc.DefineVariable("DoubleVar As Double");
auto StringVar = uc.DefineVariable("StringVar As String");
var.SetVariableValue(1.25);
ByteVar.SetVariableValueByte(255);
Int16uVar.SetVariableValueInt16(-1);
Int32uVar.SetVariableValueInt32(-1);
Int64uVar.SetVariableValueInt64(-1);
SingleVar.SetVariableValueSng((float)1.5);
DoubleVar.SetVariableValueDbl(2.5);
StringVar.SetVariableValueStr("Test");
cout << "Var value: " << uc.EvalStr("Var") << endl;
cout << "ByteVar value: " << uc.EvalStr("ByteVar") << endl;
cout << "Int16uVar value: " << uc.EvalStr("Int16uVar") << endl;
cout << "Int32uVar value: " << uc.EvalStr("Int32uVar") << endl;
cout << "Int64uVar value: " << uc.EvalStr("Int64uVar") << endl;
cout << "SingleVar value: " << uc.EvalStr("SingleVar") << endl;
cout << "DoubleVar value: " << uc.EvalStr("DoubleVar") << endl;
cout << "StringVar value: " << uc.EvalStr("StringVar") << endl;
auto var = uc.DefineVariable("Var");
auto ByteVar = uc.DefineVariable("ByteVar As Int8");
auto Int16uVar = uc.DefineVariable("Int16uVar As Int16u");
auto Int32uVar = uc.DefineVariable("Int32uVar As Int32u");
auto Int64uVar = uc.DefineVariable("Int64uVar As Int64u");
auto SingleVar = uc.DefineVariable("SingleVar As Single");
auto DoubleVar = uc.DefineVariable("DoubleVar As Double");
auto StringVar = uc.DefineVariable("StringVar As String");
var.SetVariableValue(1.25);
ByteVar.SetVariableValueByte(255);
Int16uVar.SetVariableValueInt16(-1);
Int32uVar.SetVariableValueInt32(-1);
Int64uVar.SetVariableValueInt64(-1);
SingleVar.SetVariableValueSng((float)1.5);
DoubleVar.SetVariableValueDbl(2.5);
StringVar.SetVariableValueStr("Test");
Console::WriteLine("Var value: " + uc.EvalStr("Var"));
Console::WriteLine("ByteVar value: " + uc.EvalStr("ByteVar"));
Console::WriteLine("Int16uVar value: " + uc.EvalStr("Int16uVar"));
Console::WriteLine("Int32uVar value: " + uc.EvalStr("Int32uVar"));
Console::WriteLine("Int64uVar value: " + uc.EvalStr("Int64uVar"));
Console::WriteLine("SingleVar value: " + uc.EvalStr("SingleVar"));
Console::WriteLine("DoubleVar value: " + uc.EvalStr("DoubleVar"));
Console::WriteLine("StringVar value: " + uc.EvalStr("StringVar"));
DLL import code
<DllImport(uCalcDLL, CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="SetVariableValueDbl")> _
Private Sub SetVariableValueDbl__(ByVal ItemHandle As IntPtr,ByVal Value As Double)
End Sub
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="SetVariableValueDbl")]
protected static extern void SetVariableValueDbl_(IntPtr ItemHandle, double Value);
{DLLImport}procedure SetVariableValueDbl__(ItemHandle: System.Pointer;Value: Double); cdecl; external uCalcDLL name 'SetVariableValueDbl';
typedef void (* __SetVariableValueDbl)(void *ItemHandle, double Value);
[DllImport(uCalcLib, CharSet=CharSet::Ansi, CallingConvention=CallingConvention::Cdecl, EntryPoint = "SetVariableValueDbl")]
static void SetVariableValueDbl_(void * ItemHandle, double Value);