0

Hi to all, here is my question:-

i've declared an user defined type like this -

public type user
str() as string
end type

where str() is an string array with empty elements. now i want to create the elements dynamically. for that i wrote these -

dim x as integer
dim s as user

x=val(txtfields.text)-1
redim s.str(x)

where x is the variable which contains total no. of elements to be passed to the array. suppose if x contains 5 then the str() will become str(5). the array will populate with 5 elements.

to this point, it's completely ok. now the crutial thing is i also need to define the size of each elements like this - str(0) as string * 5; str(1) as string * 6, etc during runtime. now how can i do that? is there any possibility?

Plz reply on this............soon

Thanks in advance........

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by choudhuryshouvi
0

Hi,

No, u cannot change the Length of each string in that array, U have 2 work arounds :
Use a Collection
Or
Mantain a Seperate Array, which holds Corresponding Lengths of the string Array.. (Both linked with same Index)

REgards
Veena

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.