rudi Posted February 1, 2008 Share Posted February 1, 2008 Hi. #include <Array.au3> Dim $avArray[5] $avArray[0] = "ab" $avArray[1] = "bc" $avArray[2] = "cd" $avArray[3] = "de" $avArray[4] = "ef" $aNewArray = _ArrayTrim( $avArray, 1, 1,1,3) _ArrayDisplay($aNewArray,"demo _ArrayTrim") Exit ;The new array in order should now be "a", "b" , "c" , "d", "e". The result is "ab", "b", "c", "d", "ef" (processing 3 values starting with index = 1) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
The Kandie Man Posted February 1, 2008 Share Posted February 1, 2008 Your array indexes were wrong. #include <Array.au3> Dim $avArray[5] $avArray[0] = "ab";the first index is 0 $avArray[1] = "bc" $avArray[2] = "cd" $avArray[3] = "de" $avArray[4] = "ef";the last index is 4 $aNewArray = _ArrayTrim( $avArray, 1, 1,0,4) _ArrayDisplay($aNewArray,"demo _ArrayTrim") ;This array will now display "a", "b", "c", "d", "e". - The Kandie Man ;-) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
rudi Posted February 7, 2008 Author Share Posted February 7, 2008 Your array indexes were wrong. No. I simply copy-pasted from the help file. But at very 1st let me ask this question again: Which is the right place to drop enhancement requests for the docu? The "...,1,3]" values IMHO are choosen very well in the help file's example, as they demonstrate these function parameters excellent. Your example is using "...,0,4]". This is giving the same result as if I would just drop these 2 parameters, so the sense of these 2 [, $iBase [, $iUbound ]] would not be pointed out at all. once more copy/paste from the autoit help: #include <Array.au3> Dim $avArray[5] $avArray[0] = "ab" $avArray[1] = "bc" $avArray[2] = "cd" $avArray[3] = "de" $avArray[4] = "ef" $aNewArray = _ArrayTrim( $avArray, 1, 1,1,3) _ArrayDisplay($aNewArray,"demo _ArrayTrim") Exit ;The new array in order should now be "a", "b" , "c" , "d", "e". The last line should be corrected to this: ;The new array in order should now be "ab", "b", "c", "d", "ef" Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
picaxe Posted February 8, 2008 Share Posted February 8, 2008 (edited) Bug ticket already submitted and closed here Edited February 8, 2008 by picaxe Link to comment Share on other sites More sharing options...
rudi Posted February 8, 2008 Author Share Posted February 8, 2008 Bug ticket already submitted and closed here IMHO the change in the docu was done at the wrong place: The code was changed from $aNewArray = _ArrayTrim( $avArray, 1, 1,1,3) to $aNewArray = _ArrayTrim( $avArray, 1, 1,0,4) which is basically giving the same result as $aNewArray = _ArrayTrim( $avArray, 1, 1) With this change the new example code does NOT point out any more what's the purpose of the 3rd and 4th parameter at all. So IMHO the example's code should be left as it was before, and the result example should be corrected: $aNewArray = _ArrayTrim( $avArray, 1, 1,1,3) ;The new array in order should now be "ab", "b", "c", "d", "ef" Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
rudi Posted February 13, 2008 Author Share Posted February 13, 2008 Hi, 1.) may I pls bump this question -- Where to drop enhancement suggestions for docu? 2.) IMHO the example given below is worth to be integrated in the docu, as it's pointing out the effect of all 4 function parameters much better. Regards, Rudi. IMHO the change in the docu was done at the wrong place: The code was changed from $aNewArray = _ArrayTrim( $avArray, 1, 1,1,3) to $aNewArray = _ArrayTrim( $avArray, 1, 1,0,4) which is basically giving the same result as $aNewArray = _ArrayTrim( $avArray, 1, 1) With this change the new example code does NOT point out any more what's the purpose of the 3rd and 4th parameter at all. So IMHO the example's code should be left as it was before, and the result example should be corrected: $aNewArray = _ArrayTrim( $avArray, 1, 1,1,3) ;The new array in order should now be "ab", "b", "c", "d", "ef" Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
therks Posted February 13, 2008 Share Posted February 13, 2008 1.) may I pls bump this question -- Where to drop enhancement suggestions for docu?The link that picaxe provides links to the Bug trac system. In addition to bugs, you can also add feature requests, for both program and documentation. My AutoIt Stuff | My Github 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