Scott, I was looking at appending this to the Tools module as you suggested, but consider this.
At the next update of BWS, unless you are diligent, this function, and all other custom functions that you put in Tools will be lost. This means that you would have to go and sort through Tools to find your custom code, and move it to the new Tools module (if organized right, it would not be difficult). I am thinking that creating a new module (CustomTools) and adding it to your project may be the easiest approach. Additionally, I think if it is placed in the correct directory, it will become a default for all of your projects when they are started. Just a suggestion... Lew Hundley Information Specialist - Programmer Silverton Hospital Silverton Oregon 503.873.1657 [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Nathanson Sent: Thursday, August 21, 2003 7:06 AM To: [EMAIL PROTECTED] Subject: RE: [Talk] FW: PauseLoop issue RESOLVED I solved a similar problem with two functions that allow me to determine if I am at a specific field. At field is used like the At function but is passed the row, column, and length of the field. PauseField is used like PauseLoop but is passed row, column, field length, and an optional string. I appended the following code to the Tools module: Public Function AtField(ByVal Row As Long, ByVal Col As Long, Optional ByVal Length As Long = 1) As Boolean Static LastRow As Long Static LastCol As Long Static LastLength As Long Static LastCheck As Date AtField = False If R Is Nothing Then Exit Function If Row = LastRow And Col = LastCol And Length = LastLength And DateDiff ("S", LastCheck, Now) < 5 Then Exit Function If (Row = R.Row) And (Col <= R.Col) And (R.Col <= Col + Length) Then AtField = True LastRow = Row LastCol = Col LastLength = Length LastCheck = Now End If End Function Public Sub PauseField(ByVal Row As Long, ByVal Col As Long, ByVal Length As Long, Optional ByVal sKey As String) If R Is Nothing Then Exit Sub If AtField(Row, Col, Length) Then Enter sKey End If Exit Sub End Sub _______________________________ Scott Nathanson Clinical Information Systems Knowledge Management Group University of California Davis Health System Office: 916-734-0941 email: [EMAIL PROTECTED] "Corinna Robertson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent by: cc: [EMAIL PROTECTED] Subject: RE: [Talk] FW: PauseLoop issue RESOLVED TATION.COM 08/20/2003 05:08 PM Please respond to Talk The example you show is looking for data to the left of the cursor so it is only true when the cursor is in the position that has name directly to it's left, if the screen looked like this Name Joe Somebody Address 123 anywhere And the cursor was sitting at the end of the address the name check would also be true it would just matter as to which one the loop hit first which would throw everything off. The example I used and a few of the others which were similar in concept work because ( I am going to use my example because I can see where the cursor will be I would say If At(" Name") Then 'could be true even if I am at address If Col < 19 Then 'this could only be true if I am at name Do something Else At "" 'here I must have been at address and I need to still be able to find name so I clear the at End if End if Let me know if this does not clear things up for you. Thanks, Corinna -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lew Hundley Sent: Wednesday, August 20, 2003 6:29 PM To: [EMAIL PROTECTED] Subject: RE: [Talk] FW: PauseLoop issue RESOLVED OK Corinna, you all have me completely confused now. I'm not trusting my own instincts, and the information I am getting is just muckin' up my mind. You say that the PauseLoop that I am using is true the entire time I am on the screen. I interpret this to mean that it doesn't look to the left or right of the cursor, it looks at the entire screen?? If so, why doe the PauseLoop Command help text show this example? Do 'fills out name and address prompts... PauseLoop "Name:", Name & "~" PauseLoop "Address:", Address & "~" PauseLoop "Zip:", Zip & "~" Wait .1 Loop Until At("File?") '...until complete If my understanding is correct, the PauseLoop is looking for Discharge time at position 10, 37, as stated by the re-directed reference from PauseLoop to At() * "[EMAIL PROTECTED],c" is satisfied if the "string" begins at row r, column c, What makes your suggested "If" statement any different, except it looks to the left with the "< 40" test. It has been a long day of fighting this issue, and I really want to understand, but maybe I need a new start tomorrow. Please be kind and explain it in no more than two syllable words. J TKs Lew Hundley Information Specialist - Programmer Silverton Hospital Silverton Oregon 503.873.1657 [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Corinna Sent: Wednesday, August 20, 2003 10:11 AM To: [EMAIL PROTECTED] Subject: RE: [Talk] FW: PauseLoop issue RESOLVED I'm not so sure that is the right fix lou, it may be just a coincidence it works but I would not rely on it. example: PauseLoop "Discharge [EMAIL PROTECTED],37", "~" this will be true the entire time you are on the screen, pauseloop won't find the same thing twice in a row so that helped it work but I don't think it is reliable more reliable would be something like this: If At("Discharge Time") Then if Col < 40 then do whatever else at "" endif endif Thanks, Corinna Robertson Boston Software Systems [EMAIL PROTECTED] www.bostonworkstation.com The Essential Tool for Healthcare Integration 866-653-5105 ext. 8 508-653-5105 -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lew Hundley Sent: Wednesday, August 20, 2003 12:36 PM To: [EMAIL PROTECTED] Subject: [Talk] FW: PauseLoop issue RESOLVED Geez, I don't know why, but 90% of the time it seems that just after writing up an issue, I am able to come up with a fix. I just had not specified the other strings' row/col. As soon as I did that, all worked fine. I hope some good comes of this. Maybe someone, when working on a multiple column runs into a problem, this will come to mind. The new Do Loop follows: Do 'Stable 1 Wait 0.4 PauseLoop "Discharge [EMAIL PROTECTED],37", "~" 'Stable 1 Wait 0.4 PauseLoop "Discharge [EMAIL PROTECTED],37", "~" 'Stable 1 Wait 0.4 PauseLoop "Alt Desc [EMAIL PROTECTED],1", "~" Wait 0.4 PauseLoop "Arrival [EMAIL PROTECTED],1", "~" Wait 0.4 PauseLoop "Admit [EMAIL PROTECTED],1", "~" Wait 0.4 'Stable 1 PauseLoop "Admit [EMAIL PROTECTED],1", "~" Wait 0.04 'Stable 1 PauseLoop "Admit [EMAIL PROTECTED],1", "~" DoEvents Wait 0.2 Loop Until At("Discharge [EMAIL PROTECTED],37") 'And (At(" @9,55") Or At("@9,58")) TKs Lew Hundley Information Specialist - Programmer Silverton Hospital Silverton Oregon 503.873.1657 [EMAIL PROTECTED] -----Original Message----- From: Lew Hundley [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 9:28 AM To: BostonWorkStation Talk ([EMAIL PROTECTED]) Subject: PauseLoop issue Well, I call it the pauseloop issue, but I am not sure. See the attached doc. My issue is that I have a two column screen, and I have had various issues while trying to run this. The original issue was that I couldn't get the cursor to stop on Discharge Disp. I figured that out. It was because strings in the second column were being statisfied by strings in the first column (I would want to PauseLoop on Discharge Date, but in my Do Loop Admit Date was also being satisfied, so an enter would be keyed, and I would end up 2 or 3 fields beyond Discharge Disp). I have ended up trying to be specific about Discharge Date, by adding cursor positions, but that is not working right now. Any suggestions? TKs Lew Hundley Information Specialist - Programmer Silverton Hospital Silverton Oregon 503.873.1657 [EMAIL PROTECTED]
<<attachment: winmail.dat>>
