Reference Manual - Table of Contents

Execution Control
Forms and Windows
Controls
Menus
System and Desktop
Graphic Drawing Commands

Animation
QuickTime Movies
Speech
Sound
File I/O
Printing
Serial Ports

Math Functions
String Functions
Date and Time
Memory Buffers
Error Handling
Console Text Window

Events

Direct Memory Access
Direct Mouse Access
Direct Keyboard Access
Code Resource Modules

A - Runtime Error Messages
B - Compiler Error Messages

 

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.

MemResize var, size

This command will resize a previously allocated dynamic memory buffer.

 

MemFree BufferID

This command deallocates a dynamic memory buffer.

MemFill BufferID, StartLocation, NumOfBytes, FillValue

This command fills all or part dynamic memory buffer with a specified value.

MemInt BufferID, Location, Int

This command stores an integer value at a specified location in a dynamic memory buffer.

MemLong BufferID, Location, Long

This command stores an long value at a specified location in a dynamic memory buffer.

MemSingle BufferID, Location, Single

This command stores an single floating point value at a specified location in a dynamic memory buffer.

MemDouble BufferID, Location, Double

This command stores an double floating point value at a specified location in a dynamic memory buffer.

MemString BufferID, Location, text$

This command stores a text string at a specified location in a dynamic memory buffer.

var = MemInt( BufferID, Location )

This function retrieves an integer value from a specified location in a dynamic memory buffer.

var = MemLong( BufferID, Location )

This function retrieves a long value from a specified location in a dynamic memory buffer.

var = MemSingle( BufferID, Location )

This function retrieves a single floating point value from a specified location in a dynamic memory buffer.

var = MemDouble( BufferID, Location )

This function retrieves a double floating point value from a specified location in a dynamic memory buffer.

var$ = MemString( BufferID, Location, Length)

This function retrieves a text string from a specified location in a dynamic memory buffer.

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.