Jump to content

CosnoleWrite -- I don't understand it


Recommended Posts

Hey guys... I've never really bothered to look at ConsoleWrite... But I now see a good number of scripts using it to debug or whatnot... But I don't fully understand where something is written to using ConsoleWrite? Could I get a further explanation please? Thanks. :)

FootbaG
Link to comment
Share on other sites

I don't know, because the help file says:

Remarks

The purpose for this function is to write to a console which many popular text editors can read.

This does not write to a DOS console.

anybody else?
FootbaG
Link to comment
Share on other sites

console write writes to Scite ...

also autoit has the /stdout when it is ran

so i guessed Stdout.

but yeah i want to know what is can do exept write to scite :)

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

Its written to the stdout handle (Simple C printf() call). By default, Windows applications do not have anything which reads their stdout handle. However, most (good) text editors do read the stdout handle of a "tool" they run. That means text editors would be able to see text from AutoIt if it was sent to stdout. ConsoleWrite() is the gateway through which this is achieved.

Link to comment
Share on other sites

Ohhh... So you have to start the AutoIt script from ScIte in order to see what scite is going to output to you, or what scite has "caught"... Thanks guys, you cleared it up a bunch :)

FootbaG
Link to comment
Share on other sites

A little clarification, in 32-bit Windows any app that you run from the shell (double-click or DOS box) gets assessed by the shell as to whether it's a console app or a GUI app. If it's a GUI app (and any compiled AutoIt3 script is) then its standard input/output pipes get disconnected, Windows making the presumption that you won't need them, even if the app was started from a DOS box. This is why there's no console output from your compiled script if you use ConsoleWrite.

If you run your compiled script another way (like from another script using Run() ) that doesn't invoke the shell, then the STDOUT pipe doesn't get disconnected and any output from ConsoleWrite is available for further processing...

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

  • 8 months later...

Ohhh... So you have to start the AutoIt script from ScIte in order to see what scite is going to output to you, or what scite has "caught"... Thanks guys, you cleared it up a bunch :)

You can get CosnoleWrite output when running from a DOS console but you have to pipe it to another command. I have cygwin installed on my window machine so I just piped it through cat thus:

AutoIt3.exe MyScript.au3 | cat

Note that you have to use @CRLF for line ends.

(I realise this is probably too late for the original poster but I leave it here for anyone googling the same problem as I was)

Edited by Sam Hasler
Link to comment
Share on other sites

Any have a list of (simple) text editors that support this?

I use MetaPad, because it has a goto line function, don`t want all the extra wizz bang stuff... (yet) :)

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

How to display text to the current DOS console, where my au3 is running, like the DIR command do ?

I cannot find in the help

I want to stab you multiple times. This question has been asked about 403 thousand times. There are at least two work-arounds and the subject is covered in multiple threads. Not only that, but your question is off topic in this thread since it's about ConsoleWrite() and the documentation clearly states that ConsoleWrite() does not output to DOS.
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...