Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14026

Re: Manipulate and Initialization

From debguy <johnandsara2@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Manipulate and Initialization
Date 2013-04-03 07:22 +0000
Message-ID <kjglbc$p44$1@smc.vnet.net> (permalink)
References <20130323072431.19F0E6A0D@smc.vnet.net> <kimcog$pr5$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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.

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Manipulate and Initialization Bob Hanlon <hanlonr357@gmail.com> - 2013-03-24 08:16 +0000
  Re: Manipulate and Initialization debguy <johnandsara2@cox.net> - 2013-04-02 07:25 +0000
  Re: Manipulate and Initialization debguy <johnandsara2@cox.net> - 2013-04-03 07:22 +0000

csiph-web