Creating Variables On The Fly?

Results 1 to 4 of 4

Thread: Creating Variables On The Fly?

  1. #1
    K. Zig Guest

    Default Creating Variables On The Fly?

    I would like to have my program create variables on the fly. Is this possible? I have a "Do WhileLoop" in my code which loops as many times as the number from the database resultequals. Each time it loops, it subtracts 15min from a time variable.<BR>I would like the new time result to be stuffed into a NEW variable each time the loop occurs.Please let me know if this is possible or if there is a better way. Also is it possible to have a do while loop with in a do while loop?

  2. #2
    suresh jeyakumar Guest

    Default RE: Creating Variables On The Fly?

    u can nest do while loops .<BR><BR>i didnt get ur question on the variable creation on the fly???? can u get me an explanation may be i can try to solve ur problem

  3. #3
    K.Zig Guest

    Default RE: Creating Variables On The Fly?

    First of all, would this be the proper way to nest a "do while loop"<BR><BR>Do while not objRS.EOF<BR> if strStartime&#062;0 then<BR> do while strStarttime &#060; strEndtime<BR> strStarttime = strStarttime + 15<BR> Loop<BR> End If<BR> objRS.MoveNext<BR>Loop<BR><BR>About creating variables on the fly:<BR>look at the code above where the second "do While Loop" starts. Now for each time this thing loops and adds 15, I want the "strStarttime + 15" to become a variable.<BR><BR>Lets say that "strStarttime = 30" and "strEndtime = 60". This will cause it to loop twice. On the first loop when it adds 15 I want a new variable to appear with this value (strStarttime(2)=30) and the second variable to appear would be<BR>strStarttime(3)=45).<BR><BR>Is this possible?

  4. #4
    Join Date
    Dec 1969

    Default RE: Creating Variables On The Fly?

    You can use eval:<BR>JS/VBS5<BR>eval("var Name+" iloopCount + " = "&#039abc&#039")<BR>Or you can use session variables (beware the lost variable names) <BR>Session("Name" & iloopCount) = "abc"<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