• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 134
  • Last Modified:

Resetting Record Structure

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
kwang080897
Asked:
kwang080897
  • 3
  • 2
1 Solution
 
EpsylonCommented:
var rec: TSomeRecord;

ZeroMemory(@rec, sizeof(rec));
0
 
kwang080897Author Commented:
Hi Epsylon !!!!

Thanks !!

Just what i needed, please submit Answer

0
 
EpsylonCommented:
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
 
EpsylonCommented:
Thanks kwang, please grade me an 'A' for maximum points  (4 x 50)

Cheers,

Epsylon.
0
 
kwang080897Author Commented:
Your Wish is my command

Thanks again !!!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now