HighGuy Posted May 31, 2006 Share Posted May 31, 2006 Hi, is there a reason why _ArrayToString() returns "" and sets an error if there's only one element in the array? I think it should return the element (without any separator) instead. Does anyone else support this RFC? Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 31, 2006 Share Posted May 31, 2006 Hi, is there a reason why _ArrayToString() returns "" and sets an error if there's only one element in the array? I think it should return the element (without any separator) instead. Does anyone else support this RFC? Hmm... ;Test _ArrayToString() #include <array.au3> Global $MyString, $MyArray[1] = ["Chunky"] _TestIt() _ArrayAdd($MyArray, "Funky") _ArrayAdd($MyArray, "Monkey") _TestIt() $MyArray = StringSplit($MyString, ";") _ArrayDisplay($MyArray, "_StringSplit()") _TestIt() Func _TestIt() $MyString = _ArrayToString($MyArray, ";") $SaveError = @error MsgBox(64, "Test _ArrayToString()", "Returned string = " & $MyString & @CRLF & _ "@Error = " & $SaveError) EndFunc ;==>_TestIt The helpfile make a point out it being the recipricol of StringSplit(), but for that you have to be sure to add start index = 1 (which is 0 by default). Then _StringSplit($MyString, ";") = _ArrayToString($MyArray, ";", 1). But your change won't hurt any already-written scripts, since it just eliminates an error condition, so it seems reasonable to me. I like the idea... 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...
PsaltyDS Posted May 31, 2006 Share Posted May 31, 2006 Hi,is there a reason why _ArrayToString() returns "" and sets an error if there's only one element in the array? I think it should return the element (without any separator) instead. Does anyone else support this RFC?P.S. This probably belongs in the v3 Idea Lab forum... perhaps some nice moderator would move the thread? 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...
HighGuy Posted June 3, 2006 Author Share Posted June 3, 2006 Well, if this RFC seams not be that interesting for the rest of you, I will do a quick hack for my own. Thank you PsaltyDS for your support Link to comment Share on other sites More sharing options...
Developers Jos Posted June 3, 2006 Developers Share Posted June 3, 2006 Well, if this RFC seams not be that interesting for the rest of you, I will do a quick hack for my own. Thank you PsaltyDS for your support what about you take the current Function and you write a proposal for changes in a way that no current implementations will brake ? 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 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