Help please

Results 1 to 4 of 4

Thread: Help please

  1. #1
    Jason Guest

    Default Help please

    how can i do something like this:<BR><BR>i = 1<BR>do while not ors.EOF<BR>vRoomTypeID(i) = ors("RoomTypeID")<BR>i = i + 1<BR>ors.MoveNext<BR>loop<BR><BR>I want it so I will end up with:<BR>vRoomTypeID1<BR>vRoomTypeID2<BR>vRoomType ID3<BR>etc..

  2. #2
    Join Date
    Dec 1969

    Default RE: Help please

    if you&#039;re trying to declare those as variables, sorry chief, you&#039;ll have to manually declare them. a shortcut though could be to create a script to write out all the varible names you want, then you can copy and paste those into your code.<BR><BR>a better suggestion would be to make it an array, which is apparently what you&#039;re trying to do in that loop. if that&#039;s not it, then please explain what exactly you&#039;re doing.<BR><BR>- me

  3. #3
    LeeAnnie Guest

    Default RE: Help please

    You cannot dynamically create variables in ASP. Trust me, I&#039;ve tried. LOL The best solution would be to just use an array.<BR><BR>As a side note, it is complete possible to name form input boxes dynamically on the client-side (from the server side of course). I do that when I have an unknown number of, say, pizza toppings, the user can select. I would do the following:<BR><BR>&#060;%<BR>x = 0<BR>set RS = "SELECT toppings FROM pizza;"<BR>do while not RS.EOF<BR>x = x + 1<BR>%&#062;<BR>&#060;input type="checkbox" name="topping&#060;%=x%&#062;" value="&#060;%=RS("topping")%&#062;"&#062;&#060;%= topping%&#062;<BR>&#060;%RS.MoveNext<BR>loop<BR>RS .Close<BR>set RS = nothing<BR>%&#062;<BR>

  4. #4
    Jason Guest

    Default Thanks

    I figured an array was the only option. Thanks for replying<BR>

Posting Permissions

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