Preprocessor comment prefix changed to //#

There were complains that preprocessor is to aggressive in removing comments starting with "//--". Some users and project use comment lines full of dashes to separate blocks of code. This project became unusable with Mobility Pack and its preprocessor because the prefix "//--" was removed from the lines with comments.

Mobility team decided to fix this problem. Preprocessor comment prefix will be "//# " from now. We've already used "//#" as start of preprocessor directive. So this prefix is reserved. If you use "//#----------" as special type of comment then it'll be marked as unexisting preprocessor directive and only warning appears. Your code will be still valid and compilable.

In Betas (1 or 2) you could have this code
        //#if CLDC == "1.0" 
//--            Display.getDisplay(this).setCurrent(new TextBox("CLDC", "is 1.0", 20, 0x0));
        //#elif CLDC == "1.1"
            Display.getDisplay(this).setCurrent(new TextBox("CLDC", "is 1.1", 20, 0x0));
        //#else
//--            Display.getDisplay(this).setCurrent(new TextBox("CLDC", "is unknown", 20, 0x0));
        //#endif
It will look a little bit different in builds after 11/30
        //#if CLDC == "1.0" 
//#             Display.getDisplay(this).setCurrent(new TextBox("CLDC", "is 1.0", 20, 0x0));
        //#elif CLDC == "1.1"
            Display.getDisplay(this).setCurrent(new TextBox("CLDC", "is 1.1", 20, 0x0));
        //#else
//#             Display.getDisplay(this).setCurrent(new TextBox("CLDC", "is unknown", 20, 0x0));
        //#endif
You don't have to worry that all preprocessor prefixes will be changed in your source code. Only modified or new lines in preprocessor block in active configuration will be converted to the new syntax and saved when you'll save document with the changes. If you only switch configuration then the comment prefix of unactive block will change in editor but not on the disc.
It's because the document is always saved in DefaulConfiguration. It ensures that all developers working on the same project in cvs will have the sources in the same status.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

This is the main channel to share news, tips and other stuff related to my work. Sometimes you can find even personal stuff. Enjoy your reading...

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
news
Blogroll

No bookmarks in folder

OldNews
MyTrash
NavBar
NetBeans
LinksToBeExpanded