Forum Discussion

asmatullah's avatar
asmatullah
Contributor
10 years ago

How to implement Enum in Scripting

Hi , I want to use enum in my script . I am using Java script for spriting . Can any one tell me how to implement this . Thanks , Asmat
  • sbkeenan's avatar
    10 years ago
    Hi Asmat



    Does this help:





    function myTest()

    {

      
    var TState = ["InTest", "Done", "Deferred", "Cancelled"];

      
    var TStateEnum = new Enumerator(TState);

      
    var currTState;



      
    while (! TStateEnum.atEnd())

      
    {

         
    currTState = TStateEnum.item();

          Log.message(currTState);

         
    TStateEnum.moveNext();

      
    }

    }







    Regards

    Stephen.