#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#3
|
|||
|
|||
Not even close!
Quote:
Quote:
Thanks! |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
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)) "<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? |
#6
|
|||
|
|||
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:
![]()
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#7
|
|||
|
|||
By <left arrow> I meant single character that looks like a left-pointing arrow.
I tried IgnoreEscape. I got a different string: )800 PHN:22) <spaces> When you say "What is the actual output", I'm not sure what to say other than its a screen full of field labels and the content of those fields. (How can I attach a screenshot?) |
#8
|
|||
|
|||
Hi ShawnVW,
There should be a paperclip icon in the formatting toolbar provided when you post a reply. That will allow you to attach files. I suspect the best way to see what the output is will be to get a raw log. To create a raw log:
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#9
|
|||
|
|||
I'm not sure I'm allowed to send you a filled-out form (or log), but here's a blank one attached.
The Raw Log shows lots of those symbols and codes I described, even with IgnoreEscape turned on. After experimenting some more with ReadString, I don't think the characters' "position" is really where they "are". Thanks, though. Last edited by jdev; 10-22-2020 at 02:28 PM. |
#10
|
|||
|
|||
Hi ShawnVW,
Without the raw log, I can only guess, but if the ALLOW B/O is the data you are trying to get, then you might consider code similar to this: Code:
crt.Screen.WaitForString("ALLOW B/O:") crt.Screen.ReadString("Y", "N") If crt.Screen.MatchIndex = 1 Then MsgBox("Allow B/O = Yes!") ElseIf crt.Screen.MatchIndex = 2 Then MsgBox("Allow B/O = No") End If
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#11
|
|||
|
|||
I think you're right about the field values being painted after the field labels. Plus, when I capture the text with ReadString, it shows nothing between one label and the next, as if the field itself isn't there.
I'll just have to proceed without actually "knowing" what's in that field. Thanks again! |
![]() |
Tags |
screen->get , vbscript |
Thread Tools | |
Display Modes | Rate This Thread |
|
|