"Maurice" <hmoviat@nospam.nospam> schrieb[color=blue]
> "Armin Zingler" <az.nospam@freenet.de> wrote in news:OrGv#YjNGHA.428
> @tk2msftngp13.phx.gbl:
>[color=green]
> > Creating an object by class name[/color]
>
> Hi Armin,
>
> sorry, indeed creating an object by class name.
>
> It's possible that in future some names may change and I don;t want
> to change this function then. That's why I don't want a select case
> statement to declare a new form.[/color]
A class name usually doesn't change, and if it changes we have to change the
code. If you change a variable name you also have to change the code
accessing the variable. Reflection is not a replacement for this.
[color=blue]
> But isn't there something like the Eval function in VBScript that
> you can use?[/color]
No.
VB.Net is not an interpreter. Source code is compiled into an executable
(IL-Code), then to native assembler code by the JIT-Compiler. Source code
has a structure. Executable commands are part of procedures. Procedures are
members of classes, and classes are contained in assemblies. That's the
structure of an application. You can not place a string into nowhere without
any context.
If you dynamically want to create an application, you must supply this
structure. That's why I provided the link in my first message, but I was
actually looking for this one:
http://msdn.microsoft.com/library/en...elanguages.asp
Armin