October 22nd, 2004, 06:30 PM
Destroying created TLabels?!?
I've recently made a blackjack game and to show the cards dealt i've created TLabels in runtime.
something like this..(codes at school)
Dealt[Counter].SuiteNo := create
Dealt[Counter].ValueNo := create ect..
Im trying to get the program to start a new game (without having to exit the application and go back into it) and im wondering what one would use to kill the TLabels created.
I've been reading about free and destroy but i'm unsure how to practically deploy these, a simple example would be FANTASTIC please.
October 22nd, 2004, 10:12 PM
Free is used to stop things. e.g. Stop a timer,
Destroy is used to remove things from memory.
Try creating a new program with a few labels or make a duplicate of your current program and play around with the two methods and see what results you get.
October 23rd, 2004, 04:01 PM
This is a big load of bollocks. Free isn't used to stop things, it also deallocates them. Never call Destroy to destroy a component yourself. Always call Free, since it calls Destroy internally. This is not just me spewing off stuff, this is what the Help Documentation says for Destroy:
Originally Posted by Thunderbolt1003
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo