Group Abstract Group Abstract

Message Boards Message Boards

0
|
9K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

Make Button as an additional output of a Module?

Posted 7 years ago
POSTED BY: Juerg Baertsch
4 Replies
test[zahl_] := Module[{zahlM}, zahlM = ToBoxes[zahl];
      Print[Button[DisplayForm[zahlM], 
        CopyToClipboard[
         StringJoin["$", ToString[TeXForm[HoldForm@zahl]], "$"]]]];
      zahl]
POSTED BY: l van Veen
Posted 7 years ago
POSTED BY: Juerg Baertsch
POSTED BY: Kuba Podkalicki
Posted 7 years ago

The little program was just an example. You changed in way, that doesnt answer my question. The two variables in Button are both local defined. If possible, this shoudnt be changed. But if there is no such solution, I put the value of the local "zahl2" in the global "zahl3", then it works.

test[zahl_] := Module[
   {zahl1, zahl2},

   zahl1 = 5;
   zahl2 = 10;
   zahl3 = zahl2;

   Print[Button[zahl1, CopyToClipboard[zahl2]]];
   Print[Button[zahl1, CopyToClipboard[zahl3]]];

   Return[zahl];
   ];
POSTED BY: Juerg Baertsch
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard