Shopping Cart | Contact us | Partners | Customers

Project Management

Code/Comment Formatting

Browse Window
Header Files

Understand code in less time with Crystal C/C++
View Demo
Crystal FLOW for C
Crystal FLOW for C++
Crystal REVS for C
Crystal REVS for C++

Quick Reference Guides
Home Tips & FAQ Code and Comment Formatting Code and Comment Formatting Of Quick Reference Guides
Q. How to enable or disable formatting

If "Always format Full File" is selected
When you open a file, Crystal C formats the whole file.
As you edit a file, Crystal C formats the lines that you modify or add to the file.
This mode gives you the full advantage of Crystal C's formatting.
If "Format Modified Lines Only" is selected
When you open a file, crystal c does not format the file.
As you edit the file, crystal c formats the lines that you modify or add to the file.
Every line in your file remains unchanged except when you modify it.
This mode is useful if your s/w standard requires that a line that is altered in any way will have to be reviewed by another team member.

If "None" is selected
Crystal C does not format the file - neither when you open it nor when you edit it.


Q. How do I control comment-formatting ?

When Comment "Disable" is selected,
Comments after the statements / declarations are left untouched. The comment-field is not created.

When Comment "Enable" is selected,
Comments that are at the end of statements or declarations are moved to the comment-field to the right. Also,

If "Braces" is selected, then click [Remove File].
indent-level of braces is displayed in comment-field.

If "Angle Brackets" is selected,
empty angle brackets are inserted in the comment-field of declarations even when no object meanings are present.

If "Empty Comments" is selected,
the comment-field is added after a statement or declaration even when there is no comment after the statement or declaration.


Q. Can I customize indent-space and tab width ?

In Format Settings' General card : ,
You can set
  the number of spaces per indent
the tab size (tabs and indents are independent of each other.)

When "Keep Tabs" is selected,
Crystal C replaces consecutive spaces with equivalent tabs when you save a file.

When "Replace tabs with spaces" is selected,
Tabs are replaced with appropriate spaces when you save a file.

When "None" is selected,
The tabs and spaces are left unchanged when you save a file.
This option is useful when you do not wish Crystal C to alter any pre-existing source lines unless you modify them.

Q. Whether comment delimiters be specified ?

When Use '//' as standard comment delimiters is selected,
Crystal C uses the '//' instead of the '/* and */' as standard comment-delimiters for the comment-field added after a statement or a declaration.


Q. How to apply the new format settings to old and new files ?

When Crystal C opens a file for the first time,
it uses the current Settings to format the file and saves the format settings on a per file basis.
When you open the file again, the saved format settings are used for that file.

If you select "Apply changes to all files",
Crystal C will apply the new format settings to a file whenever it opens that file - even if format settings were saved for it before.

To apply the new settings to a currently open file,

Click File Refresh Current File.

If you modify the file in another editor and then open the file in Crystal C, the current Settings are used to format the file.


  © Copyright 2023, SGV Sarc, All Rights Reserved. | Privacy Policy | Disclaimer | Sitemap