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


This topic contains 4 replies, has 1 voice, and was last updated by  human fly 2 months, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #73699

    human fly

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

    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 !


    human fly

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


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


    human fly

    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)


    human fly

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

    this, for instance, is not:

    and here, which starts off well …

    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 …


    human fly

    this is better reading


Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.