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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript "Eval" statement in QBASIC?????

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can I simulate the JavaScript statement eval(); in QB. For all you non-JS people out there, eval takes the argument of a string expression and tries to execute that string as if it were a statement sent to the interpereter. How can I do this in QB? Is it even possible?
 
I think you're talking about "SHELL" command.

ex:

CLS
DoThis$ = "dir \*.* /s /b"
SHELL DoThis$
END

--MiggyD
 
I don't think that's what he means Miggy.... Imagine a program who's input is a command, and when you give the program that command it executes it as if you wrote a program, compiled and ran it. Like those Windows API commands that trojans/virus's/blackholes use to screw with your computer....

I don't know of any commands to do this, but you could make a SUB that output a "FILE.BAS" file which contained the command you wanted to execute, then use the SHELL command and a DOS line compiler to assemble it, and then SHELL to the .EXE file that the compiler created. This sounds a little crude, but considering the speed and relative small amount of disk space this would cost you, it's no big deal if it's something you really want to do.....

 
Good idea, hardcore. Thanks for the response. That would actually be perfect for what I'm thinking of doing. Why didn't I think of that? :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top