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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open file

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
hello again,

Thanks for answers to my string question, but they all assumed that I know the filename, and unfortunately, I don't!

How do I open the "Open File" Dialog box and allow the user to select the file?

Thanks!

Leslie
 
Ok, I have found the help for open dialog and pasted the code directly from the help (below) into my code, but when I try to run it, NOTHING HAPPENS!!!

var

F: TextFile;
S: string;
begin
if OpenDialog1.Execute then { Display Open dialog box }
begin
AssignFile(F, OpenDialog1.FileName);
Reset(F);
Readln(F, S); { Read first line of file }
CloseFile(F);
end;
end;

I don't understand! What am I doing wrong?

Thanks,

Leslie
 
Ok, I guess I'm just a doofus! For some reason it's working now, even though I didn't do ANYTHING!!

Thanks!
 
The context of the file should be in S Steven van Els
SAvanEls@cq-link.sr
 
Yep - the code you posted should read a line of text as far as I can see. I was actually drawn to this post by your "handle" of "lespaul" as it reminds me of my guitar (I have a Les Paul :).) Anyway - hope you got your problem sorted.

Opp.
 
Hi sggaunt -

Er.. Well I bought it around 1978/9 I think so.. quite old I guess. At some point Im going to get round to getting it serviced (has not been out of the case in about 10 years and I noticed I have a couple control knobs missing.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top