for each... next problem

Results 1 to 2 of 2

Thread: for each... next problem

  1. #1
    Mark Molenaar Guest

    Default for each... next problem

    Hi,<BR>I have the folowing code:<BR><BR>Dim myElement <BR>For Each myElement in Request.Form<BR> stuff for the element...<BR>Next<BR><BR>It works fine except for one thing; the order in which the form-elements are handled doesn&#039t seem very logical to me. I expected that it would handle the form-elements top-down. Instead it uses a sequence I can&#039t figure out; it&#039s not alphabetical or something. Does anybody know in what order the elements are treated (on what basis)?<BR><BR>thanks in advance,<BR><BR>Mark.

  2. #2 Guest

    Default RE: for each... next problem

    lol you know I wondered the same thing back in the day.. I agree that it doesn&#039t seem like any logical order but the conclusion I came to was that it displays in the order, shortest to longest, of the element..<BR>for example if I have textbox1, textbox2, textbox3 in that order on a form and i enter in 000, 00, 0 and then tear through the results witha For Each Next its going to show it in this order: textbox3, ..2, ..1 .. <BR><BR>Why it does it based on length of the element, I have no idea =]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts