Invicore Posted June 9, 2021 Share Posted June 9, 2021 (edited) Hi, I want to know its possible to create a progressbar for a for loop inside of CUI without using anything like ProgressOn and etc? I mean I want it to be completely in CUI interface and not use any GUI element in it thanks Edited June 9, 2021 by Invicore Link to comment Share on other sites More sharing options...
Trong Posted June 9, 2021 Share Posted June 9, 2021 ;................... ConsoleWrite("1%"&@CRLF) ;................... ConsoleWrite("2%"&@CRLF) ;................... Regards, Link to comment Share on other sites More sharing options...
Invicore Posted June 9, 2021 Author Share Posted June 9, 2021 (edited) Just now, VIP said: ;................... ConsoleWrite("1%"&@CRLF) ;................... ConsoleWrite("2%"&@CRLF) ;................... its not a good way to do it, because its only print text in new line I want a way to create a progress bar and change it in one line for example in c++ I can print a line, and after that go few character back with \r and rewrite it Edited June 9, 2021 by Invicore Link to comment Share on other sites More sharing options...
Solution Zedna Posted June 9, 2021 Solution Share Posted June 9, 2021 #AutoIt3Wrapper_Change2CUI=y #include <string.au3> For $i = 1 to 79 $part1 = _StringRepeat(Chr(219), $i) $part2 = _StringRepeat(Chr(177), 79 - $i) ConsoleWrite(@CR & $part1 & $part2) Sleep(50) Next ; uncomment this if you want to preserve finished progressbar ;~ ConsoleWrite(@CRLF & "DONE!") ; comment this if you want to preserve finished progressbar ConsoleWrite(@CR & _StringRepeat(' ', 79)) ConsoleWrite(@CR & "DONE!") Gianni, spudw2k and Invicore 2 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Invicore Posted June 9, 2021 Author Share Posted June 9, 2021 Just now, Zedna said: #AutoIt3Wrapper_Change2CUI=y #include <string.au3> For $i = 1 to 79 $part1 = _StringRepeat(Chr(219), $i) $part2 = _StringRepeat(Chr(177), 79 - $i) ConsoleWrite(@CR & $part1 & $part2) Sleep(50) Next ; uncomment this if you want to preserve finished progressbar ;~ ConsoleWrite(@CRLF & "DONE!") ; comment this if you want to preserve finished progressbar ConsoleWrite(@CR & _StringRepeat(' ', 79)) ConsoleWrite(@CR & "DONE!") thank you looks like this is exact thing I was looking to Link to comment Share on other sites More sharing options...
Invicore Posted June 9, 2021 Author Share Posted June 9, 2021 (edited) ConsoleWrite("started: " & @CRLF) $locxal = 150 For $i = 0 to $locxal Progress($i, $locxal) Sleep(50) Next Func Progress($now, $all) Local $Progress = Int($now / ($all / 50)) $part1 = _StringRepeat(Chr(219), $Progress) $part2 = _StringRepeat(Chr(177), 50 - $Progress) ConsoleWrite(@CR & "processing files: " & $part1 & $part2 & " " & (($Progress <> 50) ? $Progress*2 & "%" : "DONE!")) EndFunc this is what I ended up with, thanks to @Zedna im not sure make it a function is good or not (i need it many times so I think this way its better) Edited June 9, 2021 by Invicore 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