hi,
i already found the way to loop thru an enum, i think that way is useful for me.
 
anyway thx for ur suggestion.  :-)
 
rgds,
daniel


Varden Morris <[EMAIL PROTECTED]> wrote:
Hi Daniel
 

Add this function to the global class so that you will be able to call it anywhere in code in your Axapta application:

 

static int UniqueEnumCombo(int Enum1, int Enum2)

{

    return str2int(int2str(Enum1) + int2str(Enum2));

}

 

All this function does is to convert two integers to there respective string values then concatenate them and convert the result back to an integer. Remember that the internal representation of enum is integer. Note also that the order of the parameters is relevant. For example, 1 and 2 is different from 2 and 1 which will work for your case.

 

You can test this function in a job with the following code:

 

static void UniqueEnumComboTest(Args _args)

{

    ;

 

    switch (UniqueEnumCombo(1, 2))

    {

        case UniqueEnumCombo(3, 4):

            info(strfmt('%1',UniqueEnumCombo(3, 4)));

            break;

        case  UniqueEnumCombo(1, 2):

            info(strfmt('%1',UniqueEnumCombo(1, 2)));

            break;

 

    }

 

}

 

 

Varden Morris

 

J. Wray & Nephew Ltd. - Group I.S.

234 Spanish Town Road

Kingston 11, Jamaica, W.I.

 

Phone:  (876) - 923 - 6141 Ext. 2226
Fax:      (876) - 923 - 5372

Cell:      (876) - 3833566
Email:   [EMAIL PROTECTED]

            [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





Sharing the knowledge on Axapta.



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

Sharing the knowledge on Axapta.



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

Sharing the knowledge on Axapta.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to