Skip to main content
13 events
when toggle format what by license comment
Apr 4, 2013 at 7:06 comment added Albert Retey @IstvánZachar: no, I don't know why Print from within a Dynamic goes to the Messages notebook and also don't know of a way how to change that behavior. My guess is that it is like it is to prevent e.g. dialogs containing Dynamic to be misshaped by accidental printed output. What you could do is to define a function which CellPrints a "Print"-style cell to EvaluationNotebook[], but that might behave slightly different...
Apr 3, 2013 at 19:58 comment added István Zachar @Albert As a side-question, do you happen to know why Dynamic[Print["x"]] prints to the Messages notebook and how to change the target of evaluation to the actual notebook the code is written?
Apr 12, 2012 at 15:59 history edited F'x CC BY-SA 3.0
edited body
Apr 12, 2012 at 12:26 history edited Albert Retey CC BY-SA 3.0
corrected statement about overall Dynamic
Apr 12, 2012 at 10:57 comment added Nothingtoseehere Thanks for the Dynamic module tip. I did try it in the early stages of the code but will do so again to see if the results will plot. Thanks again for your help!
Apr 12, 2012 at 10:30 history edited Albert Retey CC BY-SA 3.0
elaborated on possible improvements of example code
Apr 12, 2012 at 2:29 comment added Nothingtoseehere @ Albert Retey please elaborate. I would certainly love to learn more. Thanks!
Apr 11, 2012 at 20:34 comment added Albert Retey @RHall: When Print[Dynamic[a]]; will show something and Print[a]; does not I think you are facing a problem of evaluation order. It looks like a is only set to the value you expect to see after the Print. It's nice that you accepted my answer, but I still think your actual problem isn't solved and it's related to your "unconventional" usage of Dynamic. If you are still interested I can elaborate on some of the things that make me believe this...
Apr 11, 2012 at 20:20 vote accept Nothingtoseehere
Apr 11, 2012 at 20:20 comment added Nothingtoseehere @ Albert Retey yes thanks, the results did print to the message nb with a twist it worked in my code also. I used: Print[Dynamic[a]]; and the results went to the message nb. Thanks very much!
Apr 11, 2012 at 19:52 comment added Albert Retey Have you tried my simple example and verified whether it does print to the Message notebook or not? I don't think that it does matter very much whether or not you do terminate the Print with a ; or not, that will only effect what will be returned. If you remove the ; then the Print will work as before, but there will an additional Null be multiplied to the value shown. Print writes as a side effect which will happen when Print is evaluated, that's completely independent from what's happening with its return value...
Apr 11, 2012 at 19:36 comment added Nothingtoseehere Thank you for your kind advice @Albert Retey, but the nb variables must be controlled by sliders and also update a 3D plot Dynamically. This code was tested as static. I do very much appreciate your advice. Thanks also for your suggested tutorials. The main issue here is that each suggestion to Print is unterminated, and will cripple the code. If the Print[]; is terminated as in normal MMA print statements they are effectively silenced in a Dynamic Wrapper. Thanks again for your help!
Apr 11, 2012 at 19:09 history answered Albert Retey CC BY-SA 3.0