Operate variables from string

_person_

New member
Joined
Jun 8, 2009
Messages
3
Programming Experience
1-3
Say, If I typed in "Dim X as Integer" in a text box, I figured that I could just use If TextBox1.contains to make vb.net dim it. However, how would, if I typed "X = 3y * 9" in the text box, actually calculate that and print it in another text box?

Thanks
 
If you type "Dim x as Integer" in a textbox, vb will do nothing with it. Simply because it's just a string. Like "Hello World" or "Delete all files".
 
No, I did something like "If textbox1.text = "Dim X as Integer" Then Dim X as Integer. what I need to know is how to do something with that variable, still from the text box.
 
um
ok, easy: you can't
as stated above: text in a textbox is just a piece of data, not a piece of code.

If you have VS Pro you can dig into "System.CodeDom". But I very much doubt that it will help you much ...

Another option would be to write your own Basic Interpreter or Compiler.
 
Basically, I'm trying to write a small language that my friend, who can't even understand HTML, may be able to use. So far, I've got a print function, but it doesn't use any formulas, which is what I'm asking.

thanks, anyway :(
 
Back
Top