ByteSizeMethod

Applies to:Fast Math Parser
Class:uCalc.DataType
Returns the size (in bytes) of one unit of data for this data type
Syntax
ByteSize()
Remarks
Example 1: Displaying the data type name and size of a variable

Dim MyVariable = uc.DefineVariable("MyVariable")
Console.WriteLine("MyVariable type: " + MyVariable.GetDataType().Name()) ' Returns "MyVariable type: double"
Console.WriteLine("MyVariable size: " + MyVariable.GetDataType().ByteSize()) ' Returns "MyVariable size: 8"

          

var MyVariable = uc.DefineVariable("MyVariable");
Console.WriteLine("MyVariable type: " + MyVariable.GetDataType().Name()); // Returns "MyVariable type: double";
Console.WriteLine("MyVariable size: " + MyVariable.GetDataType().ByteSize()); // Returns "MyVariable size: 8";

          

//var MyVariable = uc.DefineVariable('MyVariable');
      WriteLn('MyVariable type: ' + MyVariable.GetDataType().Name()); // Returns 'MyVariable type: double';
      WriteLn('MyVariable size: ' + MyVariable.GetDataType().ByteSize()); // Returns 'MyVariable size: 8';

          

auto MyVariable = uc.DefineVariable("MyVariable");
cout << "MyVariable type: " << MyVariable.GetDataType().Name() << endl; // Returns "MyVariable type: double";
cout << "MyVariable size: " << MyVariable.GetDataType().ByteSize() << endl; // Returns "MyVariable size: 8";

          

auto MyVariable = uc.DefineVariable("MyVariable");
Console::WriteLine("MyVariable type: " + MyVariable.GetDataType().Name()); // Returns "MyVariable type: double";
Console::WriteLine("MyVariable size: " + MyVariable.GetDataType().ByteSize()); // Returns "MyVariable size: 8";

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

Private Function ByteSize__(ByVal DataTypeHandle As IntPtr) As  Int32
End Function
            
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="ByteSize")]

protected static extern  Int32 ByteSize_(IntPtr DataTypeHandle);
            
{DLLImport}function ByteSize__(DataTypeHandle: System.Pointer):  Int32; cdecl; external uCalcDLL name 'ByteSize';

            
typedef  int32_t (* __ByteSize)(void *DataTypeHandle); 

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

static Int32 ByteSize_(void *  DataTypeHandle);
            
Prev | Next