Solved

create a var in a unit and free again  using begin end block

Posted on 2009-05-17
2
226 Views
Last Modified: 2012-05-07
I know there is a solution to create a var and init at program start and free adain at close/ terminiate event  with some lines of code between the begin end block of a unit
0
Comment
Question by:BdLm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 250 total points
ID: 24407651
something like this ?


unit uTest;
 
interface
 
uses Classes;
 
procedure AddTest(aText: string);
procedure DelTest(aText: string);
 
implementation
 
var mList: TStrings;
 
procedure AddTest(aText: string);
begin
  mList.Add(aText);
end;
 
procedure DelTest(aText: string);
begin
  mList.Delete(mList.IndexOf(aText));
end;
 
initialization
  mList := TStringList.Create;
finalization
  FreeAndNil(mList);
end.

Open in new window

0
 
LVL 8

Author Closing Comment

by:BdLm
ID: 31582417
thanks I forgot this one ,
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question