PDA

View Full Version : Delphi Dilemna



01-05-2002, 12:27 PM
I'm restructuring an application in Delphi 5. In the variables, test is a type file and name is a type string. name holds the address of a file, which I want to load into test. How do I do this?

01-05-2002, 01:46 PM
Check out this webpage:

delphi.about.com

its a great starting place to go if you are unfamiliar with delphi. if you can't find what you're looking for, i think this page might be a help.

http://delphi.about.com/library/weekly/aa110999.htm


Regards,
Mark.

01-05-2002, 01:53 PM
One thing you will have to check:

is the string type wide enough to hold all the data in your file?

the string type is, of course, designed to hold strings not the contents of large files.

from memory a string in delphi can hold 2^30 characters (2 with 30 zero's after it) any longer and you may have problems.

Mark.

01-05-2002, 04:18 PM
In Pascal, I would just say:
'assign(test, name)', then open it for read or write. Delphi seems to want something like 'test := FileOpen(name, fmOpenRead)' Then it gets worse. All too clever for me.