I'm using Delphi 1 16-bit to learn Pascal (don't laugh, it works fine, plus I can't afford a more recent version). I'm using a TList to hold object references for a simple address book. Each object is added to the TList like so:
DataList.Add(TAddrBookData.Create('Bob', '1 Mill St'));
Do I need to free the TAddrBookData objects myself? Or are they freed when TList.Free is run?
An object that is moving only because of the action of gravity is said to be free falling and its motion is described by Newton's second law of motion.
vf = g * t where g is the acceleration of gravity. The value for g on Earth is 9.8 m/s/s. The above equation can be used to calculate the velocity of the object after any given amount of time when dropped from rest.
Newton's First Law: Inertia Newton's first law states that every object will remain at rest or in uniform motion in a straight line unless compelled to change its state by the action of an external force.
As learned in an earlier unit, free fall is a special type of motion in which the only force acting upon an object is gravity.
You need to free them yourself. Later versions come with a TObjectList, which is like a TList except it will only accept objects and it has the option to take ownership and free them for you automatically when the list is freed. But I don't believe TObjectList existed in Delphi 1, so you'll have to take care of it manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With