MathGroup Archive 2007

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

Search the Archive

Using .m files instead of .nb files in workbench

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79151] Using .m files instead of .nb files in workbench
  • From: Philipp <kitschen at romandie.com>
  • Date: Fri, 20 Jul 2007 03:15:17 -0400 (EDT)

Hello 
I'm starting with workbench and have some trouble understanding the expected workflow...

Before workbench, to make some calculation I would write an .nb file. For example:
-- frontend.nb --
  ClearAll["Global`*"];
  Remove["Global`*"];
  myFunction[x_]:=Sin[x]^2+Cos[x];
  Plot[myFunction[y],{y,0,2 Pi}];

But in workbench you can't write the .nb file (why?) so my current (bad) workaround is to write the content in a .m file like:
-- workbench.m --
myRun[]:= {
  ClearAll["Global`*"];
  Remove["Global`*"];
  myFunction[x_]:=Sin[x]^2+Cos[x];
  Plot[myFunction[y],{y,0,2 Pi}];
}

And then have a notebook to execute this
-- workbench.nb --
myRun[];


This is plain ugly for the following reasons:
1) I have to launch the.nb file from eclipse and then go to the frontend and execute the cell.
2) I can't use the "Outline" view in eclipse because it shows only myRun[] as a function.

I would like to be able to run my programs completely from inside Eclipse. The output can be shown in the Mathematica frontend, for example the plots etc (no problem there). 

How can I really start the excution of my program from inside Workbench?

Thanks for any answers. 

PS: Workbench is lacking the excellent "refactor" feature provided by eclipse for all other programming laguages and which is soooo useful in coding!


  • Prev by Date: Creating and Exporting layered PDFs? (in 5.2)
  • Next by Date: Slow Manipulate with image argument
  • Previous by thread: Creating and Exporting layered PDFs? (in 5.2)
  • Next by thread: Slow Manipulate with image argument