Jump to content

Trouble with _ArrayToString


Recommended Posts

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
Link to comment
Share on other sites

  • Developers

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?

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

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)
Link to comment
Share on other sites

  • Developers

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.

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

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])
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...