|
-
Sep 13th, 2000, 04:12 AM
#1
Thread Starter
New Member
i want to declare some variables in my program, but i dont know how many to declare, this is why i need to declare them dinamically.including declaring a different name for them.
how do i do this?
-
Sep 13th, 2000, 04:20 AM
#2
Hyperactive Member
As a start you can just declare a "dynamic" array in VB like that :
dim DynArray() as string
and each time you want to add an element to that array , you do it this way :
Redim Preserve DynArray (x)
DynArray(x-1) = "Hello" & x
as for declaring variables with new names at runtime ...
I dont know if it is doable in VB ... Not directly anyway ... I rather not say something of which I am not sure ...
Hope that helped
-
Sep 13th, 2000, 04:45 AM
#3
Hyperactive Member
can you not use a dynamic array?
Regards
Chris.
-
Sep 13th, 2000, 04:52 AM
#4
Hyperactive Member
Yes .. depends on your purpose .. but in this case why wouldnt you want to use a dynamic array????
-
Sep 13th, 2000, 05:06 AM
#5
Thread Starter
New Member
my biggest problem is naming the variables
my biggest problem is naming the variables
-
Sep 13th, 2000, 06:11 AM
#6
transcendental analytic
That shouldn't be a problem, unless they appear to be reserved keywords and functions. You could use prefixes like a, or ad for array or array dynamic, or so, but i wouldn't. Name your variables after their purpose.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|