No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
8 Posted Topics
This snippet shows how to open, read, write and close text files. This skeleton can be modified to handle any type of file, from untyped to text to typed files.
First question is: What version of Turbo Pascal? This could make a great difference. For instance, in ver 6 and earlier, the editor would only hold 64K of text, limiting the size of programs, and causing the need to break up code into sometimes non-intuitive chunks. Also, the order of …
[QUOTE=mpx10]hey can you please let me know how to get intouch with the tutor as i could do with a little help[/QUOTE] What is it you need to know? I've been doing Pascal / Delphi for 20 years. Maybe I can lend a hand.
If this is still an issue for you, the [B]Delphi Super Pages[/B] is a wonderful place to find all kinds of goodies, gizmos and components. There's shareware, freeware, and demos for all versions of Delphi from 1.0 to 2005. This is a great resource. Find it at: [URL]http://delphi.icm.edu.pl/[/URL] HTH Daaave
What is it, specifically, you need/want to know? Daaave
File I/O line-by-line (for text files) is fairly simple. Assign associates an external filename with a file variable. This is the first step in file I/O. After the Assign, all references to the file are made through the file variable. Reset opens a file for reading, preserving the contents and …
First, strings in Pascal are delimited with single quotes ('), not double quotes ("). Second, you can consolidate your [B]writeln[/B]s into one string from writeln(' ', 'Buzz', ' '); to writeln(' Buzz '); Finally, if you change the final write to writeln, change the width specifier to 5, change 'Buzz …
You could also neaten up the [B]if[/B]..[B]then[/B]..[B]else[/B]..[B]if[/B] ladder using a [B]case[/B], like this: [FONT=Courier New] [CODE] [B]for[/B] I := low( ftn ) [B]to[/B] high( ftn ) [B]do[/B] [B]begin[/B] [B]case[/B] ftn[I].age [B]of[/B] 0..5 : inc( Count[1] ); 6..11 : inc( Count[2] ); 12..18 : inc( Count[3] ); 19..35 : inc( Count[4] …
The End.
Daaave