K
K
Korvin32015-01-29 16:08:18
Programming
Korvin3, 2015-01-29 16:08:18

Text editor in Pascal ABC.NET, opening a file with a program from explorer?

So, there is a simple homemade text editor in Pascal ABC .Net. He knows how to open and save files through dialog boxes in the program itself. Question: how to make it so that when opening a text file through the explorer (open with help -> "my editor"), it immediately opens and displays text in the text box? It just starts up for me and I need to open the file through a dialog box. Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SagePtr, 2015-01-29
@Korvin3

Look towards the functions ParamCount and ParamStr

A
AlterFun, 2016-11-16
@AlterFun

Hold on, buddy:
//Let's look at the command line arguments
//If their number = 1, then open
if CommandLineArgs.Length = 1 then
OpenFile(CommandLineArgs[0]);
where openfile(filename:string) is a procedure that opens both a file and reads data from it, filename is the full path to the file. CommandLineArgs[0]-argument (path to the file) that the OS gives us.
That's it. And there, work with textbox, as you know. I'm now doing a text editor myself for a fan of Pascal abs, it's already almost the level of a full-fledged notepad and higher.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question