Task

Show how to explicitly allocate and deallocate blocks of memory in your language.

Show access to different types of memory (i.e., heap, stack, shared, foreign) if applicable.




 
Module Checkit {
      Buffer Clear Mem1 as Byte*12345
      Print Len(Mem1)
      Hex Mem1(0) ' print in Hex address of first element
      Print Mem1(Len(Mem1)-1)-Mem1(0)+1=12345
      Buffer Mem1 as Byte*20000  ' redim block
      Print Mem1(Len(Mem1)-1)-Mem1(0)+1=20000
      Try {
            Print Mem1(20000)  ' it is an error
      }
      Print Error$  ' return message: Buffer Locked, wrong use of pointer
}
Checkit 
 