?
Solved

writing field values to a file

Posted on 2003-03-19
2
Medium Priority
?
126 Views
Last Modified: 2010-04-04
Hi,

I want to write the field values of a table to a RichEdit.
So far it iterates through the table and writes only the last field - I guess it writes every next field over the previous one - I tried to write an end of line marker with Writeln thinking it would act like pressing the Enter key.. (pathetic, eh)
What should I do??
Thanks!
s.


procedure TmfStyler.ToolButton1Click(Sender: TObject);
f: TextFile;
begin
  AssignFile(f, 'c:\OldTerms.txt');
  Rewrite(f);
  with tbOldTerms do
    begin
      First;
      while not EOF do
        begin
        RichEdit2.Text := tbOldTerms.FieldValues['WordA'];
        Writeln(f);
        Next;
        end;
    end;
   CloseFile(f);
end;
0
Comment
Question by:syllvia
[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 1

Accepted Solution

by:
jbshumate earned 200 total points
ID: 8170945
you need to be working with the lines field.

RichEdit2.Lines.Append(tbOldTerms.FieldValues['WordA'];

text is a single property not an array and you are correct you are just overwriting it each time.
0
 

Author Comment

by:syllvia
ID: 8171021
Thanks!!
s.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 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