Sign in to follow this  
Followers 0
rudi

Where to drop enhancement suggestions for docu?

7 posts in this topic

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!

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Bug ticket already submitted and closed here

Edited by picaxe

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0