Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default looping question

    I'm trying to create a loop that splits the individual values in a comma
    delimited list and starts the loop at the first value from the list and ends at
    the last value. Is this possible? Then take the each value from the list and
    plug it in as a variable value in the Request.Form code. So, the request.form
    value would be: ddomenuAvalue1, ddomenuAvalue2, ddomenuAvalue3, etc. from the
    list. I was trying the following: Dim AlloLoop AlloLoop =
    Split(Request.Form('detlsidA'),', ') AlloLoopMax = UBound(AlloLoop) For p =
    AlloLoop[0] to AlloLoopMax Dim cmd_AlloUpdate__ddo cmd_AlloUpdate__ddo = ''
    if(Request('ddomenuA' + p) <> '') then cmd_AlloUpdate__ddo = Request('ddomenuA'
    + p) Next Is there a way to do this? I'm not sure of the correct way to
    accomplish this? Thank you, -D-

    -D- Guest

  2. Similar Questions and Discussions

    1. Looping .....Help!
      HI i want to publish a swf file that only loops 3 times and it has to be published version 5. Anyone have a sneaky piece of code for lopping a fixed...
    2. XML and looping
      Hey guys, I have a XML file as follows: <book> <Name>I Have a Dream</Name> <Price>3.00</Price> <Description>This is a great...
    3. [PHP] Looping through a list - Newbie question
      There are a lot of methods. The most common is using an array: $_SESSION = Array ("1","2","3","4","5"); foreach($_SESSION as $id) { echo $id; }...
    4. Looping through a list - Newbie question
      explode() and then foreach are your friends :) explode() using the comma as your separator and then traverse the array using foreach. ...
    5. Beginner w/Question on Scrolling Image(S) across the stage (endless looping) (0/2)
      Place each image inside its own symbol and then use a Motion tween to move them from one place to the next. Check www.flashkit.com for some very...
  3. #2

    Default Re: looping question

    For p = 0 to AlloLoopMax
    Request.Form("ddomenuA" + AlloLoop[p]);
    Next
    If you use AlloLoop[0] in the FOR part, there's no telling where your loop
    will attempt to start. Just using p in the request will just append the
    counter, not the value in your loop. Also, the way you've written it, only
    the last value will ever be used anyway. The loop immediately overwrites
    everything.

    Perhaps this will help: [url]www.drdev.net/article11.asp[/url]

    "-D-" <webforumsuser@macromedia.com> wrote in message
    news:cv564i$g62$1@forums.macromedia.com...
    > I'm trying to create a loop that splits the individual values in a comma
    > delimited list and starts the loop at the first value from the list and
    ends at
    > the last value. Is this possible? Then take the each value from the list
    and
    > plug it in as a variable value in the Request.Form code. So, the
    request.form
    > value would be: ddomenuAvalue1, ddomenuAvalue2, ddomenuAvalue3, etc. from
    the
    > list. I was trying the following: Dim AlloLoop AlloLoop =
    > Split(Request.Form('detlsidA'),', ') AlloLoopMax = UBound(AlloLoop) For p
    =
    > AlloLoop[0] to AlloLoopMax Dim cmd_AlloUpdate__ddo cmd_AlloUpdate__ddo =
    ''
    > if(Request('ddomenuA' + p) <> '') then cmd_AlloUpdate__ddo =
    Request('ddomenuA'
    > + p) Next Is there a way to do this? I'm not sure of the correct way to
    > accomplish this? Thank you, -D-
    >

    CMBergin Guest

  4. #3

    Default Re: looping question

    Hi CM, After some hair pulling today...I finally solved the problem. I needed
    to ammend the loop as follows: Just a section of the code here: Dim AlloLoop
    AlloLoop = Split(Request.Form('detlsidA'),', ') For i = 0 to UBound(AlloLoop) p
    = AlloLoop(i) Dim cmd_AlloUpdate__ddo cmd_AlloUpdate__ddo = ''
    if(Request('ddomenuA' &amp; p) <> '') then cmd_AlloUpdate__ddo =
    Request('ddomenuA' &amp; p) Next This has it working correctly. BTW, just
    wanted to extend my thanks to you again for all your help! I'm closing in on
    finishing up this application and it is working very nicely. Thanks again!:)
    Regards, -D-

    -D- Guest

  5. #4

    Default Re: looping question

    No problem. Hopefully you've saved some of your hair. ;)

    "-D-" <webforumsuser@macromedia.com> wrote in message
    news:cv5nmi$bkb$1@forums.macromedia.com...
    > Hi CM, After some hair pulling today...I finally solved the problem. I
    needed
    > to ammend the loop as follows: Just a section of the code here: Dim
    AlloLoop
    > AlloLoop = Split(Request.Form('detlsidA'),', ') For i = 0 to
    UBound(AlloLoop) p
    > = AlloLoop(i) Dim cmd_AlloUpdate__ddo cmd_AlloUpdate__ddo = ''
    > if(Request('ddomenuA' &amp; p) <> '') then cmd_AlloUpdate__ddo =
    > Request('ddomenuA' &amp; p) Next This has it working correctly. BTW,
    just
    > wanted to extend my thanks to you again for all your help! I'm closing in
    on
    > finishing up this application and it is working very nicely. Thanks
    again!:)
    > Regards, -D-
    >

    CMBergin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139