Page 1 of 1

Change interface with button (should be simple)

Posted: 01 Oct 2012 13:27
by jbgeluid
The manual states @Page 30:

The individual interfaces may be selected by tapping the appropriate tab, programmatically via the
selectinterface(index) built-in function or via OSC commands.

I want to create a switch anywhere in my project that switches to interface 9, (name in my project: 9.QB)

so I tried:
Create a button anywhere in my project (9 interface pages), behaviour:pad
create a script for this button, call it :action"
on expression "x"

then i tried various entries, none of them work: (asuming the first interface index is 0:)
interface8
interrface 8
/interface8
/interrface 8
selectinterface8
selectinterface 8
/selectinterface8
/selectinterface 8

then with the name of the interface (which is 9.QB)
interface9.QB
interrface 9.QB
/interface9.QB
/interrface 9.QB
selectinterface9.QB
selectinterface 9.QB
/selectinterface9.QB
/selectinterface 9.QB

then both in braces:
interface(8)
etc
interface(9.QB)
etc
interface (8)
etc
interface (9.QB)
etc
/interface(8)
etc
/interface(9.QB)
etc
/interface (8)
etc
/interface (9.QB)
etc

then I tried this:
at page 130 the manual states:
selectinterface(index) : displays the selected Interface
so I tried:
selectinterface(8) :
selectinterface(index) :8
selectinterface(index) : 8
selectinterface(9.QB) :
selectinterface(index) :9.QB
selectinterface(index) : 9.QB

/selectinterface(8) :
/selectinterface(index) :8
/selectinterface(index) : 8
/selectinterface(9.QB) :
/selectinterface(index) :9.QB
/selectinterface(index) : 9.QB




this is all not working....

Can anybody please help? This should be quite simple, but obviously I'm doing something wrong (The manual is NOT very clear to say the least. Just ad a REAL code-example for explanations please, because it will probably be due to a dot or ) or . or / missing somewhere that this is not working....

thanks, Jurgen

Re: Change interface with button (should be simple)

Posted: 01 Oct 2012 13:53
by nick_liine
Hi Jurgen,

The appropriate syntax is simply:

Code: Select all

selectinterface(<int>);
where <int> is the index of your Interface page, starting at zero. See the attached example, please let me know if that clears things up.

Best regards,
Nicolas

Re: Change interface with button (should be simple)[SOLVED]

Posted: 01 Oct 2012 14:30
by jbgeluid
Thanks, this works!

But the manual is WRONG!
the manual states @ page 130:
selectinterface(index) : displays the selected Interface
this should obviously be:
"selectinterface(index);" displays the selected Interface

Thanks for the quick reply!

Jurgen

Re: Change interface with button (should be simple)

Posted: 01 Oct 2012 16:39
by nick_liine
Hi Jurgen,

Glad to hear you've got it working. I can understand your confusion. The colon is used in the manual to provide explanations in plain english, it should not be taken as pseudo-code. Every valid statement in Lemur scripting takes a semi-colon.

Best regards,
Nicolas