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!

assig to array

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
hi guys....

actually i have a text box and a button. when i fill a string in the text box and click on the button , i want the string to be the element of an array(so that i can use it). The array size will depend on how many time user key in in the text box and click the button. E.g:
textbox value =1234 , user click button
textbox value =1001, user click button
textbox value =1256, user click button

so the array will be:

ArrGetValue(0)=1234
ArrGetValue(0)=1001
ArrGetValue(0)=1256

how to do this?
please help

Thanks alot
 

I assume that you meant

ArrGetValue(0)=1234
ArrGetValue(1)=1001
ArrGetValue(2)=1256

You can do something like
Dim ArrGetValue()

First time:
redim ArrGetValue(0)
ArrGetValue(0) = YourValue

Then:
redim preserve ArrGetValue(Ubound(ArrGetValue)+1)
ArrGetValue(Ubound(ArrGetValue))= YourValue


Sunaj
 
Thanks... i try to do that, but the problem is when the button is press, the form will be submitted and the whole array will be initialize. it doesn't preserve the previous value. Is there any sample code on this ?(i mean full sample) thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top