|
-
June 19th, 2009, 12:29 AM
#1
class from string
Hey,
So let's not get into the potential ridiculousness of what I'm doing. But essentially I have a string that is the name of a class, I want it to create a new object of that type.
So if I pass it a string "ClassyFace", it'll create a new ClassyFace object, if the string is "ClassyPants", I want it to make a ClassyPants object. I realise I can achieve this with a bunch of if statements but I'd like to have it go directly from the string. Also, if it helps, all of these objects share a base class.
Any help is appreciated.
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
|