[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Record question

Posted on 2004-11-10
4
Medium Priority
?
411 Views
Last Modified: 2011-09-20
Example:

Type
  TFruit = Record

     Apple : Boolean;
    Orange : Boolean;
    Selected : String[255];

End;

Type

   TTest = Record

    Number : Integer;
    TestVal  : Boolean;
    FruitRec : TFruit;
end;

Question:

I can fill the TFruit record with FillChar with no problem but....

How can i clear TTest.FruitRec using FillChar(??, ??, #0)

0
Comment
Question by:mantra246
  • 3
4 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12546195
What's wrong with   FillChar(Test.FruitRec, SizeOf(TFruit), 0);
0
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 500 total points
ID: 12546210
You can also do a

var
  BlankFruit: TFruitRec;

FillChar(BlankFruit, SizeOf(TFruit), 0);

and then at a later stage:

Test.FruitRec := BlankFruit;
0
 

Author Comment

by:mantra246
ID: 12546368
oops, forgot to assign the record!  Your example allowed me to spot where i went wrong - guess i need more coffee!



Thanks
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12546449
No probs, glad it help! ;-)
0

Featured Post

Technology Partners: 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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

872 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