program arguments in module constructor?

Johan Granberg lijat.meREM at OVEgmail.com
Tue May 16 11:02:51 PDT 2006


Can this bee done?

//file.d
static this()
{
	char[][] args=getArgs();//
	someFunk(args);
}

void main(char[][] args)
{
	runProgram();
}
//end of file

Basically i want to access the args argument passed to main before main 
is called. I think that when we have module constructors we should bee 
able to do this (if we already can pleas tell me).

(The problem i try to solve is working around the SDLmain hack to 
initialize SDL in the module constructor of my library so that when main 
is called the SDL will already bee initialized)

Thanks in advance.



More information about the Digitalmars-d mailing list