Writes data to the STDOUT stream. Some text editors can read this stream as can other programs which may be expecting data on this stream.
ConsoleWrite ( "data" )
The purpose for this function is to write to the STDOUT stream. Many popular text editors can read this stream. Scripts compiled as Console applications also have a STDOUT stream.
This does not write to a DOS console unless the script is compiled as a console application.
Characters are converted to ANSI before being written.
Binary data is written as-is. It will not be converted to a string. To print the hex representation of binary data, use the String() function to explicitly cast the data to a string.
The @error and @extended are not set on return leaving them as they were before calling. Usefull when debugging with the SciTE debugging output.
ConsoleRead, ConsoleWriteError
Local $sString= "This is an example of writing to the console."
ConsoleWrite ($sString&@CRLF ); Running this in a text editor which can trap console output e.g. SciTE, will display value of $sString.
ConsoleWrite ('! = Red'&@CRLF ); ! = red text color ConsoleWrite ('> = Blue'&@CRLF ); > = blue text color ConsoleWrite ('- = Orange'&@CRLF ); - = orange text color ConsoleWrite ('+ = Green'&@CRLF ); + = green text color ConsoleWrite ('(5) : = Red (jump to line 5 when double-clicked)'&@CRLF ); '(5) :' red text color and double click jumps to (line number) ConsoleWrite ('Start_with_String_or_Integer_WithOut_Space'&@TAB &@TAB &'6'&' = Pink (jump to line 6 when double-clicked)'&@CRLF ) ; pink text color, any sign (without space) and then @TAB & @TAB & 'line number' ; Example 1 ConsoleWrite ('('&@ScriptLineNumber &') : = Red (jump to line '&@ScriptLineNumber &' when double-clicked)'&@CRLF ) ; Clear console output pane of SciTE after 5000 ms Sleep (5000) ControlSend ("[CLASS:SciTEWindow]","","Scintilla2","+{F5}")