Recent

Author Topic: The separator in the command line  (Read 2687 times)

jamie

  • Hero Member
  • *****
  • Posts: 6734
Re: The separator in the command line
« Reply #15 on: July 23, 2024, 10:42:39 pm »
Hmm
if you want the raw string so you can process your self..

CmdLine

Its a PChar pointer btw.

From there, you can use whatever code you wish.

The only true wisdom is knowing you know nothing

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: The separator in the command line
« Reply #16 on: July 23, 2024, 11:10:06 pm »
Hmm
if you want the raw string so you can process your self..

CmdLine

Its a PChar pointer btw.
AFAIK Nope. At least not on Linux.

cmdline uses get_cmdline which calls setupcmdline which uses argv and argc and explicitly uses the hardcoded space character to construct the pchar.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

jamie

  • Hero Member
  • *****
  • Posts: 6734
Re: The separator in the command line
« Reply #17 on: July 24, 2024, 12:05:49 am »
Not all operating systems are perfect.  :D
The only true wisdom is knowing you know nothing

TRon

  • Hero Member
  • *****
  • Posts: 3623
Re: The separator in the command line
« Reply #18 on: July 24, 2024, 12:12:01 am »
Not all operating systems are perfect.  :D
:P

But yeah not everything is 100% exactly the same.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

jamie

  • Hero Member
  • *****
  • Posts: 6734
Re: The separator in the command line
« Reply #19 on: July 24, 2024, 12:19:15 am »
The trick is to mask it so that it looks like a single parameter and then break it down in the app.
The only true wisdom is knowing you know nothing

DEN1983

  • New member
  • *
  • Posts: 8
Re: The separator in the command line
« Reply #20 on: July 24, 2024, 05:07:58 am »
Hmm
if you want the raw string so you can process your self..

CmdLine

Its a PChar pointer btw.

From there, you can use whatever code you wish.
That's great!
Handsome!
This is what you need!

I love freepascal and lazarus:
Code: Pascal  [Select][+][-]
  1. ListStrings1.adddelimitedtext(CmdLine,'\',true);
  2.  
this code works 100%% !!!

Thaddy

  • Hero Member
  • *****
  • Posts: 16154
  • Censorship about opinions does not belong here.
Re: The separator in the command line
« Reply #21 on: July 24, 2024, 10:12:57 am »
I told you so..
https://forum.lazarus.freepascal.org/index.php/topic,67932.msg524009.html#msg524009

But indeed, as long as you know the command line is inherently a PChar  - in most OS's, not all - you are free to manipulate  it by hand...
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018