BinaryBrother Posted July 8, 2009 Share Posted July 8, 2009 (edited) I'm currently using a 'cheap' method to restart my CLI after a certain command is processed correctly. Run(@ScriptFullPath) Exit I've noticed that the buffer doesn't get wiped when I do that, but my program successfully restarts... In other words... While @InetGetActive _RunDos("CLS") ConsoleWrite(@CRLF & 'Downloading ' & $Name & ' now... (' & Ceiling((@InetGetBytesRead/$Size)*100) & '%)') Sleep(500) WEnd Run(@TempDir & '\' & $Name & '.exe') Run(@ScriptFullPath) Exit As you can see, a download has been started, and the Console is being updated with the progress, once the download is done, it is then executed, and my program is supposed to re-open in a new thread, while the current program dies... While the end product is not what I expected, because it appears by calling my own program before I kill it, it hops into the same stream, meaning my buffer still exists... Requiring a simple 'CLS' of course... So my question, in short, is... I'm not going to cause a recursion issue by doing this am I? Also, is it releasing the previous handles like I want it to, or is it going to double the memory usage every-time my function completes because multiple CLIs will be loaded in the same thread? Edited July 8, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 8, 2009 Share Posted July 8, 2009 I'm currently using a 'cheap' method to restart my CLI after a certain command is processed correctly. Run(@ScriptFullPath) Exit I've noticed that the buffer doesn't get wiped when I do that, but my program successfully restarts... In other words... While @InetGetActive _RunDos("CLS") ConsoleWrite(@CRLF & 'Downloading ' & $Name & ' now... (' & Ceiling((@InetGetBytesRead/$Size)*100) & '%)') Sleep(500) WEnd Run(@TempDir & '\' & $Name & '.exe') Run(@ScriptFullPath) Exit As you can see, a download has been started, and the Console is being updated with the progress, once the download is done, it is then executed, and my program is supposed to re-open in a new thread, while the current program dies... While the end product is not what I expected, because it appears by calling my own program before I kill it, it hops into the same stream, meaning my buffer still exists... Requiring a simple 'CLS' of course... So my question, in short, is... I'm not going to cause a recursion issue by doing this am I? Also, is it releasing the previous handles like I want it to, or is it going to double the memory usage every-time my function completes because multiple CLIs will be loaded in the same thread? It seems the child process inherits the buffer along the rest of the parent environment. Run your process as a scheduled task with AT or SCHTASK to kick off in 10 seconds, that should avoid the inheritance. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
BinaryBrother Posted July 8, 2009 Author Share Posted July 8, 2009 Well, I actually don't mind it... It works great... I just want to make sure that there are any adverse side-effects I haven't noticed... SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 8, 2009 Share Posted July 8, 2009 The on screen buffer has a limit. If you try to scroll up, you'll probably notice there's a point it stops scrolling. Data gets deleted after so much gets added. It's automatic, so don't worry about it. If it bothers you though, you can run "cls" before calling your program and that'll clean it up too. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now