If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > how to create var from string

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-20-04, 13:35
marconi8 marconi8 is offline
Registered User
 
Join Date: May 2003
Posts: 50
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
Reply With Quote
  #2 (permalink)  
Old 09-20-04, 17:16
aspnuke aspnuke is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On