-
Jul 9th, 2021, 05:53 AM
#1
Thread Starter
Member
Display all the class name / objects
Hola,
I have this project where I created a lots of class and I need to process all the class/objects from this specific folder in my project named "Tables"
I already created the routine to get the real work done and I just doesn't want to type all the contents of the folder "Tables" to have them processed.
Is there any way to read and process all the class under the folder "Tables"?
Thanks in advance!
-
Jul 9th, 2021, 08:10 AM
#2
Re: Display all the class name / objects
Perhaps you could actually explain what "process" means. You generally don't "process" classes, but instances of classes, i.e. objects. Those objects can be created in many ways but it's generally not "reading" from a folder in a project. In short, provide a FULL and CLEAR explanation of the problem.
-
Jul 9th, 2021, 09:54 AM
#3
Re: Display all the class name / objects
When the program is running, that folder isn't really there, unless the program is looking back to the project that developed it and is manipulating the source code from which it is built. That seems pretty improbable, though.
My usual boring signature: Nothing
-
Jul 9th, 2021, 01:30 PM
#4
Re: Display all the class name / objects
You create your instance of your classes the same ways that if they weren't in a folder. VS doesn't care of the folder for the class so you just need :
Code:
dim att as new attendance
dim bene as new benefits
etc ....
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
-
Jul 9th, 2021, 03:01 PM
#5
Re: Display all the class name / objects
Reflection is what you're looking for, but i don't know how you'd differentiate which folder your classes are in...
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jul 9th, 2021, 10:34 PM
#6
Re: Display all the class name / objects
Originally Posted by .paul.
Reflection is what you're looking for, but i don't know how you'd differentiate which folder your classes are in...
If things have been done properly, those folders map to child namespaces. If things haven't done properly, there is no way to differentiate the folders because the folders don't exist as far as the types are concerned.
-
Jul 11th, 2021, 08:30 PM
#7
Thread Starter
Member
Re: Display all the class name / objects
Originally Posted by jmcilhinney
Perhaps you could actually explain what "process" means. You generally don't "process" classes, but instances of classes, i.e. objects. Those objects can be created in many ways but it's generally not "reading" from a folder in a project. In short, provide a FULL and CLEAR explanation of the problem.
Process, I created a function that will process all those classes.
Code:
Call Extract(input table name, var1, var2, var3)
I was thinking like using something like this but it seems not possible.
Code:
For each cls in folder Tables
Call Extract(cls, var1, var2, var3)
Next cls
-
Jul 11th, 2021, 08:31 PM
#8
Thread Starter
Member
Re: Display all the class name / objects
Thanks for all the replies and inputs. I will just create an instance of each class.
Stay safe everyone.
-
Jul 11th, 2021, 08:52 PM
#9
Re: Display all the class name / objects
Originally Posted by hopia
Process, I created a function that will process all those classes.
How is that an explanation of everything? If I ask you what X means I don't expect you to say "it means X". I meant what does the the function actually do. You know, an EXPLANATION.
There is no folder at runtime. That folder is part of your project and the project doesn't exist, as far as the compiled EXE is concerned. Sure, you could write code that assumes that the EXE is located in the output folder under the project folder but that isn't going to be valid if you deploy the EXE somewhere. You could write code such that the user provides a folder path at run time and you then examine that folder, but that's not something special that you should need our help with. Beyond that, we can't really help you do what you want to do if you won't explain what it is you want to do.
Tags for this Thread
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
|