Launch program with switch or "command tail"

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TerryHough.

In PureBasic is it possible to capture the "command tail" parameters passed to the program upon launch?

Example:
dotthis.exe /Q or
dotthis.exe type1 type2 type3

and then parse the "command tail" to determine the proper action of
the program?

Thanks,
Terry
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Hello Terry,

Look at RunProgram command, it should be what you are looking for ...

Rgrds

Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by ebs.

Terry,

Use the ProgramParameter() function to get each command line parameter, until it returns an empty string.

Eric

Originally posted by TerryHough

In PureBasic is it possible to capture the "command tail" parameters passed to the program upon launch?

Example:
dotthis.exe /Q or
dotthis.exe type1 type2 type3

and then parse the "command tail" to determine the proper action of
the program?

Thanks,
Terry

BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> In PureBasic is it possible to capture the "command tail"
> parameters passed to the program upon launch?

Yes, with the ProgramParameter command. See here for an example:

viewtopic.php?t=1893


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

...,

Sorry you are right PB ... this is ProgramParameter !

Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TerryHough.

Thanks guys!

It was right there under my nose the whole time. But my searches failed to find it. Just gotta look using the right word!

Many thanks
Terry
Post Reply