1 '' dynamic memory allocation example 2 3 '' Allocate a chunk of memory of a certain size, measured in bytes 4 dim as integer buffersize = 1024 * 8 5 dim as byte ptr buffer = allocate( buffersize ) 6 7 '' Do something with the buffer 8 for i as integer = 0 to buffersize - 1 9 buffer[i] = 123 10 next 11 12 '' Free up the allocated chunk after we're done using it 13 deallocate( buffer ) 14 15 '' ------------------ 16 17 type MyType 18 x as integer 19 y as integer 20 end type 21 22 dim pmytype as MyType ptr 23 24 pmytype = allocate( sizeof( MyType ) ) 25 26 pmytype->x = 1234 27 pmytype->y = 5678 28 29 print pmytype->x, pmytype->y 30 31 deallocate( pmytype ) 32 33 sleep