Phaser Posted November 17, 2010 Share Posted November 17, 2010 Hi, my previous thread will probably confuse people even more so I thought I would put the code into a new thread so it can be run, details on what it should do below script code expandcollapse popup#include <GUIConstantsEx.au3> #include <Array.au3> HotKeySet("{ESC}", "killme") Local $array[3] = ["0,1,2","1,2,3","2,3,4"] Local $newarray[10] $target = 4 while 1 it() WEnd Func it() $i = 0 while $i <= 2 $numarray = StringSplit($array[$i], ",") _ArrayDelete($numarray, 0) _ArrayPush($newarray,$numarray,1) $thenumberarray = _ArrayUnique($newarray) _ArrayDelete($thenumberarray, 0) _ArrayPop($thenumberarray) _ArrayDisplay($thenumberarray) ; check $thenumberarray to see if 4 is in it, if not do nothing $result = _ArraySearch($thenumberarray, $target, 0, 0, 0, 1) If $result = -1 Then MsgBox(0,"box name", "Not found yet",1);let the $newarray grow Else MsgBox(0,"box name", "Found it",1); empty the $newarray then start refilling it, same routine over and over EndIf $i = $i +1 WEnd EndFunc Func killme() Exit EndFunc What am trying to do is populate an array, use its values until something happens then empty it and start the cycle over again. As you will notice, it builds up until it finds a specific number, 4 in this case, after it finds the number is present I would like it to start from the beginning again, ie 0,1,2 should be the only numbers there, currently it starts with 0,1,2,3 I think the 3 is an actual count, not sure. I hope someone can see what I am trying to do Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 17, 2010 Moderators Share Posted November 17, 2010 Phaser, I have absolutely no idea what you are trying to do, but I think this does what you have described: expandcollapse popup#include <GUIConstantsEx.au3> #include <Array.au3> HotKeySet("{ESC}", "killme") Global $array[3] = ["0,1,2", "1,2,3", "2,3,4"] Global $newarray[10] $target = 4 While 1 it() WEnd Func it() For $i = 0 To UBound($array) - 1 $numarray = StringSplit($array[$i], ",", 2) $thenumberarray = _ArrayUnique($numarray) _ArrayDelete($thenumberarray, 0) _ArrayPush($newarray, $numarray, 1) $result = _ArraySearch($thenumberarray, $target) If $result = -1 Then MsgBox(0, "box name", "Not found yet", 1);let the $newarray grow _ArrayDisplay($newarray, "Filling") Else MsgBox(0, "box name", "Found it", 1); empty the $newarray then start refilling it, same routine over and over Global $newarray[10] _ArrayDisplay($newarray, "Emptied") ExitLoop EndIf Next EndFunc ;==>it Func killme() Exit EndFunc ;==>killme Does it? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
wakillon Posted November 17, 2010 Share Posted November 17, 2010 Phaser,I have absolutely no idea what you are trying to do, but I think this does what you have described: Does it? M23Hi @Melba ! nice to see you !How can you think it will do what he has described if you have absolutely no idea what he is trying to do ? Are you medium ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 17, 2010 Share Posted November 17, 2010 Hi @Melba ! nice to see you !; ...Are you medium ?Medium, yes.Melba was large for a short time, but has been eating right and exercising lately... 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...
JohnOne Posted November 17, 2010 Share Posted November 17, 2010 Gfaw gfaw. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 17, 2010 Moderators Share Posted November 17, 2010 wakillon,And bonsoir to you, mon brave. The OP described what he wanted the code to do - and I think it does that. But I have no idea why he wants the code to do it. is that clearer? PsaltyDS,has been eating right and exercising latelyAlways...but with the passing of the years it gets ever more difficult to stay medium... M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MvGulik Posted November 18, 2010 Share Posted November 18, 2010 Hi, my previous thread will probably confuse people even more so I thought I would put the code into a new thread so it can be run, details on what it should do below script codeErm ... might be a nice idea to put in a note about that in the old topic next time. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Phaser Posted November 18, 2010 Author Share Posted November 18, 2010 @ MvGulik - sorry about that Melba, almost, $thenumberarray (with unique values) is the array I want to use, if I change arraydisplay in your code to display $thenumberarray it never goes above 3 values, just before it finds '4' it should have 0,1,2,3 You have arrayunique working on numarray, numarray is only feeding sets of 2 numbers into new array, which could go up to 10 values in total, my thought was use numarray to fill newarray the get unique values from newarray, does that make sense Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 Phaser, I still have no idea what you are trying to do, but once again I believe this does what you have described: expandcollapse popup#include <GUIConstantsEx.au3> #include <Array.au3> HotKeySet("{ESC}", "killme") Global $array[3] = ["0,1,2", "1,2,3", "2,3,4"] Global $newarray[1] Global $temparray = $newarray $target = 4 While 1 it() WEnd Func it() For $i = 0 To UBound($array) - 1 $numarray = StringSplit($array[$i], ",", 2) If $newarray[0] = "" Then $temparray = $numarray Else _ArrayConcatenate($temparray, $numarray) EndIf _ArrayDisplay($temparray, "Added") $newarray = _ArrayUnique($temparray) _ArrayDisplay($newarray, "Unique") _ArrayDelete($newarray, 0) $result = _ArraySearch($newarray, $target) If $result = -1 Then ; let the $newarray grow _ArrayDisplay($newarray, "Not found yet") $temparray = $newarray Else ; empty the $newarray then start refilling it, same routine over and over Global $newarray[1] _ArrayDisplay($newarray, "Found it") $temparray = $newarray ExitLoop EndIf Next EndFunc ;==>it Func killme() Exit EndFunc ;==>killme If this is not what you want, you need to come up with considerably clearer prose to describe what it is you are trying to do. Otherwise I am done trying to produce code for an unknown purpose. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
wakillon Posted November 18, 2010 Share Posted November 18, 2010 Phaser,I still have no idea what you are trying to do, but once again I believe this does what you have described: If this is not what you want, you need to come up with considerably clearer prose to describe what it is you are trying to do. Otherwise I am done trying to produce code for an unknown purpose. M23@Melba Are you disappointed or disoriented like your players at Wembley ! Et toc ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 wakillon,Unlike the donkeys we had on the pitch last night, I am neither "disappointed" nor "disoriented" - just confused over what exactly the OP wants this code to do. Congratulations to France - it looks as if Laurent Blanc has got the basis for a good team there. I would have enjoyed watching them play even more if it had been at someone else's expense. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
wakillon Posted November 18, 2010 Share Posted November 18, 2010 wakillon,Unlike the donkeys we had on the pitch last night, I am neither "disappointed" nor "disoriented" - just confused over what exactly the OP wants this code to do. Congratulations to France - it looks as if Laurent Blanc has got the basis for a good team there. I would have enjoyed watching them play even more if it had been at someone else's expense. M23@Melba23oh! "Donkey" you're severe!remember they were playing against the great team of France !and sorry for the English bookmakers ...I hope you do not lose money... wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts 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