tables – stuff you can do with them?

Home Forums General Programming tables – stuff you can do with them?

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #73699
    human fly
    Participant
      • Topics: 124
      • Replies: 1070
      • Total: 1194
      • ★★★★

      *viz: this is just a look at aspects of Lua, rather than
      direct common Ctrlr applications. *

      Tables.
      big subject, obviously – just from a few checks around
      sites. mind boggling diversity of examples out there.
      i mean within Ctrlr.

      recently was englightened with table.insert. that’s cool.
      i’m discovering the consequences of that (you can ‘insert’
      onto an existing table, for example, but i’m not sure if
      you get a ‘clean’ addition – try ‘dump’ to see results)

      so that’s useful for building a table on the fly.
      what about ‘getting’ the data for that table afterwards,
      for example?

      so i tried
      ‘for i,v in ipairs …’
      and i’ve got as far as printing ‘v’ (data/values) to console.
      now i’m off to see how getRange works, but i have a feeling
      that that is for memory blocks, and these represent the data
      in another form.

      i have not yet, for example, been able to concatenate these
      as strings into a single string. do i even want/need to do
      that? (i’m finding out re issues with values vs strings …)

      and then: toHexString() producing unexpected results – that
      will only work on a memory block, not direct from a table.

      anyway: you see the kind of thing…

      anyone out there? still on the forum? been pretty quiet lately !

      #73700
      human fly
      Participant
        • Topics: 124
        • Replies: 1070
        • Total: 1194
        • ★★★★

        ah, here we go:
        ‘table.concat’ :o)

        http://lua-users.org/wiki/TableLibraryTutorial

        (but that’s just the start of this …)

        #73701
        human fly
        Participant
          • Topics: 124
          • Replies: 1070
          • Total: 1194
          • ★★★★

          ok, this is great. but what if the table is compiling
          different value ranges, some, say 0-4, and others 0-11?
          1 or 2 characters? once it’s concatenated, nobody can
          tell them apart? i have to convert, ie: to hex first?

          (see ‘simple sequencer’ thread for clarification)

          #73702
          human fly
          Participant
            • Topics: 124
            • Replies: 1070
            • Total: 1194
            • ★★★★

            well it seems it is finite. but these lua tutorial sites
            are not always very good.

            this, for instance, is not:
            https://www.lua.org/pil/2.5.html
            nor:
            https://www.lua.org/pil/3.6.html

            and here, which starts off well …
            http://lua-users.org/wiki/TablesTutorial

            well, as soon as they start going ‘foo’, and ‘bar’, all
            i can think of is ‘fubar’, which is:
            ‘f***ed up beyond all recognition’

            stackoverflow lets users give more examples. whether
            that’s good or not, i don’t know, but it offers a
            few more applied insights, and in a format you can
            just nick with copy+paste …

            #73723
            human fly
            Participant
              • Topics: 124
              • Replies: 1070
              • Total: 1194
              • ★★★★

              this is better reading

              http://lua-users.org/wiki/TableUtils

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The forum ‘Programming’ is closed to new topics and replies.
            There is currently 0 users and 95 guests online
            No users are currently active
            Forum Statistics
            Threads: 2,495, Posts: 17,374, Members: 77,605
            Most users ever online was 12 on January 22, 2019 3:47 pm
            Ctrlr