Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / command line arguments

Author
Message
matt rochon
19
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 19th Jul 2005 07:45
how do i get the command line arguments?

dbCl$() doesnt seem to be doing anything
Sephnroth
20
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 19th Jul 2005 08:16
I discovered this too whilst writing my puzzle competition entry. I had to write my own command line parser. It parses it into the standard c/c++ argc/argv format so after parsing it I pass it to a fake main() function just because i feel more comfortable and it looks more "right" - you can completly skip that function if you wish though My game only needed a quick simple read of the arguments, you may wish to make the code in my davemain() function a bit more complex. and you might wish to change the name anyway this will parse the command line directly:



obviously davemain() needs to be prototyped. put your parsing into davemain() to whatever degreeyou need, works just like a normal main() entry point. Start the process by calling CommandGrab() at the start of the DarkSDK() function somewhere.

Hope thats usful

matt rochon
19
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 19th Jul 2005 08:19
sweet dude, thanks for that, I have a nice class for command line parsing if you want, works like a hashmap
matt rochon
19
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 19th Jul 2005 08:28
here i put it in an h file, just include this file in your program instead of darksdk.h and write your main function

all credit goes to sephnroth

Sephnroth
20
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 19th Jul 2005 08:47
nice work mate Glad it was usful ^^

Login to post a reply

Server time is: 2023-02-06 20:44:53
Your offset time is: 2023-02-06 20:44:53