SetVariableValuePtrMethod

Applies to:Fast Math Parser
Class:uCalc.Item
Sets the value of a Pointer variable
Syntax
SetVariableValuePtr(Value)
Parameters
Value
Pointer that the variable will be set to
Returns
Nothing
Remarks
This lets you set the value of a Pointer variable defined with DefineVariable (or Define) . Note: This does not change the Pointer of the variable. It simply stores a Pointer value in the variable.
Example 1: Playing with pointers

Dim x = uc.DefineVariable("x As Int16 = -1")
Dim MyPointer = uc.DefineVariable("xPtr As Pointer")

MyPointer.SetVariableValuePtr(x.ValueAddr())
Console.WriteLine(uc.EvalStr("ValueAt(Int16u, xPtr)")) ' Returns 65535

          

var x = uc.DefineVariable("x As Int16 = -1");
var MyPointer = uc.DefineVariable("xPtr As Pointer");

MyPointer.SetVariableValuePtr(x.ValueAddr());
Console.WriteLine(uc.EvalStr("ValueAt(Int16u, xPtr)")); // Returns 65535;

          

//var x = uc.DefineVariable('x As Int16 = -1');
//var MyPointer = uc.DefineVariable('xPtr As Pointer');

      MyPointer.SetVariableValuePtr(x.ValueAddr());
      WriteLn(uc.EvalStr('ValueAt(Int16u, xPtr)')); // Returns 65535;

          

auto x = uc.DefineVariable("x As Int16 = -1");
auto MyPointer = uc.DefineVariable("xPtr As Pointer");

MyPointer.SetVariableValuePtr(x.ValueAddr());
cout << uc.EvalStr("ValueAt(Int16u, xPtr)") << endl; // Returns 65535;

          

auto x = uc.DefineVariable("x As Int16 = -1");
auto MyPointer = uc.DefineVariable("xPtr As Pointer");

MyPointer.SetVariableValuePtr(x.ValueAddr());
Console::WriteLine(uc.EvalStr("ValueAt(Int16u, xPtr)")); // Returns 65535;

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

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

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

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

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

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