Home > Software engineering >  Turn a if use words
Turn a if use words

Time:10-11

Ask a question about VB
I will do the same with secureCRT remote network equipment operation, is to catch the log information, and then want to use script execution,
Other orders are no problem, it is a little, on the device of log information, often have N page, if didn't show the first page will be displayed -- - more -- -; Artificial does is to press the space until finally no longer appear -- - and more - and the end of the log,
But in the script, need a sample, if the return value is -- - more -- -, so I let it input space, if the return value is not more - - -, so I let it enter the next command, but this if for example, how to write?
I find several examples of the Internet, tried, he couldn't do it, do not understand, also don't know where is wrong, or the example itself didn't use to,
Example 1: the If (CRT) Screen) WaitForString (current state: "UP", 1) & lt;> False) Then
PortStatus="PortUP"
The Else
PortStatus="PortDown"
End the If
Example 2: CRT. Screen. Send "display logbuffer" & amp; CRH (13)
CRT. Screen. WaitForString "- More -
"CRT. Screen. Send ""
The CRT) Screen) Synchronous=False

To solve, I thanked first here,

CodePudding user response:

"-- More likely --" is output to stderr instead of stdout,. Result in the CRT Screen. WaitForString function can't capture,
Try to
CRT. Screen. Send "display logbuffer" & amp; CRH (13)
Instead of
CRT. Screen. Send "display logbuffer 2 & gt; & 1 "& amp; CRH (13)
To display logbuffer 2 (STDERR) handle to the command output is redirected to handle 1 (STDOUT)
  •  Tags:  
  • VBA
  • Related