Hello together,
as I understand variables, they're nothing else than bytes. So I had that awsome idea to store any value into an array of bytes.
I created a class named "TValue" and it contains the array of byte named "value". This is how I store variables to the array of bytes: procedure TValue.store(const any);
begin
SetLength(self.value, 0);
SetLength(self.value, SizeOf(any));
Move(any, self.value, SizeOf(any));
end;
My function to convert this bytes back to an integer looks like this: function TValue.Integer: integer;
begin
Move(self.value, Result, SizeOf(value));
end;
But this doesn't work, I get "0" as output, whatever integer variable I use for "any"...
I actually do not know what I'm doing wrong, I would appreciate your help!
Thanks in advance and greetings,
bastla