SetVariableValueByPtrMethod

Applies to:Fast Math Parser
Class:uCalc.Item
Sets the value of a variable to a value who's Pointer is passed
Syntax
SetVariableValueByPtr(Value)
Parameters
Value
Pointer to the value that the variable will be set to
Returns
Nothing
Remarks
This lets you set the value of a variable by passing the Pointer to the value you want to set the variable to.
Example 1: Setting a variable value by pointer

Dim x = uc.DefineVariable("x = 123")
Dim y = uc.DefineVariable("y")

y.SetVariableValueByPtr(x.ValueAddr())

Console.WriteLine(uc.Eval("x")) ' Returns 123

          

var x = uc.DefineVariable("x = 123");
var y = uc.DefineVariable("y");

y.SetVariableValueByPtr(x.ValueAddr());

Console.WriteLine(uc.Eval("x")); // Returns 123;

          

//var x = uc.DefineVariable('x = 123');
//var y = uc.DefineVariable('y');

      y.SetVariableValueByPtr(x.ValueAddr());

      WriteLn(uc.Eval('x')); // Returns 123;

          

auto x = uc.DefineVariable("x = 123");
auto y = uc.DefineVariable("y");

y.SetVariableValueByPtr(x.ValueAddr());

cout << uc.Eval("x") << endl; // Returns 123;

          

auto x = uc.DefineVariable("x = 123");
auto y = uc.DefineVariable("y");

y.SetVariableValueByPtr(x.ValueAddr());

Console::WriteLine(uc.Eval("x")); // Returns 123;

          
DLL import code
<DllImport(uCalcDLL, CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="SetVariableValueByPtr")> _

Private Sub SetVariableValueByPtr__(ByVal ItemHandle As IntPtr,ByVal Value As IntPtr)
End Sub
            
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="SetVariableValueByPtr")]

protected static extern  void SetVariableValueByPtr_(IntPtr ItemHandle, IntPtr Value);
            
{DLLImport}procedure SetVariableValueByPtr__(ItemHandle: System.Pointer;Value: System.Pointer); cdecl; external uCalcDLL name 'SetVariableValueByPtr';

            
typedef  void (* __SetVariableValueByPtr)(void *ItemHandle, void * Value); 

            
[DllImport(uCalcLib, CharSet=CharSet::Ansi, CallingConvention=CallingConvention::Cdecl, EntryPoint = "SetVariableValueByPtr")]

static void SetVariableValueByPtr_(void *  ItemHandle, void *   Value);
            
See also
Prev | Next