MathGroup Archive 1999

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

Search the Archive

RE: creating input cell with unevaluated expression?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg20154] RE: [mg20089] creating input cell with unevaluated expression?
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Sat, 2 Oct 1999 03:05:10 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Aaron Gross wrote:
----------------------------
Can anyone tell me how to do the following?  I want to write an
expression that creates and inserts (at the current position in the
front-end) an input cell containing a given *unevaluated* expression,
just as if the user had typed it in himself.  For instance, I'd like
to create an input cell containing the expression "1+1", so that if
the user then evaluates the cell, he gets an output cell containing
"2".
--------------------------

Aaron, use CellPrint.


In[1]:=
CellPrint[Cell[BoxData[RowBox[{"1","+","1"}]],"Input"]]

1+1


--------------------
Regards,
Ted Ersek

For Mathematica tips, tricks see 
http://www.dot.net.au/~elisha/ersek/Tricks.html


  • Prev by Date: Re: Sorting problem
  • Next by Date: Re: Preventing plotting on output
  • Previous by thread: Re: Mathematica programming language
  • Next by thread: Re: creating input cell with unevaluated expression?