# Script Warning: control ID was not declared



## derstefmitf (Jan 9, 2014)

Hi, 

I am currently working on an Kontakt instrument witch two tabs which change the performance view. Actually everything works just fine, but every time I change between the two tabs I get the following warning in the status line: 

SCRIPT WARNING: control ID was not declared

I mean, right now, it's just a message and I cannot see that something is not working correctly, but still I would like to know what's the meaning of that message. 

Thanks :D


----------



## mk282 (Jan 9, 2014)

That means the script tried to adjust a GUI ID that does not exist. Check your while loops etc.


----------



## derstefmitf (Jan 9, 2014)

Ok, I'll check this.

Thank you.


----------



## kotori (Jan 9, 2014)

mk282 @ Thu Jan 09 said:


> That means the script tried to adjust a GUI ID that does not exist. Check your while loops etc.



But why would it be triggered by switching tab? That's a bit odd. (Unless it's actually the subsequent interaction with the UI that triggers the warning - that would make more sense)


----------



## Lindon (Jan 10, 2014)

He's probably making visible/invisible controls using arrays of GUIDs he set up at init. Either one of the values is wrong or he's reading past the end of the array...

Just a guess...


----------



## kotori (Jan 10, 2014)

Lindon @ Fri Jan 10 said:


> He's probably making visible/invisible controls using arrays of GUIDs he set up at init. Either one of the values is wrong or he's reading past the end of the array...
> 
> Just a guess...



Sure. I just meant that it's unexpected that switching performance view tab should in itself trigger any action. For that reason I'm a bit doubtful of whether the tab switch is really relevant.


----------



## Maxime Luft (Oct 20, 2017)

Old thread, I know, but I came across this problem yesterday and wanted to take a look at what's been discussed here before looking into my few thousand lines of code...


As you don't get any indication of where the problem occurs and your library may work fine though, I suggest you focus on your arrays and look at the number of elements you declared. In my case it looked a bit like the following:


*declare %microphone_slider[3] *_(num of elements = 3, but 4 elements declared then)_
%microphone_slider[0] := get_ui_id($micposition1) 
%microphone_slider[1] := get_ui_id($micposition2)
%microphone_slider[2] := get_ui_id($micposition3)
*%microphone_slider[3] := get_ui_id($micposition4) -> "Control ID was not declared" message*


_*Should be:*_


*declare %microphone_slider[4] *_(4 elements are going to be declared)_
%microphone_slider[0] := get_ui_id($micposition1) 
%microphone_slider[1] := get_ui_id($micposition2)
%microphone_slider[2] := get_ui_id($micposition3)
%microphone_slider[3] := get_ui_id($micposition4) _-> 4th element of the array, as declared earlier_


----------

