Greetings,
Sorry for the additional traffic. But I wanted to make sure that no one got
the impression that a "naked At" or Rule command is a good thing - i.e. not
using a Loop.
At or Rule MUST be in a loop to do what you want it to do. At / Rule is NOT
a Pause! It is a one-time check of the screen for the conditions specified.
So when you check is important. A loop checks more than once. Remember, code
can move faster than screens, so you must make code pace itself with the
screen.
I've seen my share of "naked At" commands causing grief too.
So if you've got scripts that looks like:
Enter ...
wait
If at("error") then enter y
Enter "ok"
...
You've got a problem waiting to happen! And these too are insidious because
they will work perfectly when testing.
Reason #2 I like Rules...you don't have to think about this stuff.
Regards,
Thom
Thom C. Blackwell
Product Manager
Boston Software Systems
(866) 653-5105 ex 807
www.bossoft.com
Sign up for my weekly webinar!
LEGAL NOTICE Unless expressly stated otherwise, this message is confidential
and may be privileged. It is intended for the addressee(s) only. Access to
this E-mail by anyone else is unauthorized. If you are not an addressee, any
disclosure or copying of the contents of this E-mail or any action taken (or
not taken) in reliance on it is unauthorized and may be unlawful. If you are
not an addressee, please inform the sender immediately, then delete this
message and empty from your trash.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thom C. Blackwell
Sent: Friday, March 21, 2008 5:19 PM
To: [email protected]
Subject: RE: [Talk] Using AT() with Select Case
Greetings,
Um... I read an "Is Case" as the same thing as an If? ...
Clearing the At - or Rule is a potentially dangerous thing to do and should
not be done without a really, really, really good reason to do so - here's
why.
The At / Rule command has built in logic to not allow you to see the same
thing twice in a row. This is a VERY good thing and is not something to
override lightly. I've seen countless times where folks put in at"" in a
loop, and it caused them all sorts of grief tracking down why something
"odd" happened one day. This is an insidious problem to track down because
in debug mode it will work perfectly.
Keep in mind that a screen may not move as quickly as a script can - so you
very well could say:
Do
if at("Here") then Enter "Y"
At""
Loop until at("There")
And the loop spin so fast that the screen didn't "take" the Y yet and it
still be at here! Protecting against seeing the same thing twice protects
you from this - clearing it takes this protection away.
All this stuff is why I like the Rules format especially for conditional
statements :`)
Regards,
Thom
Thom C. Blackwell
Product Manager
Boston Software Systems
(866) 653-5105 ex 807
www.bossoft.com
Sign up for my weekly webinar!
LEGAL NOTICE Unless expressly stated otherwise, this message is confidential
and may be privileged. It is intended for the addressee(s) only. Access to
this E-mail by anyone else is unauthorized. If you are not an addressee, any
disclosure or copying of the contents of this E-mail or any action taken (or
not taken) in reliance on it is unauthorized and may be unlawful. If you are
not an addressee, please inform the sender immediately, then delete this
message and empty from your trash.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bill Palmer
Sent: Friday, March 21, 2008 4:50 PM
To: [email protected]
Subject: RE: [Talk] Using AT() with Select Case
If you decide to go with the Select Case statement be sure to put At("") at
the end of each Case block. If you don't clear At() it continues to look
for the same text.
--
Bill Palmer
Financial Coordinator, Information Systems
Mid-Columbia Medical Center
The Dalles, OR 97058
541-296-7417
>>> On 3/21/2008 at 10:33 AM, in message
<[EMAIL PROTECTED]>,
"Lawrence,
Mitchell" <[EMAIL PROTECTED]> wrote:
> Yeah I know, but I want to stick the whole portion of my scripts where I
> log into Meditech within a subroutine that I can export to all my
> projects.
>
>
>
> We run both version 5.4 and version 5.5 Meditech C/S and some Meditech
> login screens include the background bitmap during login and some do
> not, which changes the placement of the input fields.
>
>
>
> I'm trying to build a "one subroutine to rule them all" type of deal
> here.
>
>
>
> In my rules script I'll just have
>
>
>
> Always LoginMT
>
>
>
> and then my LoginMT() sub will handle the reading of the screen and
> entering in the universe, hcis, username, and password and hand back to
> the script to continue on from there.
>
>
>
>
>
> Thank you,
>
> Mitch Lawrence
>
> Lead Applications Analyst
>
> Technical Support - NPR/Automation
>
> CHRISTUS Information Management
>
> *: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
>
>
> Send a "thank you
> <http://intranet.christushealth.org/spiritBuck/Default.asp> " to
> someone!
>
> ________________________________
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Thom C. Blackwell
> Sent: Friday, March 21, 2008 12:20 PM
> To: [email protected]
> Subject: RE: [Talk] Using AT() with Select Case
>
>
>
> Greetings,
>
>
>
> I'd go with If statements using the Rule command:
>
>
> if Rule("cond1&cond2")...
>
>
>
> This would also allow you to use:
>
> If Rule("Timeout") instead of using a loop counter.
>
>
>
> You can see the current row , column using the properties Row and Col
>
> And the View command will return data from the screen.
>
>
>
> But to me, doing that is basically reinventing the Rule command...
>
>
>
> Regards,
>
> Thom
>
>
>
> Thom C. Blackwell
>
> Product Manager
>
> Boston Software Systems
>
> (866) 653-5105 ex 807
>
> www.bossoft.com <http://www.bossoft.com/>
>
> Sign up for my weekly webinar!
> <http://www.bostonworkstation.com/customer_center/special_events.aspx>
>
>
>
> LEGAL NOTICE Unless expressly stated otherwise, this message is
> confidential and may be privileged. It is intended for the addressee(s)
> only. Access to this E-mail by anyone else is unauthorized. If you are
> not an addressee, any disclosure or copying of the contents of this
> E-mail or any action taken (or not taken) in reliance on it is
> unauthorized and may be unlawful. If you are not an addressee, please
> inform the sender immediately, then delete this message and empty from
> your trash.
>
>
>
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Lawrence,
> Mitchell
> Sent: Friday, March 21, 2008 1:10 PM
> To: [email protected]
> Subject: [Talk] Using AT() with Select Case
>
>
>
> Has anyone used the AT command with a Select Case statement?
>
>
>
> I would like to do something along the lines of the following:
>
>
>
> Do Until At ("[EMAIL PROTECTED],1")
>
> Select Case At(ScreenCondition)
>
> Case "Select [EMAIL PROTECTED],1&@2,0"
>
> Enter MTUniverse
>
> Wait 0.5
>
> Case "[EMAIL PROTECTED],1&@20,0"
>
> Enter MTUsername
>
> Wait 0.5
>
> Case "[EMAIL PROTECTED],1&@21,0"
>
> Enter MTPassword
>
> Wait 0.5
>
> Case "[EMAIL PROTECTED],1&@22,0"
>
> Enter MTLiveHCIS
>
> Wait 0.5
>
> End Select
>
> Wait 0.5
>
> LoopCount = LoopCount + 1
>
> If LoopCount = 120 then
>
> Exit Do
>
> End If
>
> Loop
>
>
>
> I know the above isn't right. Likely I need to be doing something else.
> Is there a function to read the current screen? Would it be better to
> just do a bunch of if statements?
>
>
>
>
>
> Thank you,
>
> Mitch Lawrence
>
> Lead Applications Analyst
>
> Technical Support - NPR/Automation
>
> CHRISTUS Information Management
>
> *: [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
>
>
> Send a "thank you
> <http://intranet.christushealth.org/spiritBuck/Default.asp> " to
> someone!
>
>