Re: AW: [development-axapta] operation from combination of enum

2005-03-17 Thread daniel lim


hi jesper,
 
thx for ur suggestion, ur solutions is most useful for me among all.i will only 
need 2 "for loop" for 2 enum with 4 elements each. thx very much.
 
rgds,
daniel

[EMAIL PROTECTED] wrote:

Hi

You can loop over an enum like this



static void EnumTest(Args _args)

{

SysDictenum dictEnum;

Counter counter;

;



dictEnum = new SysDictEnum(EnumNum(ABC));



for (counter = 0; counter < dictEnum.values(); counter++)

{

print dictEnum.index2Name(counter);

}

pause;

}







Yf

jesper





Von: Hans-Walter Bous [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 17. März 2005 09:21
An: development-axapta@yahoogroups.com
Betreff: Re: [development-axapta] operation from combination of enum




Hi,
you can do something like this:
switch (enumA)
{
  case(enumA::TypeA):
 switch (enumB)
 {
  case(enumB::TypeA) :
   do something;
   break;
 }

}
John

daniellim_yh <[EMAIL PROTECTED]> wrote:


hi all,

i have 2 enum type, 4 elements each, i wonder wat is the best way 
for me to do
like this in axapta.

if (enum1::typeA && enum2::typeW)
   Do something1
else
   if (enum1::typeA && enum2::typeX)
  Do something 2
   else
  if (enum1::typeA && enum2::typeY)
  do something 3

  .  
  .
  .
  .
  if (enum1::typeD && enum2::Z)
do something 16

with 2 combinations of 2 enums i will have 16 combinations, any 
better 
way of it?using enum element position to do looping may be?but as
i know i cannot get enum position like container. 

pls provide any idea. thx in advance.

rgds,
daniel







Yahoo! Groups SponsorADVERTISEMENT


-
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



-
Gesendet von Yahoo! Mail - Jetzt mit 250MB kostenlosem Speicher

[Non-text portions of this message have been removed]









Yahoo! Groups Sponsor



ADVERTISEMENT

 click here


  

 



  _  

Yahoo! Groups Links

*  To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
  
*  To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]  
  
*  Your use of Yahoo! Groups is subject to the Yahoo! 
  Terms of Service. 



[Non-text portions of this message have been removed]





Yahoo! Groups SponsorADVERTISEMENT


-
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



-
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 

[Non-text portions of this message have been removed]






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 






AW: [development-axapta] operation from combination of enum

2005-03-17 Thread jesper.joergensen





Hi

You can loop over an enum like this

 

static void EnumTest(Args _args)

{

    SysDictenum dictEnum;

    Counter counter;

    ;

 

    dictEnum = new SysDictEnum(EnumNum(ABC));

 

    for (counter = 0; counter < dictEnum.values(); counter++)

    {

    print dictEnum.index2Name(counter);

    }

    pause;

}

 

 

 

Yf

jesper

 

 

Von: Hans-Walter Bous [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 17. März 2005 09:21
An: development-axapta@yahoogroups.com
Betreff: Re: [development-axapta] operation from combination of enum

 


Hi,
you can do something like this:
switch (enumA)
{
  case(enumA::TypeA)    :
 switch (enumB)
 {
  case(enumB::TypeA) :
   do something;
   break;
 }

}
John

daniellim_yh <[EMAIL PROTECTED]> wrote:


hi all,

i have 2 enum type, 4 elements each, i wonder wat is the best way 
for me to do
like this in axapta.

if (enum1::typeA && enum2::typeW)
   Do something1
else
   if (enum1::typeA && enum2::typeX)
  Do something 2
   else
  if (enum1::typeA && enum2::typeY)
  do something 3

  .  
  .
  .
  .
  if (enum1::typeD && enum2::Z)
    do something 16

with 2 combinations of 2 enums i will have 16 combinations, any 
better 
way of it?using enum element position to do looping may be?but as
i know i cannot get enum position like container. 

pls provide any idea. thx in advance.

rgds,
daniel







Yahoo! Groups SponsorADVERTISEMENT


-
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


    
-
Gesendet von Yahoo! Mail - Jetzt mit 250MB kostenlosem Speicher

[Non-text portions of this message have been removed]









Yahoo! Groups Sponsor



ADVERTISEMENT
  click here


   

 

  _  

Yahoo! Groups Links

*  To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
  
*  To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]  
  
*  Your use of Yahoo! Groups is subject to the Yahoo!   Terms of Service. 



[Non-text portions of this message have been removed]













Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ 
To unsubscribe from this group, send an email to:[EMAIL PROTECTED] 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.