[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Extracting a user defined file from a  resource file

Posted on 1998-12-01
3
Medium Priority
?
133 Views
Last Modified: 2010-04-04
I have compiled a few Text-Based files into a resource file and I would like to be able to save them to file, before executing another windows app to read them and produce the required report. How can I save them to disk ...
0
Comment
Question by:taskforce
[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
3 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1348742
By code or manually?

Use TFileStream, or AssignFile, ...

Zif.
0
 

Author Comment

by:taskforce
ID: 1348743
The dilema : I have text based files that I want to use at some point. I have compiled these into my EXE file as a resource. I now need to know how to programatically extract these before I can use them. i.e. SaveToFile('TextFile.Txt')
0
 
LVL 3

Accepted Solution

by:
williams2 earned 200 total points
ID: 1348744
Hmm.. Dear TaskForce, you are not good at asking questions. Do you need to save the file from within your application, then the easiest way to do it is like:

var
  SL: TStringList;
Begin
  SL:= TStringList.Create;
  //.. Add some strings ...
  SL.SaveToFile(Filename.TXT);
  SL.free;
End;

or do you want to extract the text from your ressource file? in that case you should use TRessourceStream to first load the .exe file with the .LoadFromFile method, and then identify the ressource type you are looking for.

/Williams
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

649 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