Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-06-2016, 10:03 AM
ShawnVW ShawnVW is offline
Registered User
 
Join Date: May 2016
Posts: 15
Am I capturing hidden characters?

I'm using the Get command to capture a single character on screen, usually the letter "N":

Code:
x = crt.screen.get(11,68,11,68)
crt.Session.SetStatusText(">" & x  & "<" )

But when this should display ">N<", it shows "> (about 20 blank spaces) <"

Are there some hidden characters or something that could be causing this?

Last edited by ShawnVW; 07-06-2016 at 10:19 AM.
Reply With Quote
  #2  
Old 07-06-2016, 11:05 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi ShawnVW,

In my tests, it worked as expected, but I controlled the output (see attached).

There could be hidden characters in the output you receive, but I need additional information about that output. It's strange that you get 20 or so characters. It sounds like there could be line endings or tabs being converted to spaces that is throwing things off.

Are these two lines the entirety of your script?

What is the output you receive prior to running this code?

If you paste that output into some application with the ability to show hidden/non-printing characters, does that shed any light on what the 68th character actually is?
Attached Images
File Type: png ForumThread12398.png (50.1 KB, 1597 views)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 07-06-2016, 11:13 AM
ShawnVW ShawnVW is offline
Registered User
 
Join Date: May 2016
Posts: 15
Quote:
Originally Posted by bgagnon View Post
Are these two lines the entirety of your script?
Not even close!


Quote:
What is the output you receive prior to running this code?
It's a form. The character I want to capture is in one of the fields. Actually, I tried capturing the field label too, but I just got longer string of blank spaces.

Quote:
If you paste that output into some application with the ability to show hidden/non-printing characters, does that shed any light on what the 68th character actually is?
What sort of application can do that?

Thanks!
Reply With Quote
  #4  
Old 07-06-2016, 12:21 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi ShawnVW,

With a form it may be difficult to accomplish the objective. Get() may not be the best method to use.

I believe you can show formatting marks in several of the Microsoft Office products. You might just search on "show invisibles" or a similar term in the Help file.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 07-06-2016, 12:33 PM
ShawnVW ShawnVW is offline
Registered User
 
Join Date: May 2016
Posts: 15
I found something. The field label reads "22)<7 spaces>ALLOW B/O".

I used this:

Code:
	strResult = crt.Screen.ReadString("ALLOW B/O:")
	msgbox(right(strResult,20))
The result I expected was:

"<several spaces>22)<7 spaces>ALLOW B/O:"

What I got was:
"N:<left arrow>[11;47H22)<several spaces>"

Isn't there some method to capture just the "normal" characters onscreen?

If Get isn't the best way to see what's at a particular point on the screen, what would be better?
Reply With Quote
  #6  
Old 07-06-2016, 12:47 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi ShawnVW,

Yes, I believe it's the IgnoreEscape property available to the Screen Object that you seek. (See Scripting / Script Objects Reference / Screen Object in SecureCRT's Help file.)

That should take care of the escape sequence [11;47H22], but I am not sure what you mean by the <left arrow> reference. What is the actual output?


Quote:
If Get isn't the best way to see what's at a particular point on the screen, what would be better?
Right now I only have limited information. I would need "big picture" info to provide any further advice.
__________________
Thanks,
--Brenda

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

Tags
screen->get , vbscript

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 05:26 AM.