IonicWind Software

Creative Basic => Console Programs => Topic started by: tekrat on September 28, 2007, 03:05:25 PM

Title: Accepting Command Line Arguments?
Post by: tekrat on September 28, 2007, 03:05:25 PM
Hey all,

I can't find in the documentation how to accept a command line argument. What I mean is something like this:

  myProgram.exe -this -that

All I want to do is have a file load when click on it that I've associate with a filetype (like .txt).

Many thanks in advance!
Title: Re: Accepting Command Line Arguments?
Post by: Johnny on September 29, 2007, 02:18:26 PM
Hello to all,

Once I was also looking for the same feature, and found a solution in an API call.
With this sample code you can get the whole commandline, then you have to separate the things you want from it...

With kind regards,
Johnny

PS: Allways enjoying all your posts!
And I'm an absolute fan of Paul's fantastic software!!!   :)

DECLARE "kernel32",Sleep(dwMilliseconds:INT)
DECLARE "kernel32",GetCommandLineA(),STRING
DEF TempString : STRING
OPENCONSOLE

TempString = GetCommandLineA():'Get the Command Line String
Print TempString
Print

Print "Press the Any Key to close this window"
DO
    Sleep(100):'Just to prevent keeping the processor busy for 100%...with doing nothing...
UNTIL INKEY$ <> ""
CLOSECONSOLE
END