Sign in to follow this  
Followers 0
Rickname

How can I clean the console after something was written ?

7 posts in this topic

How/what command to use to clean the console window, after I ConsoleWrite something ? Just like the clrscr(); function from C++. Thanks

Share this post


Link to post
Share on other sites



For $x = 1 to 100
ConsoleWrite($x & @CRLF)
Next
ConsoleWrite("clear output in 1 sec" & @CRLF)
Sleep(1000)
SendSciTE_Command("menucommand:420") ; Clear Output pane "IDM_CLEAROUTPUT"
ConsoleWrite("cleared" & @CRLF)
;~ For $x = 1 to 100
;~ ConsoleWrite($x & @CRLF)
;~ Next
Exit
;
; Send command to SciTE
Func SendSciTE_Command($sCmd)
Local $Scite_hwnd = WinGetHandle("DirectorExtension")
Local $WM_COPYDATA = 74
Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
DllStructSetData($CmdStruct, 1, $sCmd)
Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
DllStructSetData($COPYDATA, 1, 1)
DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1)
DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
DllCall('User32.dll', 'None', 'SendMessage', 'HWnd', $Scite_hwnd, _
'Int', $WM_COPYDATA, 'HWnd', 0, _
'Ptr', DllStructGetPtr($COPYDATA))
EndFunc ;==>SendSciTE_Command

1 person likes this

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Thanks alot ! Wow seems alot of work for just one thingie. Maybe in the future this will be implemented atleast as a UDF in the Help file in the SciTe Editor. Thanks !

Share this post


Link to post
Share on other sites

Usually you don't use the Output pane of SciTE in production. Either use MsgBox or the Debug UDF to write data to a Console - or use your own GUI.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Usually you don't use the Output pane of SciTE in production. Either use MsgBox or the Debug UDF to write data to a Console - or use your own GUI.

Yes but is not more work to do to output a msgbox and then it pauses my script. Also I didnt know about the Debug UDF, but the output scite pane is just "closer to my hand"

Share this post


Link to post
Share on other sites

Try:

ConsoleWrite("Line 1" & @crlf)
ConsoleWrite("Line 2" & @crlf)
ConsoleWrite("Line 3" & @crlf)
Sleep(2000)
ControlSend("[CLASS:SciTEWindow]", "", "Scintilla2", "+{F5}")

Jos

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0