WRITEMEM

Top  Previous  Next

Syntax

WRITEMEM(mptr as MEMORY,record as INT,var as POINTER)

Description

Writes one record to allocated memory.

Parameters

mptr - A MEMORY variable successfully initialized with ALLOCMEM or returned by an API function.

record - The ones based record number.

var - Variable to save into memory. Any built in or user defined type (UDT).

Return value

None

Remarks

See Also: READMEM, ALLOCMEM, FREEMEM

Example usage

DEF buffer as MEMORY
DEF num as INT
ALLOCMEM buffer,100,LEN(num)
FOR x = 1 to 100
    WRITEMEM buffer,x,x
NEXT x 
 
FOR x = 1 to 100
    READMEM buffer,x,num
    PRINT num
NEXT x 
 
FREEMEM buffer