MakeBuff

(Engine-Level Function)

Description: Creates a buffer and returns its address.
Returns: Address
Usage: Script or steady state.
Function Groups: String and Buffer
Related to: BuffOrder | BuffRead | BuffStream | BuffToArray | BuffToParm | BuffToPointer | BuffWrite |
Format: MakeBuff(Length, Value)
Parameters:  
Length
Required. Any numeric expression giving the length (number of bytes) of the buffer to create. This value must be between 0 and 0x7FFFFFFF.
Value
Required. Any numeric expression giving the initial value from the ASCII Character Set for every byte in the new buffer (see "ASCII Character Set"). It must be in the range 0 to 255.
Comments: This function can be used to create buffers for BuffWrite or similar functions that require an existing buffer. The return value is an address to a buffer of Length bytes, with each byte equal to Value. If the two parameters are integer constants and the buffer length is no more than 256 bytes, the compiler will convert this statement internally to a constant text string for speed at execution time.

The maximum buffer size is 0x7FFFFFFF (2, 147,483,648) characters. Any size larger than this will result in an invalid value.

Example:

buff1 = MakeBuff(5, 0x41);

This will cause buff1 to be assigned the address where the value "AAAAA" is stored.