The _MEMNEW function allocates new memory and returns a _MEM memory block referring to it.
- memory_block = _MEMNEW(byte_size%%)
- The memory block value created holds the starting OFFSET, SIZE, TYPE and ELEMENTSIZE. If the SIZE is 0, the block was not created!
DIM m AS _MEM DIM f AS STRING * 5 m = _MEMNEW(5) 'create new memory block of 5 bytes a = 12345 _MEMPUT m, m.OFFSET, a _MEMGET m, m.OFFSET, b PRINT b c$ = "Doggy" _MEMPUT m, m.OFFSET, c$ _MEMGET m, m.OFFSET, d$ _MEMGET m, m.OFFSET, f e$ = _MEMGET(m, m.OFFSET, STRING * 5) PRINT "d$ = ";d$ PRINT "e$ = ";e$ PRINT "f = ";