Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    50

    Unanswered: how to create var from string

    people i try to create var from string statement

    for example i have variable bb
    dim bb
    bb = something

    this is explicit var declaration

    but if my task to create X variables, which i in future must access,
    for example i have loop

    for cc1 = 1 to 10 do
    create var cc1
    next

    or i have a array

    array("s1","s2","s3")

    for each c1 in array
    create var array[i]
    next


    it is possible to create var from string statement,

    if it is possible, then if it is possible to create in vb script ?????



    thanks

  2. #2
    Join Date
    Sep 2004
    Location
    San Diego, CA
    Posts
    3
    Your best bet is to use a hashtable which in ASP is done with the Scripting.Dictionary object:

    Code:
    Dim oVar
    
    Set oVar = Server.CreateObject("Scripting.Dictionary")
    For I = 0 To 10
    oVar("Item"&I) = aValue[i]
    Next

Posting Permissions

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