Is it at all possible to have your program write code within itself for you. As if you wanted it to change the actual code........but it will only happen if you ran it.
Printable View
Is it at all possible to have your program write code within itself for you. As if you wanted it to change the actual code........but it will only happen if you ran it.
or something like.......read a piece of code from a text file or what have you and use that code.
yes. It can get complex though. the .NET framework provides on the fly compiling classes. Best option I can give is look through the source of SharpDevelop www.icsharpcode.net and look for how they compile.(Although it is written in C#)
you could write your own language and then parse it.
e.g. put in the text file.
print label2("hello")
then you'd have to find out what print meant(change the text property of the referenced control), find the control label 2, and have some code that changes its text property. Loads of IF and select case statements would do it!
why do you want to do that anyway?