VanDyke Software Forums

Go Back   VanDyke Software Forums > Scripting
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-19-2017, 11:52 PM
yardian yardian is offline
Registered User
 
Join Date: Jun 2014
Posts: 2
Question sto

# $language = "VBScript"
# $interface = "1.0"

' This script demonstrates how ActiveX scripting can be used to
' interact with CRT and manipulate other programs such as Microsoft Excel
' through an OLE automation interface. This script creates an instance of Excel,
' then it sends a command to a remote server (assuming we're already
' connected). It reads the output, parses it and writes out some of the
' data to an Excel spreadsheet and saves it. This script also demonstrates
' how the WaitForStrings function can be used to wait for more than one
' output string.

Sub main
'crt.Screen.IgnoreCase = True
crt.screen.synchronous = true

' Create an Excel workbook/worksheet
'
Dim app, wb, ws
Set app = CreateObject("Excel.Application")
Set wb = app.Workbooks.Add
Set ws = wb.Worksheets(1)

' Send the initial command to run and wait for the first linefeed

crt.Screen.Send("dis mac-address dynamic vlan 3000" & Chr(10) )

do While true
if (crt.Screen.WaitForString("More",3) = true ) then
crt.Screen.Send(" ")
else
crt.Sleep 3000
exit do
end if
loop



crt.Screen.WaitForString Chr(10)



crt.screen.synchronous = false
End Sub

vbs untils stopping do while,please help me,ths!
Reply With Quote
  #2  
Old 03-20-2017, 07:42 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 2,919
Hello yardian,

Quote:
vbs untils stopping do while,please help me,ths!
Please elaborate on the above statement. I do not see you using any "untils", if by that, you mean a "Do Until Loop"?

There is an "exit do" statement within the Do While, so that could explain it appearing to stop. Based on the output you are receiving, do you expect the "if side" to execute, or the "else side"?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:30 AM.


copyright 1995-2015 VanDyke Software, Inc.