|
|
Or, use your gamerDNA username: (more...)
| ||||||
| |
![]() |
| | LinkBack | Thread Tools | Rate Thread | Display Modes |
| | #1 (permalink) |
| Registered User Join Date: Jan 2006
Posts: 172
| Hey maybe someone can help a noob to VBScript. I am using a terminal emulator called "Indigo", hopefully to send scripted commands through a terminal to an electronic device for software unit testing. I've always just used HyperTerd for this, but now I want to send more complex series of commands and log the output, hence the new tool. Indigo supports function calls to VBScripts. Basically, what I want to do is something like the following: report info1=on info2=off run test1 (pause 500) report info1=off info2=on run test2 Where the first two commands are what I want to be sent to the device under test (since it understands these commands) and then I want to pause and send the other two commands. So, I'm trying different permutations of something like: Function MyFunction() Wscript.Echo "report info1=on info2=off" Wscript.Echo "run test1" Wscript.Sleep 500 Wscript.Echo "report info1=off info2=on" Wscript.Echo "run test2" End Function And then I use the syntax to call the function from the terminal command line. The compiler chokes on the fact that there is no Wscript object. I've also tried to use the "document" object, which also does not exist, I assume because this is a not an HTML document. I've also tried using "me" which appears to exist but does not support these methods. I have also tried using the "Write" method with no luck. Other function calls such as MsgBox() work just fine. So, is there anyway I can figure out what type "me" is? Do I need to instantiate some other object? Any other ideas? Thanks! |
| | |
| | #2 (permalink) |
| Registered User Join Date: Sep 2006
Posts: 149
| I'm not sure exactly what you are asking for, but from what you look like you are trying to do, you will need a host app that will instantiate WScript. Generally with plain VBScript you would utilize Cscript.exe for a console harness and it would instantiate Wscript for you. ie: "cscript.exe yourscript.vbs" would allow you to kick in a WScript obj. Does that make sense? |
| | |
| | #3 (permalink) |
| Registered User Join Date: Jan 2006
Posts: 172
| Not exactly. MSDN says that WScript never needs to be instantiated to call its methods. I'm no Windows guy, so I'm not sure what all is going on here. Basically, I just want to be able to send a series of commands to the terminal window with periodic pauses to allow some conditions to set up. The terminal I'm using provides syntax to call a function within a script for example '@:Script.Function' would call the given function in the given script file. |
| | |
| | #4 (permalink) |
| Registered User Join Date: Sep 2006
Posts: 149
| WScript doesnt need to be instantiated because the cscript.exe instantiates it for you. If you are not using that as a harness, then i don't know how to instantiate it. It is almost like a chicken and egg scenario because to instantiate any other COM objects you need to use WScript.CreateObject. I guess I would just try to consult the scripting docs for the termemu and see if anyone has figured out a way to pipe stdout to it. Sorry for the no help. |
| | |
![]() |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
| |