Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-11

move problem

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ryan Joseph

I was just trying to run some old code and found that my calls to Move are crashing (3.1.1/ppcx64) so I tried to make this simple example and it’s crashing also. Also for some reason I can’t use @i as the first parameter of Move and MemSize on “dest” returns 24 instead of 4. What’s going on here???

var
	i: integer;
	dest: pointer;
	src: pointer;
dest := GetMem(sizeof(i));
i := 100;
src := @i;
Move(src, dest, sizeof(i));
writeln(PInteger(block)^);

Regards,
Ryan Joseph

Reply by email

Adriaan van Os
to Ryan Joseph
Ryan Joseph wrote
I was just trying to run some old code and found that my calls to Move are crashing (3.1.1/ppcx64) so I tried to make this simple example and it’s crashing also. Also for some reason I can’t use @i as the first parameter of Move and MemSize on “dest” returns 24 instead of 4. What’s going on here???

What's going on, is that you didn't read what the Unit Reference Guide says about Move. It is not like BlockMoveData on the Mac and it doesn't expect pointers as parameter.

Regards,

Adriaan van Os

Reply by email

Ryan Joseph
to Adriaan van Os
On Nov 3, 2017, at 11:04 AM, Adriaan van Os wrote: What's going on, is that you didn't read what the Unit Reference Guide says about Move. It is not like BlockMoveData on the Mac and it doesn't expect pointers as parameter.

ah I see now I got confused by something else and got derailed. Thanks.

Regards,
Ryan Joseph

Reply by email