Jump to content

Consolewrite output when script is opened directly?


Rapide
 Share

Recommended Posts

Is there any way to see Consolewrite output when script is opened directly and not executed from editor? Curious.

Edit: I am running a script and I want to see the consolewrite output of it (without terminating it ofcourse)😱

Edited by Rapide
Link to comment
Share on other sites

2 hours ago, FrancescoDiMuro said:

Compile it as CUI or make a GUI with an Edit control that you use as a Console :)

Is there any other way? Making GUI sounds like a long and even slightly difficult alternative for new people like me. As I said earlier, I am already running several scripts directly and don't want to terminate it, and start over everything again. I wonder if its possible to make another script to get Consolewrite() value or a variable value of the previous running script?

Link to comment
Share on other sites

I use this to be able to write to console in any case (compiled or not):

Global $CW = @Compiled ? __ConsoleWrite : _ConsoleWrite

Func __ConsoleWrite(ByRef $s)
    Local Static $hCon = __ConsoleInit()
    DllCall("kernel32.dll", "bool", "WriteConsoleW", "handle", $hCon, "wstr", $s & @LF, "dword", StringLen($s) + 1, "dword*", 0, "ptr", 0)
    Return
EndFunc   ;==>__ConsoleWrite

Func __ConsoleInit()
    DllCall("kernel32.dll", "bool", "AllocConsole")
    Return DllCall("kernel32.dll", "handle", "GetStdHandle", "int", -11)[0]
EndFunc   ;==>__ConsoleInit

; Unicode-aware ConsoleWrite
Func _ConsoleWrite($s)
    ConsoleWrite(BinaryToString(StringToBinary($s & @LF, 4), 1))
EndFunc   ;==>_ConsoleWrite

I setup the SciTE console to Unicode, so that's why the last function is needed.

Use it like that:

$CW("some text" & @LF)

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...