Jump to content
jguinch

_ArrayDeclareFromString, _ArrayToDeclarationString, _ArrayShuffleMultiDim, _ArrayCompare, _ArrayEnumValues, _ArrayAssign, ...

Recommended Posts

czardas

I like the idea of _ArrayToDeclarationString() - that is a very useful concept. One suggestion - I think you could add more information about dimension limitations in the comments to these functions. How many dimensions does _ArrayToDeclarationString() cater for?

Share this post


Link to post
Share on other sites
czardas

Nice! :)

Local $aSubjects = [[["Art"],["Painting",2,7],["Music",2,3],["Drama",3,4],["Dance",1,10]],[["Science"],["Maths",6,6],["Physics",5,1],["Chemistry",5,6],["Biology",5,6]],[["Sport"],["Football",12,8],["Golf",4,0],["Snooker",1,1],["Chess",10,0]]]

 

Share this post


Link to post
Share on other sites
jguinch

Thanks.
Now, you can do the reverse, build the array from a string :

$array = _ArrayDeclareFromString('[[["Art"],["Painting",2,7],["Music",2,3],["Drama",3,4],["Dance",1,10]],[["Science"],["Maths",6,6],["Physics",5,1],["Chemistry",5,6],["Biology",5,6]],[["Sport"],["Football",12,8],["Golf",4,0],["Snooker",1,1],["Chess",10,0]]]')
$aEnum = _ArrayEnumValues($array) ; useful for arrays > 2 dimensions
_ArrayDisplay($aEnum)

 

  • Like 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

×