Pointer to pointer and NewHandle function in (Think) Pascal -


what purpose in pascal declare variable pointer pointer? have code in mac think pascal. here parts code don't understand:

type    my_array = array[1..100] of integer;       my_array_pointer = ^my_array;    my_array_handle = ^my_array_pointer;    ... var     xx : my_array_handle;     ... begin    xx:= my_array_handle(newhandle( sizeof(my_array)) ); 

as see, last line assignment of type my_array_handle variable xx. mean? newhandle function do? (this internal function of think pascal). actually, need convert think pascal program windows pascal. cannot find description of newhandle function, , don't know how implement function using standard (new(), getmem() etc) pointer functions.

this classic macos feature, not typically of pascal.

i don't know exactly, had relocatability of loaded program in non pm environment.

note indirect pointer allocated via os function, means allocated in table maintained os. (so os can move/relocate program?)

in modern mac (and other) programming whole principle alien. clean up.

(added) if want keep these redirections, try luck like:

     function newhandle( nrbytes:integer):ppointer;      var xx : ppointer;      begin         new(xx);         getmem(xx^,nrbytes);         newhandle:=xx;      end; 

i didn't add originally, recommend clean up these anachronistic indirect references , use my_array_pointer based pointers , getmem or new directly.

the meaning of these indirect references has no use on non m68k classic mac os systems, though afaik later ppc versions still support them. (ppc protected mode)

if want gritty details, want subscribe mac-pascal list.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -