Reference Manual - Table of Contents
Memory Buffers Visual MacStandardBasic allows you easily create dynamic memory buffers that can be used to store data.
Command Summary:
MemAlloc var, size
MemResize var, size
MemFree BufferID
MemFill BufferID, StartLocation, NumOfBytes, FillValue
MemInt BufferID, Location, Int
MemLong BufferID, Location, Long
MemSingle BufferID, Location, Single
MemDouble BufferID, Location, Double
MemString BufferID, Location, text$Function Summary:
var = MemInt( BufferID, Location )
var = MemLong( BufferID, Location )
var = MemSingle( BufferID, Location )
var = MemDouble( BufferID, Location )
var$ = MemString( BufferID, Location, Length)
var = MemSize( BufferID )
MemAlloc var, size
This command allocates a dynamic memory buffer.
var - This should be a numeric variable that will contain a value (BufferID) the should be used to reference the memory buffer being allocated. This variable will equals a -1 after this command is executed then the memory buffer could not be allocated.
size - This should be a numeric variable that indicates the size (in bytes) of the memory buffer to be allocated.
MemResize var, size
This command will resize a previously allocated dynamic memory buffer.
var - This should be a numeric variable that will contain a value (BufferID) the should be used to reference the memory buffer being allocated. This variable will equals a -1 after this command is executed then the memory buffer could not be allocated.
size - This should be a numeric variable that indicates the new size (in bytes) of the memory buffer.
MemFree BufferID
This command deallocates a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer being allocated.
MemFill BufferID, StartLocation, NumOfBytes, FillValue
This command fills all or part dynamic memory buffer with a specified value.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer being allocated.
StartLocation - This should be a numeric variable that represents the byte start location to begin the fill.
size - This should be a numeric variable that indicates the number of bytes of the memory buffer to be filled.
option - This is a numeric value that represents the byte fill value.
MemInt BufferID, Location, Int
This command stores an integer value at a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location to store the Int.
Int - This should be a numeric value that represents the integer that will be stored.
MemLong BufferID, Location, Long
This command stores an long value at a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location to store the Long.
Long - This should be a numeric value that represents the integer that will be stored.
MemSingle BufferID, Location, Single
This command stores an single floating point value at a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location to store the Single.
Single - This should be a numeric value that represents the integer that will be stored.
MemDouble BufferID, Location, Double
This command stores an double floating point value at a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location to store the Double
Double - This should be a numeric value that represents the double that will be stored.
MemString BufferID, Location, text$
This command stores a text string at a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location to store the String.
String - This should be a text expression that represents the string that will be stored.
var = MemInt( BufferID, Location )
This function retrieves an integer value from a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location.
var = MemLong( BufferID, Location )
This function retrieves a long value from a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location.
var = MemSingle( BufferID, Location )
This function retrieves a single floating point value from a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location.
var = MemDouble( BufferID, Location )
This function retrieves a double floating point value from a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location.
var$ = MemString( BufferID, Location, Length)
This function retrieves a text string from a specified location in a dynamic memory buffer.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.
Location - This should be a numeric value that represents the byte location.
Length - This should be a numeric value that represents the length of the string to retrieve.
var = MemSize( BufferID )
This function returns a value representing the size of an allocated memory buffer. A value of -1 will be returned if the buffer was not previously allocated with the MemAlloc command.
BufferID - This should be a value (BufferID) that is used to reference the memory buffer.