Title: Help: Eval field & key down if not equal to value
If View(row:=Row(), col:=1, length:=7) = "HUB.CAM" Then
 
is better...the row:= is necessary since the first default parameter in View is used in the Windows Connection to specify the window you're reading from.  We've reengineered the View command so that if exactly the first three parameters are used then they're assumed to be a row,col,length...so View(row, 1, 7) would also work.
 
Try all this in VBA's immediate window and see what you get.  That's the easiest way to experiment...stop your script around this area, press control G, key ?view(row,1,7) and press enter
 
Rich McNeil
Boston Software Systems
866 653 5105
 
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul
Sent: Friday, February 20, 2004 2:35 AM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Help: Eval field & key down if not equal to value

Actually I had a flaw in my late night logic.

You don’t want to have the  loop Until View(Row(), col:=1, length:=7) = "HUB.CAM"   

 

You want to have something like

Dim FoundOne as Boolean

FoundOne = False

Do

   ‘ When you find one, set FoundOne to True

 

Loop until FoundOne

 

Now I’m off to bed.

 

Paul

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Paul
Sent: Thursday, February 19, 2004 11:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Help: Eval field & key down if not equal to value

 

I don’t believe that you can use the Zero with a “view” like you do with a pause.

 

You might want to try replacing the “0” with row()

Row() returns the current row that the cursor is at.

Your new code would look something like this…..

Pause "@9,1"
Do

   If View(Row(), col:=1, length:=7) = "HUB.CAM" Then
       key “{tab}{tab}”

       Pause "@0,26"
       Enter "zcus.clinician.menu"
    Else
       Key "{DOWN}"

         stable     ß added this.        

    End If

loop Until View(Row(), col:=1, length:=7) = "HUB.CAM"   

You might want to add some additional logic on the off chance that “HUB.CAM” is never encountered.

If any of this looks funny, and you’d like me to explain my madness, let me know, and we can setup a call.

 

Now go to bed and get some sleep!

 

Paul

 

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Barker-Lacerda , Michelle
Sent: Thursday, February 19, 2004 10:49 PM
To: [EMAIL PROTECTED] COM ([EMAIL PROTECTED])
Subject: [Talk] Help: Eval field & key down if not equal to value

 

Morning!

I'm trying to get my script to evaluate a field - if the data in that field isn't equal to a certain string, then the script should key down to the next field in the list and evaluate it for the same string. This is what I've tried and it goes to the Else statement each time, even when the If statement is true. Even though the field position starts at 9,1, I'm using zero for the row because I don't know at what position the string will read "HUB.CAM". Could that be the problem?

Pause "@9,1"
Stable 2
Do Until View(Row:=0, col:=1, length:=7) = "HUB.CAM"
   Stable 2
   If View(Row:=0, col:=1, length:=7) = "HUB.CAM" Then
       Tab_ ""
       Pause "@0,22"
       Tab_ ""
       Pause "@0,26"
       Enter "zcus.clinician.menu"
    Else
       Key "{DOWN}"
    End If
Loop

I've also tried

While View(Row:=0, col:=1, length:=7) <> "HUB.CAM"
   If blah Then
      blah
   Else
      blah
   End If
Wend

Any help is appreciated.
Thanks
Michelle

617-665-3432
Clinical Application Analyst
Cambridge Health Alliance
Information Technology Dept.
[EMAIL PROTECTED]
617-546-7770 pgr.

Reply via email to