We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


How do i get my (writen) Plain text editor to print at the command line?

hyper66 asked
Medium Priority
Last Modified: 2010-04-06
How do i get my (writen) Plain text editor to print at the command line, Like notepad when a mytexteditor.exe /p.???
Watch Question

You must say more what you need.
For parsing command line you have ParamCount and ParamStr - however what you need more ?
if the program can apear on the desktop when printing ? or he need to be hidden ?
To many results I getting whent trying to give you some answer ;)
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
nice to see you Matvey - too ;) do you log to the delphi.magsoft.com.pl ?
I have some problems with hackers because our start passwords is not very good ;(
please login and change the password - the rest can wait.

What do I have to do exactly? I'm not very in the middle of the business right now :(
hi Matvey.
the best way is to read the : http://delphi.magsoft.com.pl/board.shtml

hyper66 - sorry for this private comments.


How do i get this code into my for so that when i click on a text file it will load fine in my text editor, and when i use my text editor with the /p and text file my text editor will load and print that file.. the Print code you gave me works but i cannot get it to work in Form show with my other code to display text files when they are clicked.  

procedure TMain.FormShow(Sender: TObject);
F :Integer;
Filename: String;
if ParamCount >= 1 Then
Filename := '';
For F := 1 To ParamCount Do
Filename := Filename + ' ' + ParamStr(F);
 SaveDialog.FileName := Trim(Filename);
 Memo.Modified := False;
 Caption := 'My Text Editor - ' + '['+ ExtractFileName(Filename)

How do i insert that code into my other code the right way? and is my code for opening texts file right to begin with?


LoadFromFile won't work with some files as parameters, it just opens one file at a time. You are trying to post all the command line parameters to it.

I sugest something like:

If ParamCount = 1 then
else if (ParamStr(1)='/p') and ParamCount=2 then

-Add all the rest of the code if necesary.

Sorry for your english :), but if you could explain just a bit better... (if you still have problems)



I have it fixed now, I just was'nt thinking. Thank's :)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.