Hey dear love Community,
I have a little bit Problems with a Function that I have written.
This is may Function:
( ~findParameter = {
arg list;
var lets, num, numus, ii;
num = list.size;
numus = 0;
for (0, num, { arg i; if( list.at(i)!=nil, {numus = numus + 1})});
numus = numus.rand-1;
lets = if ( numus > 0, {
ii = -1;
while(numus > 0, {
ii = ii +1;
if( list.at(ii)!=nil, {numus = numus - 1});
});
list.at(ii-1)}
,{ [1,1,1] });
[lets[1], lets[2]].choose;
})
which I have tested as Example with:
~findParameter.value([Nil, [1,2,3], Nil]);
The Problem seams to be the “While” in this Code.
I have tested and trying all, but it gives three Actions the Script will do when run:
-
I became the Standard Answer 1 see the If Structure
-
It crashed it explains the While Condition will not Change.
Can anybody give me a hint what I do here Wrong
In hope of Hints
CreCo
Thomas Lahme