Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

MemoryBlockMBS.Close
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 5.3 Yes Yes Yes Yes No
Function: The destructor.
Notes:
There is no need to call this method except you want to free all resources of this object now without waiting for Realbasic to do it for you.
(e.g. some Realbasic versions crash on Windows if there are plugin objects not closed.)

Feedback, Comments & Corrections

MemoryBlockMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 16.1 Yes Yes Yes Yes No
Function: The constructor.
Notes: This constructor does nothing, so you can call Create yourself.

See also:

Feedback, Comments & Corrections

MemoryBlockMBS.Constructor(Mem as MemoryBlock)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 16.1 Yes Yes Yes Yes No
Function: Creates a new MemoryBlockMBS with content of memoryblock.
Example:
dim s as string = "Hello World"
dim m as MemoryBlock = s

dim x as new MemoryBlockMBS(m)

MsgBox str(x.Size)
Notes: Raises exception is size is invalid or no memory is available.

See also:

Feedback, Comments & Corrections

MemoryBlockMBS.Constructor(Mem as MemoryBlock, Size as Int64, Offset as Int64 = 0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 16.1 Yes Yes Yes Yes No
Function: Creates a new MemoryBlockMBS with given size and copies content of memoryblock.
Example:
dim s as string = "Hello World"
dim m as MemoryBlock = s

dim x as new MemoryBlockMBS(m, 9)

MsgBox str(x.Size)
Notes: Raises exception is size is invalid or no memory is available.

See also:

Feedback, Comments & Corrections

MemoryBlockMBS.Constructor(Size as Int64)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 16.1 Yes Yes Yes Yes No
Function: Creates a new MemoryBlockMBS with given size.
Notes: Raises exception is size is invalid or no memory is available.

See also:

Feedback, Comments & Corrections

MemoryBlockMBS.Constructor(Str as String)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 16.1 Yes Yes Yes Yes No
Function: Creates a new MemoryBlockMBS with content of string.
Example:
dim s as string = "Hello World"
dim x as new MemoryBlockMBS(s)

MsgBox str(x.Size)
Notes:
Text encoding is ignored and bytes copied as they are.
Raises exception is size is invalid or no memory is available.

See also:

Feedback, Comments & Corrections

MemoryBlockMBS.Constructor(Str as String, Size as Int64, Offset as Int64 = 0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 16.1 Yes Yes Yes Yes No
Function: Creates a new MemoryBlockMBS with given size and copies content of string.
Example:
dim s as string = "Hello World"
dim x as new MemoryBlockMBS(s, 9)

MsgBox str(x.Size)
Notes:
Text encoding is ignored and bytes copied as they are.
Raises exception is size is invalid or no memory is available.

See also:

Feedback, Comments & Corrections

MemoryBlockMBS.Create(size as Int64) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method memoryBlock MBS Util Plugin 9.1 Yes Yes Yes Yes No
Function: Creates a new memoryblock.
Example:
dim m as MemoryBlockMBS
dim n as MemoryBlock
dim t as Integer

const size=2200000000

// RB: up to 1 GigaByte
// Plugin: up to 2 GigaByte - 1 Byte

m=New MemoryBlockMBS

t=ticks
if m.Create(size) then
n=m.Memory

MsgBox str(ticks-t)

end if

t=ticks
n=NewMemoryBlock(size)
if n<>nil then
MsgBox str(ticks-t)
end if
Notes:
Returns true on success and false on failure.
Size can be any positive value up to &h7FFFFFFF (=2^31-1).

Size became 64bit to avoid integer overflows.

Feedback, Comments & Corrections

MemoryBlockMBS.Resize(Size as Int64) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method MemoryBlock MBS Util Plugin 9.4 Yes Yes Yes Yes No
Function: Tries to resize the memorybock to the new size.
Example:
dim m as new MemoryBlockMBS

if m.Create(1000) then
MsgBox str(m.Size)

if m.Resize(2000) then
MsgBox str(m.Size)
end if
end if
Notes:
Returns true on success.
If false is returned, the memoryblockMBS is not touched.

If the new size is smaller, data is lost as the memoryblock is cut.
If the new size is bigger, the memoryblock is resized. Or if that does not work, a new memoryblock is created and data is copied. New bytes will be zero.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS Xojo PDF Plugins