MathGroup Archive 2008

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

Search the Archive

Re: Convert to Expression

Namrata Khemka wrote:
> Hi everyone,
> I have a question regarding using "Show Expression".
> If you select a cell and then go to "Format" -> Show Expression.
> For  example:
> Plot[x, {x, 1, 3}]
> Selecting the cell and going to format->Show Expression one gets:
> Cell[BoxData[
>      RowBox[{"Plot", "[",
>        RowBox[{"x", ",",
>          RowBox[{"{",
>            RowBox[{"x", ",", "1", ",", "3"}], "}"}]}],
>        "]"}]], "Input"]
> Is there a command to get this Expression that one can type in instead
> of using the menu bar?
> Thanks very much,
> Namrata Khemka

I am guessing that you are looking for something that you can use within 
a program:

ToBoxes[Unevaluated[Plot[x, {x, 1, 3}]]]

Note that the Unevaluated wrapper is required in order to stop the 
command evaluating. If you want to see the result of the evaluation, 
leave this wrapper off. The output from ToBoxes does not include the 
Cell wrapper, so you can add that if you require it.

David Bailey

  • Prev by Date: Non-Linear Graphics Scaling
  • Next by Date: ResetMenusPacket
  • Previous by thread: Re: Convert to Expression
  • Next by thread: Re: Convert to Expression