hi nicolaan,
what u said is correct, i still need 16 pieces of codes although using loop.

i've found solutions for this issues, basically is using dictenum to get the enum values, although i still need 16 pieces of codes but its more readable and easier to maintain compare using if statement.

thx for ur initiative!

rgds,
daniel

nicolaan <[EMAIL PROTECTED]> wrote:


Hi Daniel,

If you need 16 different things to trap, you will need something like
you discribe I think. Looping won't really help you, because you
still need 16 different pieces of code. (if you don't please tell us
more)
What you could do......
Asssume enum1 and enum2 both have elements with values 0 .. 3.
What you now could do is this
switch (enum1 * 4 + enum2) {
case(enum1::valueA * 4 + enum2::ValueA) : all the code you need;
break;
}
This code has some potential danger, for example, what if you add
another element.

However it very much depends on what you need to do with these
enumvalues to know the best solution.

Regards,

Nico



--- In [email protected], "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.


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

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





Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to