This isn't really an advanced UDF, but implements a couple of functions and features, with the idea of substituting the original functions like ConsoleWrite() and ConsoleWriteError() and the seriously sketchy ConsoleRead() lol.
- Dynamically opens and closes consoles
- Use the STDOUT, STDERR and STDIN streams like in other languages.
- Print coloured/styled text
- Access the command interpreter through the console.
- Uses unicode.
- Register console events.
- The UDF is designed to work standalone and to have minimal overhead (> 0.1 ms for writing a coloured string)
Why would anyone need this?
Good question. I guess this mainly goes out to people with a bit of nostalgia in them. I personally like the feel of a console.
- Fixed system() to allow case sensitive text.
- Fixed typo's.
- Changed frequent dllcalls to use dllcalladdress for speed.
- Added RegisterConsoleEvent - functions can be registrered to be called on certain events, like closure of console. This can be used to mimic OnAutoItExit behaviour, that wont be called in case of bad closure.
- Various optimizations.
- Added Getch() function.
- Better error handling all around.
- Put back color attribute constants as they are more symbolic imo.
- Decreased the standard size of Cin allocation (bit harsh to allocate 2 kb memory each time) - it's now changed to 128 chars.
- Added color constants thanks to Warmonger.
- Fixed Cin() bug.
- Cin() isn't returning a trailing CRLF anymore.
- Fixed startup function, so it should run from SciTE now.
- 15-03-2011 - Initial release.
I know Matt Diesel was/is working on large, similar UDF, however i wanted something simpler and easier to use. This is the result. Thoughts?
Console.au3 28.72K 636 downloads
Edited by Shaggi, 06 August 2012 - 03:14 PM.