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 6073159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:14:25+00:00 2026-05-23T10:14:25+00:00

I am new to Delphi Prism and been testing it out. When I hear

  • 0

I am new to Delphi Prism and been testing it out. When I hear and read programmers bad mouthing Delphi Prism for .NET, now I feel their pain. My God, I am having trouble with writing a simple code to create a binary or textfile and to write into them.

Here is the code:

Assignfile(f,"c:\Test.txt");
Rewrite(f,1);
BlockWrite(f,x,sizeof(x));
closefile(f);

I keep getting “unknown identifier” error messages for all the commands.

How do you write this code for Delphi Prism? I think, I am not including the right namespace or headerfile, but what is that.

Thank you in advance.

  • 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-23T10:14:25+00:00Added an answer on May 23, 2026 at 10:14 am

    You’re trying to use delphi RTL/VCL functions, but they are not available in .NET.

    Yous should use the FileStream class from System.IO. This is an example

    var buffer: array of byte := new byte[500]; // creates a 500 byte large buffer
    // fill your buffer
    
    using fileStream := File.Create('c:\temp\MyTest.txt') do begin
        fileStream.Write(buffer, 0, buffer.Length);
    end;
    

    In addition to that, there are XmlWriter, XmlTextWriter and TextWriter classes (and others) available in the .NET framework that help alot when handling streams. So if you like to write text, you can use the TextWriter class to easily write to the stream.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Delphi, and I've been running some tests to see what object
I'm very new to Delphi and received the following piece of code (left out
So far I have been suggesting new features to http://delphi.uservoice.com Since it is managed
I am using SerialPort under Delphi Prism. I am able to send bytes out
A new article about DataSnap in Delphi XE explains that DataSnap now is able
How to improve our productivity when starting new project using Delphi? For me, I
I found a great explanation about the new RTTI in Delphi ,but I don't
Delphi 2010 has a nice set of new file access functions in IOUtils.pas (I
On Delphi 2009, on a new VCL project: procedure TForm1.FormCreate(Sender: TObject); var Handle: THandle;
The Exception class in Delphi 2009 received a number of new features. A number

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.