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


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

Re: Recognize multiple outputs

From Bob Hanlon <hanlonr@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Recognize multiple outputs
Date 2011-04-09 22:00 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <inqktp$e7k$1@smc.vnet.net> (permalink)

Show all headers | View raw


SetAttributes[assign, HoldFirst];

assign[x_, expr_] := 
  (Clear[x]; ToString[x] <> " = " <> ToString[TraditionalForm[x = expr]]);

assign[a, 10^2]

a = 100

You cannot use Out to reference the value.

Head[%]

String

But the variableis is set and can be used.

a

100


Bob Hanlon

---- "mailcwc@gmail.com" <mailcwc@gmail.com> wrote: 

=============
Is it possible to show the name of the variables in the output cell?
For example, currently I have
[In1] a=10^2
[Out1] 100

I want it to be
[Out1] a=100

The reason for this is when we have multiple lines of calculation in
an input cell,
sometimes it is hard to recognize which number is which,
especially when the input cell has several pages and the calculations
are scattered in the cell.


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


Thread

Re: Recognize multiple outputs Bob Hanlon <hanlonr@cox.net> - 2011-04-09 22:00 +0000

csiph-web