Message Boards Message Boards

1
|
8019 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

What is "Code" format for a cell?

Posted 9 years ago

On opening the window with Format|Style there is something called "Code" between "Text" and "Input". Could someone illustrate me on its meaning?

-Tomas

POSTED BY: Tomas Garza
4 Replies

In regular Mathematica one would normally use Input cells.

Code cells are used in package.m files. They contain the code for the routines, not Input cells. You can switch between the two cell types by selecting the right hand cell bracket and using Alt+8 (for Code) or Alt+9 (for Input}. Old inactive code can be saved as Input cells in packages. It is sometimes useful to swtich package usage Code cell to Input for editing. I find that switching from Code to Input cells for editing regular code is a problem. Maybe it's the disparity in AutoIndent. But one can use Returns and spaces to pretty print Code cells and maybe higher magnification.

Also remember that one can use Title, Section and Text cells in package files so they can be well organized and formatted.

Thank you, Dave. As always, your comments are extremely valuable.

POSTED BY: Tomas Garza

Thanks a lot, Nasser. Most helpful.

POSTED BY: Tomas Garza
POSTED BY: Nasser M. Abbasi
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