Recent

Author Topic: How to get command line parameters with all spaces?  (Read 207 times)

Milsa

  • Full Member
  • ***
  • Posts: 232
How to get command line parameters with all spaces?
« on: October 31, 2020, 09:11:53 am »
ParamStr(x) has problem with spaces in command line text. How can I get original text from command line with all characters?
I work with Lazarus 2.0.10, FPC 3.2.0, SVN 63526
This information is actual to: 1st Aug 2020

paweld

  • Full Member
  • ***
  • Posts: 248
Re: How to get command line parameters with all spaces?
« Reply #1 on: October 31, 2020, 09:18:07 am »
you must put the parameter in quote, eg:
application.exe "Parameter with spaces"
Best regards
paweld

Milsa

  • Full Member
  • ***
  • Posts: 232
Re: How to get command line parameters with all spaces?
« Reply #2 on: October 31, 2020, 10:06:28 am »
Yes, I have bad parameters in Total Commander for launch my application. Excuse me.

I have "%P%N" but correct is ""%P%N""
I work with Lazarus 2.0.10, FPC 3.2.0, SVN 63526
This information is actual to: 1st Aug 2020

MarkMLl

  • Hero Member
  • *****
  • Posts: 1449
Re: How to get command line parameters with all spaces?
« Reply #3 on: October 31, 2020, 10:25:39 am »
@Milsa: remember that this is something which is handled by the OS, not by FPC's ParamStr(), so you should have told us what you're using.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

 

TinyPortal © 2005-2018