| | |
How to Define size of variable string during runtime
![]() |
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........
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........
![]() |
Similar Threads
- How to define global variable in C# (C#)
- Parse a concatenated variable and string? (PHP)
- Workaround to (true)dynamic arrays (VB.NET)
- Another C++ N00B Begging For Help (C++)
- I need Help with Sorting Program (C)
- C preprocessor (C)
- problem with fstream (C++)
- Making hashes on the fly with name dictated by a variable string (Perl)
- having a small problem with the gets function (C)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: sql query error
- Next Thread: random number generation
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





