QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The _MEMFILL statement converts a value to a specified type, then fills memory with that type including any non-whole remainder.

Syntax

_MEMFILL memoryBlock, memoryBlock.OFFSET, fillBytes, value [AS variableType]

Parameter(s)

Description

Example(s)

Filling array values quickly using FOR loops or a simple memory fill.


DIM a(100, 100) AS LONG
DIM b(100, 100) AS LONG

'filling array a with value 13
FOR i1 = 0 TO 100
    FOR i2 = 0 TO 100
        a(i1, i2) = 13
    NEXT
NEXT

'filling array b with value 13
DIM mema AS _MEM
mema = _MEM(b())
_MEMFILL mema, mema.OFFSET, mema.SIZE, 13 AS LONG
_MEMFREE mema 

See Also