Mohan kumar

Print keys in association

Discussion created by Mohan kumar on Jul 19, 2011
Latest reply on Aug 2, 2011 by Mohan kumar

Hi All,


I want to print all the keys (or) to reterive all the keys and store in the array..


for each string in someAssociation do{


This above code is used for print all value in the association. I want to print all the keys.


If i using the below code means, the loop is continuing without end.The first key is printing again & again with continous loop, it doesn't move to the next key.


until(Association.buildEnumerationOfKeys().hasMoreElements() is false) do{
dummyArray =  AssociationObj.buildEnumerationOfKeys().nextElement().toString().

print(dummyArray).// dummyArray is string.


AssociationObj.buildEnumerationOfKeys().nextElement(), these method doesn't help to move to the next element.


So, anyone plz tell Is there's any other method available used to move to next keys to print all the keys.


Whether enumeration helps to solve this problem means kindly tell how to declare and use enumeration in SRL.