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


Resetting  Record Structure

Posted on 1999-07-07
Medium Priority
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 ?

Question by:kwang080897
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
LVL 13

Expert Comment

ID: 1386949
var rec: TSomeRecord;

ZeroMemory(@rec, sizeof(rec));

Author Comment

ID: 1386950
Hi Epsylon !!!!

Thanks !!

Just what i needed, please submit Answer

LVL 13

Expert Comment

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.

LVL 13

Accepted Solution

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



Author Comment

ID: 1386953
Your Wish is my command

Thanks again !!!

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