<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Troubles with enum... in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140715#M2522</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I assume you are using CodeWarrior for HC12 V4.5. Am I right?&lt;/P&gt;&lt;P&gt;Basically the constants NUMBER, TEXT_1 and TEXT_2 &amp;nbsp;are defined in type view_tab_t.&amp;nbsp;They do not have global scope and are not available outside&amp;nbsp;of a variable of type&amp;nbsp;&amp;nbsp;view_tab_t.&lt;/P&gt;&lt;P&gt;If you wish to test against that constant you have to write:&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (viewTab.para_view == viewTab.TEXT_2) {&lt;/P&gt;&lt;P&gt;where viewTab is defined as&lt;/P&gt;&lt;P&gt;view_tab_t viewTab;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Another alternative to to define the enumerated type and its constant outside of the structured type view_tab_t.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Jun 2006 18:46:41 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2006-06-23T18:46:41Z</dc:date>
    <item>
      <title>Troubles with enum...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140714#M2521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;A class="jive-link-email-small" href="mailto:Hi@all"&gt;Hi@all&lt;/A&gt;,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I´m a newbie in programming with CodeWarrior and I´m porting software from my old compiler to the CodeWarrior and I faced a very confusing problem:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I had defined the structure:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;typedef struct&lt;BR /&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;BYTE menu_nr_left;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BYTE menu_nr_right;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; BYTE menu_nr_up;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;.....&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;enum&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; NUMBER=0,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; TEXT_1=1,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;TEXT_2=2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}para_view:2;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;unsigned int txt_idx;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; .....&lt;/DIV&gt;&lt;DIV&gt;}view_tab_t;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;During compiling of the sources I&amp;nbsp;get the error message that NUMBER, TEXT_1 and TEXT_2 are not declared. All declarations in this header are working fine except all enum´s. Please can anybody tell me, what I´ve done wrong?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance!&lt;/DIV&gt;&lt;DIV&gt;Thomas&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 14:35:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140714#M2521</guid>
      <dc:creator>ThomasH</dc:creator>
      <dc:date>2006-06-23T14:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with enum...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140715#M2522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I assume you are using CodeWarrior for HC12 V4.5. Am I right?&lt;/P&gt;&lt;P&gt;Basically the constants NUMBER, TEXT_1 and TEXT_2 &amp;nbsp;are defined in type view_tab_t.&amp;nbsp;They do not have global scope and are not available outside&amp;nbsp;of a variable of type&amp;nbsp;&amp;nbsp;view_tab_t.&lt;/P&gt;&lt;P&gt;If you wish to test against that constant you have to write:&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (viewTab.para_view == viewTab.TEXT_2) {&lt;/P&gt;&lt;P&gt;where viewTab is defined as&lt;/P&gt;&lt;P&gt;view_tab_t viewTab;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Another alternative to to define the enumerated type and its constant outside of the structured type view_tab_t.&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 18:46:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140715#M2522</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-06-23T18:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with enum...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140716#M2523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I have encountered the same thing with array definitions using constants defined using enum. The best way is to place the enum definitions in a separate file to give them file scope.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jun 2006 22:48:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140716#M2523</guid>
      <dc:creator>blewis</dc:creator>
      <dc:date>2006-06-23T22:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Troubles with enum...</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140717#M2524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Thanks for your helps!&lt;/P&gt;&lt;P&gt;I defined all enums outside the struct and now all works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 16:23:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Troubles-with-enum/m-p/140717#M2524</guid>
      <dc:creator>ThomasH</dc:creator>
      <dc:date>2006-06-30T16:23:16Z</dc:date>
    </item>
  </channel>
</rss>

