Jump to content
Sign in to follow this  
erik7426

Trouble with _ArrayToString

Recommended Posts

erik7426

I think I may have found an issue with the _ArraytoClip and _ArrayToString functions.

Here is the post that details what I found.

Basically it appears to be impossible to use either function in this manner

_ArrayToString($avArray, @CR, 0, 0)

As is this code will start at 0 index and continue until the end of the array instead of only reading [0]

Can someone take a look and tell me if this is something that needs to be fixed in Array.au3 or if I'm just missing something altogether?

Edited by erik7426

Share this post


Link to post
Share on other sites
Jos

I think I may have found an issue with the _ArraytoClip and _ArrayToString functions.

Here is the post that details what I found.

Basically it appears to be impossible to use either function in this manner

_ArrayToString($avArray, @CR, 0, 0)

As is this code will start at 0 index and continue until the end of the array instead of only reading [0]

Can someone take a look and tell me if this is something that needs to be fixed in Array.au3 or if I'm just missing something altogether?

The intend of this function is to dump an array into a single string and include a delimiter. Maybe the choice of 0 (zero) wasn't the best as default but in case you only want to dump one "record" of the array its not really needed to use this UDF.

How in real life would you want to use this?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
erik7426

The intend of this function is to dump an array into a single string and include a delimiter. Maybe the choice of 0 (zero) wasn't the best as default but in case you only want to dump one "record" of the array its not really needed to use this UDF.

How in real life would you want to use this?

I currently don't have any use for it. I found it while trying to track down the problem someone else was having. If you only want the 0 index to be copied to the clipboard using _ArrayToClip how would you do it?

Because this won't work...

_ArrayToClip($avArray, 0,0)

Share this post


Link to post
Share on other sites
Jos

I currently don't have any use for it. I found it while trying to track down the problem someone else was having. If you only want the 0 index to be copied to the clipboard using _ArrayToClip how would you do it?

Because this won't work...

_ArrayToClip($avArray, 0,0)
That isn't possible as the 0 values mean used the defaults.

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
erik7426

That isn't possible as the 0 values mean used the defaults.

I understand now that 0 is the default for start and end. I should have paid more attention to the documentation (DUH!)

So would the best wast to get $array[0] in the clipboard be this way?

ClipPut($array[0])

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  

×