Re: Euphoria file types
- Posted by jimcbrown (admin) Mar 07, 2009
- 1345 views
I fully agree with the ideas you have put forward for the extensions and the reasons for them. Non MS OSes have only one interpreter so they fortunately don't need to worry about extensions. I think the Non-MS OSes work like exwc instead of exw.
Why do we have both an exw and exwc? Why not just have an option for when you want the interpreter to create a new console instead?
Windows stupidity. The PE header has a stub that specifies whether it is an app that uses the console subsystem or the gui subsystem. You can't switch between the two dynamically, it has to be choosen at load time. (It is possible to achieve this by writing your own stub. This is low level enough that you can't use the C library to help you here.)
A console subsystem app can't tell if it was started from another console or if it was given a brand new one. It just sees a console, and thats it. A gui subsystem app can't tell if it was started from a console or not. It just sees no console, and will have to create a new one using AllocConsole().
To be perfectly clear:
There is no way to start a console subsystem app without a console. If its not given one to share by the parent, it creates a new one. Whether you want it to or not.
There is no way to share the parent process's console with a gui subsystem app. If it wants a console, it has to make a new one. (XP and later can use AttachConsole() but this has its own disadvantages, such as having to deal with two apps reading the console input simulatenously.)
exwc foo.ex ( runs in the current console like ) exwc -nc foo.ex ( could be made to creates a new console )
I think exwc -nc could be made to work, by having it be a console subsystem app but then call FreeConsole() to release it and then calling AllocConsole() again to create a new one. Of course, if exwc was called from a GUI app that had no console (e.g. Start->Run) then we'll see a flicker as the default console is destroyed before its replacement is created.
exu foo.ex ( runs in current console ) exu -nc foo.ex ( opens a new console and runs foo.ex in it. )
Huh? What is a "new console" for exu?
And it is so inconsistent to have to put -CON in order to supress the creation of a new console Window on a translated application on one platform but then to not do so by default on the other.
Shawn Pringle
Only one platform supports the concept of console windows. Other platforms handle this saner, so the issue doesn't need to arise there.