|
-
Jun 13th, 2000, 02:18 AM
#1
Thread Starter
New Member
Hi,
I am facing a strange challenge..please help me out in that....
Is it possible to constitue a method name using string concatation and then call that method?
for example.. can I do something like this ?
dim str as string
str = "create" + "storer"
call str
or
str
this doesn't work and it will not, certainly....then what is the way to do this kind of stuff? please guide me to solution of this..
Thanks and regards
Mehul
-
Jun 13th, 2000, 04:44 AM
#2
what you are calling will be empty.
it will do nothing.
if you create the stuff before hand you can use a couple combo or list boxes, and when someone clicks a buton, you could do this
Code:
If List1.Text = "create" and List2.Text = "storer" Then
Call createstorer
End If
I am not sure if this will work, but you may be able to do this.
Code:
Select Case List1.Text & List2.Text
Case "createstorer"
Call createstorer
Case "etc"
call Etc.......
End Select
oh. one more thing, its best to use the Ampersand(&) in string concatation.
because Vb may try to recognize + as an arithmatic operator.
-
Jun 13th, 2000, 04:57 AM
#3
Frenzied Member
There's a CallByName Function If you know where the function's contained. for example if you knew that createstore was in an object clsCreate then you could use
Code:
CallByName clsCreate, "createstore"
but I'm not sure about what to do I'f you don't know the object.
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
|