I'm surprised this compiles at all.

Ok, Does my program does not compile on your computer ?

You're mixing up manual allocation of memory on the heap for variables
such as arrays with compiler allocation of heap memory for ansistrings
(which are reference counted and deallocated automatically).

Yes  something  like that.  I'm  trying to  emulate  something  like  this:

VarLCad = array[0..2] of ansistring;
Begin
  LCad[0]:='01234';
  LCad[1]:='56789';
  LCad[2]:='11111';
  Writeln(LCad[2]);
End.

But using GetMem(LCad,4*3) for the array. (4 bytes for the ansistring pointer). This can be done with: TList. But I write these simple programs, to know how compiler works.









_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to