#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    1
    Rep Power
    0

    Exclamation Destroying created TLabels?!?


    Hi All,

    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.

    thnx alot,
    Josh.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    4
    Rep Power
    0
    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.
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    Originally Posted by Thunderbolt1003
    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.
    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:
    Do not call Destroy directly. Call Free instead. Free verifies that the component is not nil, and only then calls Destroy.
    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

IMN logo majestic logo threadwatch logo seochat tools logo