Message Boards Message Boards

0
|
7670 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Using Echo with Lexical Scoping Constructs

Posted 5 years ago

Hello All, I would like to use Echo to debug user-defined functions which are called up by Manipulate but have found that Manipulate suppresses the Echo. To give an example, the following works fine:

echoFn[x_] := Module[{},
  Table[Echo[y], {y, 1, x}]
  ]
    echoFn[10];

However, when I insert the "echoFn" inside a function with lexical scoping such as Manipulate, as expected the Echo is suppressed (see attached Notebook).

echoFn[x_] := Module[{},
  Table[Echo[y], {y, 1, x}]
  ]
Manipulate[
 echoFn[tmp], 
 Control[{{tmp, 5, "tst1"}, 1, 10, 1, Appearance -> "Labeled", 
   ImageSize -> "Small"}]
 ]

Can anyone think of a work around for this?

Many thanks.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract

Be respectful. Review our Community Guidelines to understand your role and responsibilities. Community Terms of Use