(WIP) Martix setup

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: (WIP) Martix setup

Post by RobertBell » Sun Jan 04, 2009 12:56 pm

Code: Select all

retString = HC.AttributeGetValue('1/10')
for level in string.gmatch(retString ,"%d+") do
  -- do your thing here - I'm just printing the levels seperated by a space to show I got them
  print(level .. ' ')
end
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: (WIP) Martix setup

Post by RobertBell » Sun Jan 04, 2009 3:46 pm

Sorry - that was a Lua solution. In VB.Net, you should be able to get the retrun string from the Lua print(). It will be a long string deliminated by tabs. If your return string is 'retString', in .net you should be able to make an array
dim s() as string = retString.Split(vbTab) then iterate through s()

for i = 0 to s.GetUpperBound(0)
do something with s(i) here
next i
Robert Bell - Product Manager - Horizon Control Inc.

tom
Posts: 224
Joined: Thu Jun 26, 2008 5:30 am
Location: The Netherlands

Re: (WIP) Martix setup

Post by tom » Sun Jan 04, 2009 4:39 pm

Cool, thanks. I wrestled with that first bit of code for a little but i could'nt make head nor tails of it :D

In the end i got it with :
(vbTab, ",")

then split(",")

I guess that was a bit redundant as i read split(vbTab) would have done it too. Oh well it works.
Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.

Post Reply