|
-
May 26th, 2005, 09:51 AM
#1
Thread Starter
New Member
Using functions directly [Resolved]
I've got a function that walks through all files on my harddrive. Depending on the user's settings it has to do a specific operation on those files.
Incuding the code for all of these operations in the function that walks through my files would mess-up my code.
Now I used select case to find out which function to use. When I add a new function, I always have to add it in the Walkthroughfiles function.
Isn't there an easier way to do this?
Private Function Walkthroughfiles(option as string)
'Select next file...
Select Case option
Case "One": a = One
Case "Two": a = Two
'Loop...
End Select
msgbox a
End Function
Public Function One()
'Some code
One = "operation 1 completed successfully)
End Function
Public Function Two()
'Some code
Two = "operation 2 completed successfully)
End Function
Last edited by jacco1; May 27th, 2005 at 10:09 AM.
Reason: Resolved; thanks
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
|