Difference between revisions of "Xojo.Core.MemoryBlock.Constructor(size As UInteger)"

From Xojo Documentation

(Created page with "{{ConstructorBox | name=Constructor | owner=Xojo.Core.MemoryBlock | ownertype=class | scope=public | parameters=size As UInteger }} {{Description | text = Creates a Me...")
 
 
Line 24: Line 24:
 
Reserve 1K:
 
Reserve 1K:
 
<rbcode>
 
<rbcode>
Dim mb As New Xojo.Core.MemoryBlock(1024) // Reserve 1K bytes
+
Var mb As New Xojo.Core.MemoryBlock(1024) // Reserve 1K bytes
 
</rbcode>
 
</rbcode>

Latest revision as of 17:29, 11 August 2019

Constructor

Xojo.Core.MemoryBlock.Constructor(size As UInteger)

Creates a MemoryBlock with the desired size in bytes.

Parameters

Parameter Description
size The size (in bytes) of the MemoryBlock to create. Size is either a 32-bit or 64-bit unsigned integer depending on the OS.

Exceptions

  • OutOfMemoryException if there is insufficient memory to allocate size bytes and there is sufficient memory to recover from this error.

Sample Code

Reserve 1K:

Var mb As New Xojo.Core.MemoryBlock(1024) // Reserve 1K bytes