Array constants in LiveCode Builder

Ralph DiMola rdimola at evergreeninfo.net
Thu Jan 7 00:32:19 CET 2016


Peter,

Nice.... Could it also be used like the function call example below(that
looks for the second argument to be an array) when calling a procedure that
expects an array? This would make reading function calls long arguments
lists(like I use) more readable. I don't use arrays for function/command
optional arguments because you need to declare the array and then add an
extra line of code to insert each argument into an array.

Example:
Put MyFunction(SomeVar,{"cats": 5, "dogs": 23},SomeOtherVar) into MyVar

PS: I know there is a good reason but I got to know... 127?


Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of Peter TB Brett
Sent: Wednesday, January 06, 2016 5:09 PM
To: User List
Subject: Array constants in LiveCode Builder

Here's another piece of good news:

Mark Waddingham and I spent a couple of hours yesterday morning adding
support for literal arrays to the LiveCode Builder Language.  In LiveCode
8.0.0 DP 13, you will be able to write:

     variable tArray as Array
     put {"cats": 5, "dogs": 23} into tArray

Or:

     constant kColours is { "dirty purple": [80, 24, 60], \
                            "blue: [0, 0, 255] }

Hopefully this should make working with arrays both easier and less verbose.

                                       Peter

P.S. There's currently a limit of 127 key-value pairs in an array literal.

--
Dr Peter Brett <peter.brett at livecode.com> LiveCode Open Source Team

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list