Message Boards Message Boards

0
|
2666 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Other procedures to Do[] something once?

Posted 3 years ago

Are there other ways to Do something once without additional overhead? Here's a short example, but I have instances with dozens of lines of code.

If[overwriteBrightBandsPlot,
  Do[
   Export[brightBandsPlotPNGfile, LPXH2];
   Print["Wrote LPXH2 to ", brightBandsPlotPNGfile];
   Print[];
   {},
   1]
  ];

I see that Block and Module support a procedure but they also create Temporary entities.

POSTED BY: Richard Frost
If[overwriteBrightBandsPlot,
 Export[brightBandsPlotPNGfile, LPXH2];
 Print["Wrote LPXH2 to ", brightBandsPlotPNGfile];
 Print[];
];

Should work as you thinkā€¦

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract