|
Greetings, A couple of things to keep in mind with
the At: First it is a One Time Check – it says
- Is the specified screen condition true at this exact moment in time – so it is not like a Pause that continuously
looks for the condition. This means that you have to “ask the question”
multiple times. For example, you enter in an Account number, you may or may not
see the prompt “Invalid Account”. While from a users perspective,
the Prompt pops up “instantly” – from a scripts perspective
it does not – it takes time for the prompt to actually appear so if the
script looks like: Enter AcctNum If At(“Invalid Account”) then … End if It is highly likely that the At above will
appear to not work correctly. This is because the prompt has not happened yet.
The script moves from command to command very fast – quite likely faster
than the screen – so even though entering in AcctNum triggers the prompt –
the prompt has not “hit the screen” by the time the At command is
executed. I’ve seen this trip people up countless number of times –
because if you are stepping through your script – the At will fire
correctly. Or this works sometimes because the screen is really fast, or the
machine is stressed an VB is running a bit slowly etc. If you are using an At, you have to put
it in a loop in order to assure reliability: Enter AcctNum Do Until At(“Name”) ‘
this is where the cursor goes if the Acctnum is valid If At(“Invalid Account”) then … Exit Do End if The second thing to keep in mind is that you
can’t see the exact same thing twice in a row with an At. This is the
comment you saw earlier where it was advocated to put At”” in front
– this effectively clears out what was seen previously by the At so that
it could be “seen” again. I wouldn’t advocate doing that BTW unless
you really need to see the exact same screen condition twice in a row –
which is pretty rare, but I have had to do it before. Easiest way to understand this behavior is
through a brief test: Connect into a screen and set it to a
known condition – I’m going to use the Account Number field example: In your vba put in the following: Do If At(“Account Number”) then MsgBox “Hello” End if wait Then step through it – what you will
see is that you’ll only get the message box once If you were to add At”” i.e. Do If At(“Account Number”) then MsgBox “Hello” At”” End if Wait You’d get the message box every time
the loop spins. Hope this helps! Regards, Thom Thom C. Blackwell Product Manager 866 653-5105 - ex 5 From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ross Stolle Are you using the AT with an IF
statement? If so, I’ve found that you need to put a little WAIT before
an IF statement. I usually do… WAIT 0.3 IF AT (“YOUR TEXT”) THEN . . . -----Original
Message----- I am trying to use the
at("") command in a script. I'm using it looking for a string
of text. Oddly, sometimes it works and sometimes it doesn't. I
tried to use a location instead, but that isn't always the same place.
Anyone know of why there might be an inconsistency and/or how to get around
it. It's almost like the value of the search string is being lost even
though it can be fixed text. Gary Guion ____________________ Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. |
Title: Use of the At() command
- [Talk] Use of the At() command Guion, Gary
- RE: [Talk] Use of the At() command MAGGIO,MICHAEL K
- RE: [Talk] Use of the At() command Ross Stolle
- RE: [Talk] Use of the At() command Thom C. Blackwell
