From: Carl Date: 2007-11-21T14:45:02+09:00 Subject: Re: for loop Martin Durai writes: > Thank you carl, iam very new to this language > > sorry carl could you help with this code fully > > for( int i = namespaceEnd -1; i >= 0; i--) { > if( prefix.equals( namespacePrefix[ i ] ) ) { > return namespaceUri[ i ]; > } > > > thank you in advance > I suspect you're looking for the element in the namespaceUri array which is at the position determined by looking up the position of 'prefix' in the namespacePrefix array (how very unsettling). Assuming namespaceEnd is actually the count of elements in the namespacePrefix array, would this work? your_value = (i = namespace_prefix.index(prefix)) ? namespace_uri[i] : nil Where 'your_value' will now contain the namespace_uri value, or nil if it was not found in namespace_prefix If i've misunderstood your question, post back with the values of prefix, namespacePrefix, namespaceUri and namespaceEnd, and what you expect to get out of it and I'll see if I can't help.