Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6926933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:58:56+00:00 2026-05-27T10:58:56+00:00

Hello recently I replace TextFile with TFileStream . I never use it so I

  • 0

Hello recently I replace TextFile with TFileStream. I never use it so I have small problem with it.

  • How can I add someting to my file after I assign it to variable?
  • How can I read someting form that file?

I need defined line form that file so I was doing something like that:

var linia_klienta:array[0..30] of string;
AssignFile(tempPlik,'klienci.txt');
Reset(tempPlik);
i:=0;
While Not Eof(tempPlik) do
  begin
    Readln(tempPlik,linia_klient[i]);
    inc(i);
  end;
CloseFile(tempPlik);

Then when line two is needed I simply

edit1.text = linia_klienta[1];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:58:57+00:00Added an answer on May 27, 2026 at 10:58 am

    If you need to read a text file and access each line, try instead using a TStringList class with this class you can load a file, read the data (accesing each line using a index) and save the data back.

    something like this

    FText  : TStringList;
    i : integer;
    begin
     FText := TStringList.Create;
     try
      FText.LoadFromFile('C:\Foo\Foo.txt');
    
        //read the lines
        for i:=0 to FText.Count-1 do    
         ProcessLine(FText[i]);  //do something   
    
      //Add additional lines
      FText.Add('Adding a new line to the end');
      FText.Add('Adding a new line to the end');    
    
      //Save the data back
      FText.SaveToFile('C:\Foo\Foo.txt');
    
     finally
      FText.Free;
     end;
    
    end;
    
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently begun using Scala. I've written a DSL in it which can
Hello everybody I've recently asked this question and I've given up with the 'replace
Hello I have recently uploaded an application to the app store and it got
Hello I recently posted this question but very badly explained the problem, but i'll
Hello i have recently started using vim editor ( actually the plugin for netbeans
Hello I've recently added a weather widget for people to add to their site.
Hello fellow developers! Recently I've been playing with Rails 3.0 and after quite a
Recently, I have a try to build and run sample hello world program of
Hello i recently got a problem in my Asp. Net C# 4 application. I
Hello I have a question recently I seen more and more sites using #/pagename

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.