Results 1 to 5 of 5

Thread: easy array define for 2-column array?

  1. #1
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,198

    easy array define for 2-column array?

    In Lianja, an easy way to declare a 1-column array is:

    Code:
    la = ("Hank","Barry","David")
    Is there a comparable way to define a 2-column array?

    thanks,

    Hank

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,385
    Blog Entries
    22
    Hi Hank,

    You use {..} not (..) (typo?)

    See attached screenshot:

    Name:  Screen Shot 2014-02-09 at 9.24.29 AM.jpg
Views: 834
Size:  62.8 KB

    Alternatively if you know JSON you can create objects and arrays with members that are objects and arrays like this:

    Name:  Screen Shot 2014-02-09 at 9.30.56 AM.jpg
Views: 1035
Size:  60.3 KB
    Last edited by barrymavin; 2014-02-08 at 20:32.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,198
    Ah, I see. Thanks!

    And I used the plain parens, and it did work: good for you! <s> But, for 2-column, squiggly-brackets are required, per your example.

    Hank

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,385
    Blog Entries
    22
    Actually ( .. ) doesn't work the same as { .. }.

    In Lianja you can initialize all elements in an array like this.

    Code:
    dimension la(5)
    la = 0
    If you assign an bracketed expression to the array it is just initialized to that value.

    You need to use {..}.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,198
    Hmph! That's what I get for not checking it again: you're right of course, plain parens don't work. I swear it did that once <s>.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us