Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write to a file?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Trying to get to reports combined into one. Right now the reports are shown by this set of operations below: completelistform.caption := 'Waste Water Not Completes';
testnum := 8;
beginlist;
Each testnum corilates to a certain batch and Customer Number. What I need to do is combined all 9 tests into one sheet. I know it has to be done by writing to a file but I am not sure how to do that in Delphi 5. So what would happen is when a button is selected it writes all the tets 1 thru 9 to a file and then displays that file to the user. Any suggestions would be greatly appreciated.
 
Your description is a little vague, however, keep in mind that many VCL classes have writeToFile as well as other streaming methods.

For example, consider the humble string list:

with tStringlist.create do
try
add( 'Item 1' );
add( 'Item 2' );
add( 'Item 3' );
saveToFile( 'c:\xyzzy.txt' );
finally
free;
end; // with/try

This creates a text file containing the three items. You can open this up in Notepad or whatever.

And that's only one approach available; there are many, many others. For example, look at the onNeedData events in the QuickReport components.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top