473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Executing string Function

KG
Hi,
Can I put a function name in a string and run that function.
For example

Function dbVersion01()
....
....
End Function

Dim strFunction as String ="DbVersion01"
Call strFunction

Something like that using delegate or some other way.

Thanks in advance
KG

Nov 21 '05 #1
2 908
KG,

I asked this more to people and never got an answer, you know that those
functions should exist, so you can do this in a case select very easy.
However than comes these questions to do this with a kind of late binding
using reflection.

http://msdn.microsoft.com/library/de...reflection.asp

Why do you want this while it is so easy in a "case select" and test with
that direct all errors?

Cor
"KG" <kg****@csystemssoftware.com>
Hi,
Can I put a function name in a string and run that function.
For example

Function dbVersion01()
....
....
End Function

Dim strFunction as String ="DbVersion01"
Call strFunction

Something like that using delegate or some other way.

Thanks in advance
KG

Nov 21 '05 #2
or you could use the CallByName function:

CallByName(Me, "DbVersion01", CallType.Method, Nothing)

I believe the above works only for instance methods. You'll have to use
Reflection to execute shared methods.
Imran.

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:uO*************@tk2msftngp13.phx.gbl...
KG,

I asked this more to people and never got an answer, you know that those
functions should exist, so you can do this in a case select very easy.
However than comes these questions to do this with a kind of late binding
using reflection.

http://msdn.microsoft.com/library/de...reflection.asp
Why do you want this while it is so easy in a "case select" and test with
that direct all errors?

Cor
"KG" <kg****@csystemssoftware.com>
Hi,
Can I put a function name in a string and run that function.
For example

Function dbVersion01()
....
....
End Function

Dim strFunction as String ="DbVersion01"
Call strFunction

Something like that using delegate or some other way.

Thanks in advance
KG


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure , msaccess hangs. The whole call to the procedure is...
14
by: Jay O'Connor | last post by:
Is there a good way to import python files without executing their content? I'm trying some relfection based stuff and I want to be able to import a module dynamically to check it's contents...
1
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure , msaccess hangs. The whole call to the procedure is...
2
by: Tony Liu | last post by:
Hi, I want to get the name of the calling function of an executing function, I use the StackTrace class to do this and it seems working. However, does anyone think that there any side effect...
10
by: Mike | last post by:
I know this sounds strange but I am at a loss. I am calling a simple funtion that opens a connection to a SQL Server 2000 database and executes an Insert Statement. private void...
0
by: Rahul Chatterjee | last post by:
Hello All I have designed a dotnet application using VB which basically takes a selection and passes value to a crystal report which in turn passes the value to a Stored procedure. After the...
1
by: A1 Ronen | last post by:
Hi all I got problem regarding executing all stored procedure through common procedures where we have different parameter with different names, type and data type The Function is as follows...
5
by: reycri | last post by:
Hi, I need to be able to do this: var func = new Function("var me = <selfRef>; alert(me.params);"); func.params = "This is a test parameter"; window.setTimeout(func, 500); Basically, I...
2
by: Swan | last post by:
How can I restrict alt+tab and start menu from keyboard while program executing(VB)?I am posting what I tried-- form.frm Option Explicit Private Sub Form_Load() HookKeyboard End Sub...
13
by: surlogics | last post by:
The function of the program is to output the longest word in a sentence. #include<stdio.H> #include<string.H> main() {int alphabetic(char); int longest(char ); int i; char line;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.