Recent

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

Milsa

  • Sr. Member
  • ****
  • Posts: 309
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.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

paweld

  • Hero Member
  • *****
  • Posts: 970
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 / Pozdrawiam
paweld

Milsa

  • Sr. Member
  • ****
  • Posts: 309
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.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018