bdelete

bdelete — deletes a number of bytes from a buffer.

Syntax

bdelete (buffer, position, length?)

		

Arguments

buffer

A buffer.

position

The position of the first byte to delete. A number between 0 and the length of the buffer minus 1.

length

An optional number of bytes to delete. The default is 1. A negative number deletes all bytes to the end. A value of 0 does nothing.

Returns

The number contained at the specified position in the buffer, or nil if the buffer is undefined at the given position.

Description

This function deletes a specified number of bytes from a raw memory buffer. The buffer length does not change as a result of this function. A zero character is placed at the empty position at the end of the buffer, then the buffer is collapsed.

Example

Gamma> y = buffer (101, 102, 103, 104);
#{efgh}
Gamma> bdelete(y,1,2);
102
Gamma> y;
#{eh\0h}
Gamma> 
		

See Also

delete