Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can i use a string as a command?

Status
Not open for further replies.

lived

Programmer
Jun 6, 2000
39
0
0
CA
i want to ask the user for a command that vb can execute and didn't find a way to do it. i want to do something like:

Code:
Let InputCommand$ = "For I = 1 to 10 : next I"
InputCommand$ 'execute command line

Or there is a way to create a file that VB can use to input command ?

SkyFighter
 
Have a look at the Eval function or the Execute statement.
WARNING: High level of risk doing that.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
As pointed out already, but in this case, use execute more exactly. Further, vbs does not accept $ in the variable name. You have either take it ($) out, or enclose the variable name by square bracket every time you use it, [InputCommand$].
 
I'm sorry i did a mistake. i was willing to post this threads in the Visual Basic(Microsoft): Version 5 & 6 forum.


SkyFighter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top