Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-12-2013, 05:58 PM
thehawk thehawk is offline
Registered User
 
Join Date: Oct 2012
Posts: 7
How use Screen->Get() for a line that is off the screen

Hello,

I'm using SecureCRT version 6.2.2 with Active Perl Scripting.

I'm creating a script that grabs information from a remote router by connecting to the remote device via TELNET or SSH. When the "show" command is executed the output is longer than it can be displayed in a single window and the window starts scrolling up. As such, the Screen->Get(10,1, 10,10) for example no longer corresponds to the line I wanted to grab.

Since the lines I need are off the screen I tried to use negative lines for the numbers but for some reason it doesn't work.
I.E. I tried Screen->Get(-4,1 -4,10) but didn't work.

Can you please advise if there is a way to have the script grab the line number based on the number of lines that have displayed since the connection was established (not based on what's on the screen only) or is there a way to grab information that has already passed the screen?

Thank you,
Adrian
Reply With Quote
  #2  
Old 07-13-2013, 06:24 AM
thehawk thehawk is offline
Registered User
 
Join Date: Oct 2012
Posts: 7
Found a work-around for now. I've modified the Global settings to use a smaller font. Since the output of the command initially was only 1 page and a half when I shrunk the font the output came down to 1 page which I was able to parse using the Get() function.

I would still be interested in knowing how to parse for negative lines or how to output everything for that command to an array that I can then take apart line by line so that I can get the output that I want.

Thank you for your help,
Adrian
Reply With Quote
  #3  
Old 07-15-2013, 07:33 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi Adrian,

I am glad to hear that you found a workaround. I would suggest that you take a look at the scripting manual. It illustrates the SecureCRT scripting API in conjunction with VBScript, but the API concepts are the same.

You can find it at the following location:
http://www.vandyke.com/support/tips/...ing/index.html
Chapter 4 will likely be most useful for your current project.

Rather than using Get(), I would suggest taking a look at ReadString(). Does ReadString() help you accomplish your goal?
__________________
--Todd

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

Tags
perl script , screen->get , scroll up


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 -6. The time now is 02:35 PM.