Page 1 of 1

Programming issues

Posted: 29 Feb 2012 15:39
by joebataz
I'm still having problems with programming Lemur, I spent most of yesterday looking for things on this forum and through the manual but am still stumped.
1. Can I read and write midi files directly?
2. How do I create/access global variables I create. i.e. If I create the following script in a Pad array triggered by OnLoad:

decl this, Banks;
this = getobject();
Banks = {'B1','B2','B3','B4'}
setattribute(this,'labels',Banks);

It works great, BUT if I create the following script triggered by OnLoad at the Project (Template) level:

decl Banks;
Banks = {'B1','B2','B3','B4'}

And put this into the Pad array at OnLoad
decl this;
this = getobject();
setattribute(this,'labels',Banks);

It doesn't allow the scrip, I get the warning icon, yellow triangle with red exclaimation point.

I also can't get the Project level script to work (same error) using:
decl this, Banks;
this = getobject(/Mixer/Pad);
Banks = {'B1','B2','B3','B4'}
setattribute(this,'labels',Banks);

or
this = getobject(Pad);

or
this = getobject(Mixer.Pad);

Nowhere in the manual have I been able to find getobject(). I can find getobjectrect() but not getobject().

3. Is there an estimate of when string manipulation and multidimensional arrays might happen?

Thanks,

joeb

Re: Programming issues

Posted: 29 Feb 2012 20:19
by bxsj
some quick answers
1. No
2. You need to define global variables either on the project or on the container level. Variables defined in a script are only valid inside the script.
3. Time will show, in the mean time we'll do without ;)
Hope that helps,
B.

Re: Programming issues

Posted: 01 Mar 2012 21:15
by joebataz
wow, I like your answers! no bs.

Re: Programming issues

Posted: 05 Mar 2012 07:45
by bxsj
Thanks for the flowers :) But here is some more information I found while messing around :oops:
"Local" variables can be accessed from outside via their address. That is the variable "testvar" in container "Cont1" can be acessed outside of container "Cont1" by "Cont1.testvar" ...
Lesson learned, never post something w/o testing all the possiblilities. I should have known better :roll:
Cheers,
B.