Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Manipulate[] CreateDocument[] BUG ???

  • To: mathgroup at smc.vnet.net
  • Subject: [mg81392] Re: Manipulate[] CreateDocument[] BUG ???
  • From: shirahsong at gmail.com
  • Date: Fri, 21 Sep 2007 03:14:31 -0400 (EDT)
  • References: <fct8vr$pu5$1@smc.vnet.net>

I think that you are wanting something more like

CreateDocument@Manipulate[Module[{k}, k = 1; k*s], {{s, 1}, 1, 10}]

i.e., put the localization of the variable within the Manipulate.

Remember that, in your original form, the document that gets created
contains an instance of the localized variable, but that the generated
document is occuring ourside of the Module (i.e., it is returned from
the module) and so it has a "orphaned" local variable.


On Sep 20, 3:54 am, roby.no... at gmail.com wrote:
> hi everyone, i try to set up two or more Manipulate[] Panels
> originated in seperate notebooks.
>
> for the creation of the notebooks i use CreateDocument[]
> the code below defines a function A when invoked creates a notebook
> containing one Manipulate[] Panel
> then A is invoked twice such that 2 notebooks are generated.
> but when i try to move the slider s in both Panels the local variable
> k gets somehow corrupted.
> changeing Module to DynamicModule does not help.
>
> same code works fine if CreateDocument@ ommited, then two Manipulate[]
> are generated and working fine but both inside the current notebook.
>
> any clues on whats happening ?
> is it a bug or a feature  ?
>
> (*----------------------------------*)
>
> (* corrupt example*)
> A := Module[{k},
>         k = 1;
>         CreateDocument@Manipulate[
>                 k*s,
>                 {{s, 1}, 1, 10}
>         ]
>    ];
> A
> A
>
> (*----------------------------------*)
>
> (* working example *)
> A := Module[{k},
>         k = 1;
>         Manipulate[
>                 k*s,
>                 {{s, 1}, 1, 10}
>         ]
>    ];
> A
> A
>
> (*----------------------------------*)




  • Prev by Date: Re: DSolving(?) for a given tangent
  • Next by Date: Boundary problems
  • Previous by thread: Re: Manipulate[] CreateDocument[] BUG ???
  • Next by thread: Re: Manipulate[] CreateDocument[] BUG ???