In a C/C++ program you'd define the main function as:
Code: Select all
long main(unsigned long hInstance, unsigned long hPrevInst, char *lpszCmdLine, long nCmdShow)
to have access to the parameters Windows passes to the program, since PureBasic doesn't use a main function, it would be nice if these parameters were exposed as predefined constants so we could have access to them as well if needed.
Another way would be to allow us to define our own main function, like this:
Code: Select all
Procedure.l main(hInstance.l, hPrevInst.l, lpszCmdLine.s, nCmdShow.l)
PureBasic would behave normaly, but if you define this main function, PureBasic's startup code would call it instead of the first line of code outside any procedures.