Say, I have a list list
and I don't want to assign different names to all its elements.
What I want to do it to be able to interactively manipulate any of the elements of list
. And if my selection of an element changes, then the slider of its value has to reset to its current value.
This is what I have tried (in fact, all this happens inside a massive DynamicModule
inside a Manipulate
):
list=Table[0,{i,1,100}];
Manipulate[
Refresh[x=list[[elementChoice]], TrackedSymbols:>{elementChoice}];
Refresh[list[[elementChoice]]=x, TrackedSymbols:>{x}];
,
{{elementChoice,1,"Element's number"},1,Length[list],1},{{x,0,"element's value"},0,1}]
but it just resets x
to zero if I try to change it.