Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resetting  Record Structure

Posted on 1999-07-07
5
Medium Priority
?
133 Views
Last Modified: 2010-04-06
I Have these big Record Structures in my app. Is there any way to Reset all the Variables whithout having to adress them directly ?








0
Comment
Question by:kwang080897
[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
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 1386949
var rec: TSomeRecord;

ZeroMemory(@rec, sizeof(rec));
0
 

Author Comment

by:kwang080897
ID: 1386950
Hi Epsylon !!!!

Thanks !!

Just what i needed, please submit Answer

0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1386951
To erase an array of records:


a: array[0..9] of TSomeRecord;

ZeroMemory(@a, sizeof(a));


Beware that when a record contains pointers, only the pointer will be zero-ed. If those pointers refer to allocated memory blocks, you will have a memory leak.


0
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 1386952
Thanks kwang, please grade me an 'A' for maximum points  (4 x 50)

Cheers,

Epsylon.
0
 

Author Comment

by:kwang080897
ID: 1386953
Your Wish is my command

Thanks again !!!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

721 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