MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulate and Initialization


I think this is more what you asked.

Clear[nn];
Manipulate[n, {n,1,nn,1},
Initialization:>(nn=RandomInteger[{5,15}];Print[nn])]

"This works fine. The slider can be used in the range from 1 to the
printed value."

Ok.  Isolate the name of nn.

nn=23;
Module[{nn},
Manipulate[n, {n,1,nn,1},
Initialization:>(nn=RandomInteger[{5,15}];Print[nn])]
]

or use a different name than Global`nn which i think is clashing

Manipulate[n, {n,1,a`nn,1},
Initialization:>(a`nn=RandomInteger[{5,15}];Print[a`nn])]

(btw module actually uses $123nn as the name, and using Global`nn
would be 23)

Dynamic likely works because (xxx) but you may not want dynamic update
it might be too slow for your application.  So you might need the
above.



  • Prev by Date: Re: IntegerPart
  • Next by Date: Re: Side-by-side cells ("bilateral cells"): text and graphics side-by-side
  • Previous by thread: Re: Packages with data sets
  • Next by thread: Re: Side-by-side cells ("bilateral cells"): text and graphics side-by-side