NewUser12 Posted July 2, 2017 Share Posted July 2, 2017 Hi , is there a way to make sleep in adlibregister function but without pausing the script ? when using something like this only 123 gonna be displayed ... AdlibRegister("Check",500) Func check() ConsoleWrite("1") Sleep(500) ConsoleWrite("2") Sleep(500) ConsoleWrite("3") Sleep(500) EndFunc while 1 Sleep(500) ConsoleWrite("NOT") WEnd I wish if u understand me and thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 11 minutes ago, NewUser12 said: Hi , is there a way to make sleep in adlibregister function but without pausing the script ? Not in the same script as it is a single thread. This would require a seconds instance of the script. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 Sorry but i didn't get what u mean Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 Which part of the information I provided? The first or second part? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 The second part Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 So when you want to have a specific function running in parallel with you main function, your only option is to shell a second script and communicate with it via a form of messaging to make it do what it needs to do. There are examples enough how this can be done. Search for WM_COPYDATA to find examples. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 Well i see that autoit doesn't support that right ? Also i wanted to ask another question iam getting from ini files likes 5k lines and i have an progressbar is there a way to make the progressbar works in background while the listview is getting information from the ini files and both ends together ? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 Not sure I understand the question: Isn't this simply a matter of updating the processbar in the part that populates the listview? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 Iam getting informations like this : expandcollapse popupFunc _Load() $readsectionnames = _IniReadSectionNamesEx("file.txt") GUICtrlSetData($Labelofloading,"1 %") For $i = 1 to $readsectionnames[0] _GUICtrlListView_AddItem($ListView1,$readsectionnames[$i]) Next For $i = 1 to 20 Sleep(100) GUICtrlSetData($Labelofloading,$i&" %") Next For $i = 1 to $readsectionnames[0] $Case = IniRead("file.txt",$readsectionnames[$i],"Case","") _GUICtrlListView_AddSubItem($ListView1,$i,$Case,1,1) Next For $i = 21 to 40 Sleep(100) GUICtrlSetData($Labelofloading,$i&" %") Next For $i = 1 to $readsectionnames[0] $Code = iniread("file.txt",$readsectionnames[$i],"Code","") _GUICtrlListView_AddSubItem($ListView1,$i,$Code,2,2) Next For $i = 41 to 50 Sleep(100) GUICtrlSetData($Labelofloading,$i&" %") Next For $i = 1 to $readsectionnames[0] $Dateofbuying = iniread("file.txt",$readsectionnames[$i],"Date of buying","") _GUICtrlListView_AddSubItem($ListView1,$i,$Dateofbuying,3,3) Next ;;etc endfunc but actually i didn't like the fake progressbar for example like the $labelofloading i did i wanted it to work in background idk how xd Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 (edited) Can't you simply start a progressbar and update the with each loop and use a single loop? Something like this: (Untested) Func _Load() ; Display a progress bar window. ProgressOn("Loading Progress", "getting data", "0%") ; Set the "subtext" and "maintext" of the progress bar window. $readsectionnames = _IniReadSectionNamesEx("file.txt") GUICtrlSetData($Labelofloading, "1 %") For $i = 1 To $readsectionnames[0] ProgressSet($i*100/$readsectionnames[0], $i & "%") _GUICtrlListView_AddItem($ListView1, $readsectionnames[$i]) Sleep(100) GUICtrlSetData($Labelofloading, $i & " %") $Case = IniRead("file.txt", $readsectionnames[$i], "Case", "") _GUICtrlListView_AddSubItem($ListView1, $i, $Case, 1, 1) Sleep(100) GUICtrlSetData($Labelofloading, $i & " %") $Code = IniRead("file.txt", $readsectionnames[$i], "Code", "") _GUICtrlListView_AddSubItem($ListView1, $i, $Code, 2, 2) Sleep(100) GUICtrlSetData($Labelofloading, $i & " %") $Dateofbuying = IniRead("file.txt", $readsectionnames[$i], "Date of buying", "") _GUICtrlListView_AddSubItem($ListView1, $i, $Dateofbuying, 3, 3) Next ProgressOff() ;;etc EndFunc ;==>_Load Edited July 2, 2017 by Jos fixed typo NewUser12 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
moimon Posted July 2, 2017 Share Posted July 2, 2017 3 minutes ago, Jos said: Can't you simply start a progressbar and update the with each loop and use a single loop? Something like this: (Untested) Func _Load() ; Display a progress bar window. ProgressOn("Loading Progress", "getting data", "0%") ; Set the "subtext" and "maintext" of the progress bar window. $readsectionnames = _IniReadSectionNamesEx("file.txt") GUICtrlSetData($Labelofloading, "1 %") For $i = 1 To $readsectionnames[0] ProgressSet($i+100/$readsectionnames[0], $i & "%") _GUICtrlListView_AddItem($ListView1, $readsectionnames[$i]) Sleep(100) GUICtrlSetData($Labelofloading, $i & " %") $Case = IniRead("file.txt", $readsectionnames[$i], "Case", "") _GUICtrlListView_AddSubItem($ListView1, $i, $Case, 1, 1) Sleep(100) GUICtrlSetData($Labelofloading, $i & " %") $Code = IniRead("file.txt", $readsectionnames[$i], "Code", "") _GUICtrlListView_AddSubItem($ListView1, $i, $Code, 2, 2) Sleep(100) GUICtrlSetData($Labelofloading, $i & " %") $Dateofbuying = IniRead("file.txt", $readsectionnames[$i], "Date of buying", "") _GUICtrlListView_AddSubItem($ListView1, $i, $Dateofbuying, 3, 3) Next ProgressOff() ;;etc EndFunc ;==>_Load Good example for me. Thank you Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 I see I made at least one typo in the code: + should be * ProgressSet($i*100/$readsectionnames[0], $i & "%") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 Thanks for the example bro <3 Sorry this is my last question hahaha How to learn all the syntax in autoit ? what's the best way. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 3 minutes ago, NewUser12 said: Sorry this is my last question hahaha Somehow doubt that ... and there is no issue to ask questions. 3 minutes ago, NewUser12 said: How to learn all the syntax in autoit ? what's the best way. F1 /Search Read Think Try Goto 1 Jos Xandy and Professor_Bernd 2 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 That's how you learned ? Also it's important to have another programming language like C++ beside autoit ? Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 Also is there a way to check if the taskbar is using small icons or large icons ? just to set the gui full screen Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 Yes, that is how I learned this language back in 2004 (i think), but have been programming since 1978 in various languages of which one is Basic, which is somewhat similar to AutoIt3. To me learning any language is initially investing in learning the words (Functions etc) and grammar (Syntax) and then putting them together into sentences (Scripts). I do realize it isn't always easy for everybody to have the discipline and patience, but to me it's the only way to properly learn. As to your last post (to make a link to the first part of this PM): did you try to goggle it? One of the first hits I got was this one. It is in general fair to assume you aren't the first one asking the questions and likely somebody already shared the answer somewhere on the internet so always try and search for the answer yourself. Jos Xandy 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 I searched a lot for that the sizes that in the registry files doesn't work correctly and it just changes when restarting pc so i would like to ask if there's another way to - minus the desktopheight from the taskbar size to get the gui full screen resolution Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 Did you read that thread all the way down? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
NewUser12 Posted July 2, 2017 Author Share Posted July 2, 2017 This is the icon of desktop not the taskbar right ? 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