Board index » delphi » Standard 'open file'

Standard 'open file'

Hi, let's say i made a program that does the same as Windows Notepad.exe .
The standard extension of my file is .tco (unlike .txt)

How can you load the tco-file in my prog.
(I can make the opening automated, but the memo stays empty!!)

                   T.I.A      Steven

 

Re:Standard 'open file'


Paramstr(1) should contain the name of the file. Just use it to load the
file in when the program starts.

--

Woody

Quote
5T3V3N <steven.van.de.cr...@skynet.be> wrote in message

news:87jpl6$f6u$1@news0.skynet.be...
Hi, let's say i made a program that does the same as Windows Notepad.exe .
The standard extension of my file is .tco (unlike .txt)

How can you load the tco-file in my prog.
(I can make the opening automated, but the memo stays empty!!)

                   T.I.A      Steven

Re:Standard 'open file'


Quote
5T3V3N wrote:

> Hi, let's say i made a program that does the same as Windows Notepad.exe .
> The standard extension of my file is .tco (unlike .txt)

> How can you load the tco-file in my prog.
> (I can make the opening automated, but the memo stays empty!!)

>                    T.I.A      Steven

I am not sure if it is what you want, but if you have associated a file
extension with a program and you doubleclick on such a file the filename
is given to the program as parameter. Just check ParamStr to get the
parameter list.

Alex
--
** Pepsi Cola and animal protection **
**  http://www.pepsi{*word*76}bath.com/  **

Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Re:Standard 'open file'


Thanx for the help :)

      Steven

Re:Standard 'open file'


Yes thanx, but...

i still don't get it... i can get it done that when i click
'c:\textfile.tco' that
my program runs, but the memo stays empty...

if you think it should be done with ParamStr then plz explain...

              TIA              Steven

Re:Standard 'open file'


Quote
5T3V3N wrote:

> Yes thanx, but...

> i still don't get it... i can get it done that when i click
> 'c:\textfile.tco' that
> my program runs, but the memo stays empty...

> if you think it should be done with ParamStr then plz explain...

>               TIA              Steven

Of course you have to load the file given with parameter into to TMemo.

Memo1.Lines.LoadFromFile(ParamStr(1));

Alex
--
** Pepsi Cola and animal protection **
**  http://www.pepsi{*word*76}bath.com/  **

Author of the free Chatsystem PINO! || Website: http://www.alcomp.net
Available at http://pino.cjb.net    || Chat   : pinochat.dhs.org:8080

Re:Standard 'open file'


Thanx Alex,

          it works !!!!

                         Steven

Other Threads