Thank you all very much for your replies. However, I didn't quite elaborate on what I'm trying to achieve.
I have a dynamic array for pointers to different properties/variables (like the aforementioned Width and Height). I then use that array to assign the properties/variables that I need by something like this:
PString(SomeArray[i])^ := 'Stuff';
The code doesn't have access to the original objects and may need to change different properties without referring to them from the objects. AFAIK, a TForm's
Width and
Height are properties too and the code worked flawlessly with them... But, well, I'm comparing an Integer with a TCaption (still though, why did it work?).
By the way, the passing as
var thing was a last resort attempt at making it work, I'd prefer doing it with pointers.