Book a Demo

Author Topic: How to - correct order of struct elements (C++)  (Read 3672 times)

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
How to - correct order of struct elements (C++)
« on: January 25, 2006, 01:26:44 am »
Hello everybody!

I've got a question concerning structs and their representation in the project browser.

if I have a struct like the following:
Code: [Select]

packed struct INTC_ICR_Bitfields
{
   unsigned char   Reserved  : 2;
   unsigned char   Level         : 3;
   unsigned char   Priority      : 3;
};


The browser displays the fields in alphabetical order as follows:

<<struct>>INTC_ICR_Bitfields
- Level
- Priority
- Reserved


This becomes a real problem when it comes to RTF doc generation, since the fields are not listed in the correct order!
The problem is the same for any kind of struct or union.

I tried to enable "Free Sorting" in the "Local Options" dialog, but it makes no difference.

Is there any workaround?

Thanks in advance,

Cheers Manfred
Best regards,
Manfred

thomaskilian

  • Guest
Re: How to - correct order of struct elements (C++
« Reply #1 on: January 25, 2006, 02:03:51 am »
Uncheck Tools/Options(Objects/Sort fields alpha...

Tuser

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
  • So much stuff to do, so little time...
    • View Profile
Re: How to - correct order of struct elements (C++
« Reply #2 on: January 25, 2006, 02:08:32 am »
Does this work for tagged values as well?

We have a profile with our own requirement classifier. The fields are such as

Delivery,
ID,
Need,
Notes,
Text

I would like the order

ID,
Need,
Delivery,
Text,
Notes

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: How to - correct order of struct elements (C++
« Reply #3 on: January 25, 2006, 02:44:12 am »
Hi Thomas,

That was quick!
Thank you very much, you just made my day!

:D

Is that new in 6.1, I don't remember that option in earlier versions?

Cheers Manfred
Best regards,
Manfred

thomaskilian

  • Guest
Re: How to - correct order of struct elements (C++
« Reply #4 on: January 25, 2006, 02:47:39 am »
Quote
Does this work for tagged values as well?
...

AFAIK: No. Tags are always sorted alphabetically. You might ask for an enhancement.

thomaskilian

  • Guest
Re: How to - correct order of struct elements (C++
« Reply #5 on: January 25, 2006, 02:48:52 am »
Quote
...

Yes Sire! I guess Sparx introduced that to confuse the Russians ;D

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: How to - correct order of struct elements (C++
« Reply #6 on: January 25, 2006, 04:07:40 am »
 8)  sht! don't tell'em...

;)
Best regards,
Manfred