Subj : Re: E4X for-each is eager To : Igor Bukanov From : McKinley, Richard Date : Fri Aug 20 2004 04:30 pm Ah, many thanks! This does the trick. for evaluates the second and third expressions with each iteration so this has the benefit of making clients..client.length() and moving target as I add elements to clients..client. In this case, this is exactly what I want. Kind regards, McKinley Igor Bukanov wrote: > McKinley, Richard wrote: > >> So, I'm reading the E4X spec. I did dicover the reason for for-each >> being eager: >> "The value of collection is computed once prior to performing steps >> and does not change while performing steps." >> >> I can accept that. Now, what I cannot find is the shortest route to >> getting a count of nodes. I need something like clients..client.length. > > > From ECMA 357: > > 13.5.4.14 XMLList.prototype.length ( ) > Overview > > The length method returns the number of properties in this XMLList > object. For example, > > for (var i = 0; i < e..name.length(); i++) { > print("Employee name:" + e..name[i]); > } > > > Regards, Igor > > > > > >> >> Thanks, >> >> McKinley >> >> McKinley, Richard wrote: >> >>> How can I keep my place otherwise? > > .