-
Nov 15th, 1999, 01:45 AM
#1
Thread Starter
New Member
Let's say I have 2 functions called Function1 and Function2
I then have a file, sample.txt, in which the first 2 lines are as follows:
Function1(arguments)
Function2(arguments)
How would I read this file, in such a way that I could then call the functions from the file.
There would actually be hundreds of functions, so I cannot assign each line from the file to a string and then say
if string = "Function1" Then
Call Function1
if string = "Function2" Then
Call Function2
This would be far too unwieldy for 100's of different functions, which is why I would like to be able to evaluate the lines I'm reading in from the file and activate the functions as they are read in.
-
Nov 15th, 1999, 02:51 PM
#2
Addicted Member
Try using: "select case" on the string
then
case : "....."
case: "......"
;
;
if any problem mail me:
MYR@cyberia.net.lb
Mimo
-
Nov 15th, 1999, 07:09 PM
#3
If you have VB6 then you can use CallByName function. But you would have to have your functions in a Class Module (not regular mudule) because CallByName function has first parameter as an object.
Syntax: CallByName(object, procname, calltype,[args()])
Example:
iSum = CallByName(Class1, "Multiply", VbMethod, 5, 5)
MsgBox iSum
Assuming that I have function Multiply in calss called Class1.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819
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
|