Hello Everyone,
I'm trying to get a value from the below function and pass it to strPrice.
What's weird is I the function itself will show the value but it is not
returning to strPrice. Not sure what I am doing wrong.
I would appreciate any suggestions. Thanks.
Sub FindPrice()
Dim strPrice As String
Connect "BPE Batch Payment Entry - Affinity", stWindows
strPrice = GetPriceTextout(582, 63)
End Sub
------------------------------------------------------------------------------------------------------------------------------------------
Function GetPriceTextout(x As String, y As String) As String
Dim TOut As New CTextout
Dim yourvalue As String
Connect "BPE Batch Payment Entry - Affinity", stWindows
Key "@_LOGON" ' Dipping into the screen output.
Set TOut.w = R
' Clearing the prior text out string
TOut.LikeTextOutString = ""
' Setting the filter stuff. Not really necessary
TOut.LikeX = x
TOut.LikeY = y
' This is an infinite loop. You want to modify the script so it will jump out
' Once it finds what it's looking for.
' You might want to put some logic in to handle a possible situation
' were the x and y are never found.
Dim Loops As Integer
Loops = 0
Do
Loops = Loops + 1
View B:=bcTextOutNoClear
' This inner loop is saying search through the buffered up information for
' The information I'm looking for.
Do Until TOut.IsEmpty
TOut.NextTextOut
If TOut.Filtered Then
Debug.Print TOut.x, TOut.y, TOut.TextOutString
' This line stores the value on the screen to a variable.
yourvalue = TOut.TextOutString
GetTextout = TOut.TextOutString
Exit Function
End If
If TOut.x = "582" And TOut.y = "63" Then
' Insert stuff here.
End If
Loop
Wait 0.2
'TOut.ReDraw
RePaint
Loop Until Loops > 10
If Loops > 10 Then
'MsgBox ("I didn't find anything")
Exit Function
End If
End Function
Rob McGinness, Information Services
Interface Programmer/Analyst
Rutland Regional Medical Center
160 Allen St, Rutland VT 05701
P 802.747.6526 F 802.773.7576
[email protected]<mailto:[email protected]>
www.rrmc.org<http://www.rrmc.org/>
Our Vision:
To be the Best Community Hospital and Health System in New England
This message (and any included attachments) is from Rutland Regional Health
Services and is intended only for the addressee(s). The information contained
herein may include privileged or otherwise confidential information.
Unauthorized review, forwarding, printing, copying, distributing, or using such
information is strictly prohibited and may be unlawful. If you received this
message in error, or have reason to believe you are not authorized to receive
it, please promptly delete this message and notify the sender by e-mail.
Thank You
--- To post a message to this list, send mail to: [email protected] You are
currently subscribed as: [email protected] Unsubscribe in the
customer center on our website:
http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx