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!

reusing a user input further down in the script

Status
Not open for further replies.

monkey101

MIS
Apr 24, 2009
247
CA
I am inputting a lot of data want to know if I can take data that i enter and have it automatically used later in the script. Also I have a spot where i need it to wait for me to enter data but it is putting a space in and i have to hit return and then input my data. Is there a way so it will not put the space in? Here is part of my script I am talking about.

crt.Screen.WaitForString "TN "
crt.Screen.Send " "
crt.Screen.WaitForString "DES "
crt.Screen.Send "TOR_PVR_COT" <- here i enter a 4 digit number after the COT and would like to have script enter it below
crt.Screen.WaitForString "CUST "
crt.Screen.Send "0" & chr(13)
crt.Screen.WaitForString "NCOS "
crt.Screen.Send " " <-- here is where I have to enter a number but it is putting in a space
crt.Screen.WaitForString "RTMB "
crt.Screen.Send " " <-- if I leave the quotes together the script hangs so i have to have the space between the quotes
crt.Screen.WaitForString "PRDN "
crt.Screen.Send "205" <- enter the 4 digit number after the 205
crt.Screen.WaitForString "CMF "
crt.Screen.Send "no" & chr(13)

Any help would be greatly appreciated.
 
This isn't really a vbScript question, as the functionality is actually being provided by an ActiveX object - a quick Google indicating probably for a VanDyke product, most likely SecureCRT.

However, consider:

Result = crt.Screen.WaitForString "<whatever>"
crt.Screen.Send Result

This document might also prove useful, if you have not already got it:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top