Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
VB Commands (Simple Q)
Name: concentriq Date: November 5, 2002 at 14:53:11 Pacific OS: WinXP CPU/Ram: 550/512
Comment:
ok, rather simple question in VB.
suppose I have a string which I want to evaluate as a command, for example:
Dim str As String str = "Command1.Enabled = True" , now I want to have what is contained in str to run, and disable Command1
Name: tru Date: November 5, 2002 at 18:37:25 Pacific
Reply:
I'm not so sure there is a way to do this. Logically it wouldn't work because str occupies a space in memory. When the program is compiled and run that string goes into memory. At that point it is meaningless because it is source code and not machine code.
0
Response Number 2
Name: alai Date: November 5, 2002 at 19:21:32 Pacific
Reply:
i dont have a book handy, by i think it is something like eval(str) anyone else?
0
Response Number 3
Name: Christian Date: November 5, 2002 at 22:01:22 Pacific
Reply:
I think that is imposible in VB, if you read the theory. Itīs a compiled language, maybe you could do that with VBS, or other scripting languages.
0
Response Number 4
Name: Muslim Date: November 7, 2002 at 09:29:54 Pacific
Reply:
Dim str As String str = "Command1.Enabled = True" , now I want to have what is contained in str to run, and disable Command1
Because str is the vb command u choose the other word replace the str and do not use "" for example: Dim a As String a = Command1.Enabled = True
Summary: i know some basic VB commands after a quick VB course i had, but never learned a particular part that sounds so simple. how to create a EXE that would launch 2 or more EXE's. i never had a use for thi...
Summary: Hi, Retrogamer, I see where you are coming from, but you are very, very, very wrong. Visual Basic is not for kids. Read what the experts said. Visual C++ is an imitation of Visual basic, Delphi as wel...