Get option at command line

Just starting out? Need help? Post your questions and find answers here.
PBogger
New User
New User
Posts: 3
Joined: Mon Jan 09, 2012 3:06 pm

Get option at command line

Post by PBogger »

I would like to know if it is possible to get an option given at the command line for a GUI program. For example i would like to load different images depending on what the user provides when the executable is run. If

Code: Select all

myapp.exe bw
is given i want to load the images in Data/bw And if

Code: Select all

myapp.exe retro
is given i want to load the images in Data/retro. Any assistance would be greatly appreciated.

Sincerely,

PBogger
infratec
Always Here
Always Here
Posts: 7836
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Get option at command line

Post by infratec »

Hi,

and welcome PBogger :!:

Code: Select all

For i = 0 To CountProgramParameters() - 1
  Debug ProgramParameter(i)
Next i
Doesn't matter if it is a console or GUI program.

Bernd
Post Reply