Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign the integer variable inside the Array problem?

Status
Not open for further replies.

dormingo

MIS
Mar 2, 2006
12
MY
Hi all, I have confront the problem when I assign the integer variable into the array form, can somebody tell me how to solve it?
Example vbscript:

temvar="10" ' Declare the variable and assign it
avar=CINT(temvar) ' Convert the variable into integer

' How should I do if want to put the "avar value" inside the ******** Array places?

Dim myArray(******)

Thank you.
 
is this what you're after...

Code:
Option Explicit

Dim temvar : temvar = "10"
Dim avar : avar = CINT(temvar)
Dim myArray : myArray = Array()
ReDim Preserve myArray(avar)
WScript.Echo UBound(myArray)

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top