List,可以添加相同的值,还可以选择是前面还是后面添加。List中元素的顺序是添加时的顺序,本身不会自动排序。
Array索引值是从1开始,长度可以动态添加,重复赋值时,新值将替换旧值。
static void ArrListJob(Args _args) { List m_List = new List(Types::String); ListEnumerator m_ListEtor; Array m_Arr = new Array(Types::String); int m_ArrC; ; m_List.addEnd( " Andy "); m_List.addStart( " Judy "); m_List.addStart( " Luck "); m_List.addEnd( " ANDY "); info(m_List.toString()); info(strfmt( " count:%1 ",m_List.elements())); // 4 m_ListEtor = m_List.getEnumerator(); while(m_ListEtor.moveNext()) { info(m_ListEtor.current()); } info( " =========== "); m_Arr.value( 1, " A "); m_Arr.value( 1, " B "); m_Arr.value( 5, " C "); m_Arr.value( 3, " D "); for(m_ArrC = 1; m_ArrC <= m_Arr.lastIndex();m_ArrC += 1) { info(strfmt( " Key:%1 Value:%2 ",m_ArrC,m_Arr.value(m_ArrC))); } }
转载于:https://www.cnblogs.com/Kurodo/archive/2011/10/09/2203802.html