Author Topic: #ifdef #else #endif problem  (Read 12414 times)

Offline dirk_1980

  • Multiple posting newcomer
  • *
  • Posts: 25
#ifdef #else #endif problem
« on: April 30, 2009, 12:05:32 am »
Hi,
i am looking for a new IDE for me and i found CB.

So i'm new to CB (April 3 2009) and i have only 2 problems.

1.
How can i tell CB to analyse #ifdef #else #endif and ignore the undefined part?

It is impossible for me to see what ist going on in my Code.
Even CB can't find all Functions.

2.
How can i tell CB to make a backup when i save a File (not Autosave after x minutes)?

Dirk

 
« Last Edit: April 30, 2009, 12:43:33 am by dirk_1980 »

Offline dirk_1980

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: #ifdef #else #endif problem
« Reply #1 on: May 04, 2009, 04:35:19 pm »
Hi,

this is really interesting.
Anybody is using #idef but no one cares about:
- several declarations of variables or functions
- different code for test or customer versions (in one file)

#define customer_a
//#define customer_b
//#define LED
#define LCD

#ifdef customer_a
#ifdef LED
#define MAX 12
unsigned char Test;
#else
#define MAX 10
signed char Test;
#endif
#else
#ifdef LED
#define MAX 21
unsigned long Test;
#else
#define MAX 19
signed short Test;
#endif
#endif


Test is what type ?
MAX is ?

And this is just a easy example.


It's also interessant that never someone was mising a automatical backup.

Dirk
« Last Edit: May 04, 2009, 04:36:50 pm by dirk_1980 »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: #ifdef #else #endif problem
« Reply #2 on: May 04, 2009, 04:41:02 pm »
1. C::B doesn't have a good pre-processor parser. So #ifdef support is incomplete.
2. Settings > Environment > Autosave > Method > Create backup and save to original file.
Be a part of the solution, not a part of the problem.

Offline dirk_1980

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: #ifdef #else #endif problem
« Reply #3 on: May 04, 2009, 05:00:36 pm »
1. is there a editor with better pre-processor parser or is this somthing what is comming to C::B ?

2. this is only working with autosave after x minutes and not with SAVE (Ctrl-S)
Dirk