Sign in to follow this  
Followers 0
McGod

Any way of doing this?

5 posts in this topic

Assign("s", "['0', '1', '2']")

#include <Array.au3>

_ArrayDisplay($s)

Something that can take literal ['0', '1', '2'] and convert it to an array.

Share this post


Link to post
Share on other sites

#include <Array.au3>

Dim $avArray

$avArray = _ArrayCreate("JPM", "Holger", "Jon", "Larry", "Jeremy", "Valik", "Cyberslug", "Nutster", "Tylo", "JdeB")

_ArrayDisplay( $avArray, "Array created with _ArrayCreate" )

Exit

from the HELP in AUTOIT !!!

Share this post


Link to post
Share on other sites

Even better?

#include <Array.au3>

Assign ("avArray", _ArrayCreate("JPM", "Holger", "Jon", "Larry", "Jeremy", "Valik", "Cyberslug", "Nutster", "Tylo", "JdeB"))

_ArrayDisplay( Eval ("avArray"), "Array created with _ArrayCreate" )

Share this post


Link to post
Share on other sites

No, you see I have a string

['0', '1', '2']

I want to convert it to an array

so string->array

So that I dont have to parse the [[ then manually loop it into an array.

Share this post


Link to post
Share on other sites

No, you see I have a string

['0', '1', '2']

I want to convert it to an array

so string->array

So that I dont have to parse the [[ then manually loop it into an array.

What is wrong with something like this?

I cannot see for my life why you would want to do this?

#include <Array.au3>
$text = StringReplace (StringReplace ("['0', '1', '2']", "['", ""), "']", "")
MsgBox (0, "", $text)
_ArrayDisplay (StringSplit ($text, "', '", 1))

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