I’m new to the posting in the form community and hesitant to insult the talent
I have seen posted here and interested in learning to help others in the process.
My background is not coding and I have learned to code by observing the work and like
of this of this community.
Attachmate Reflection Suite for X 14.0.6029
Reflection for UNIX and OpenVMS
Version 14.0.6 build 687 32-bit
'For purpose of Chronic Pain Management
Working Date Range Calculator within Reflections- with following result.
Selected 30 Day
Original [11/04-12/3/2014 Inclusive]
Rf x 4 [11/06-12/05; 12/06-01/04; 01/05-02/03; 02/04-03/05; 03/06-4/4/2015]
Objective-Parse Number of Refills and Day Supply from screen
Start Date 'CurDat ‘Current Date by Default or users own.
Dim numRefills As String '’ Number of Refills Defaults to 30 Day;
Dim daySupply As String ‘ Default to 30 ‘for Class II Narcotics or User Defined.
This side of having a dynamic screen scrapping table this is my attempt to find an answer.
'==================================Screen Data===========================================
(8) Days Supply: 30 '8 not univeral; may change based on screen edits
(10) # of Refills: 5 (11) Routing: MAIL '10 not univerasl
'==================================Code Below============================================
I have seen posted here and interested in learning to help others in the process.
My background is not coding and I have learned to code by observing the work and like
of this of this community.
Attachmate Reflection Suite for X 14.0.6029
Reflection for UNIX and OpenVMS
Version 14.0.6 build 687 32-bit
'For purpose of Chronic Pain Management
Working Date Range Calculator within Reflections- with following result.
Selected 30 Day
Original [11/04-12/3/2014 Inclusive]
Rf x 4 [11/06-12/05; 12/06-01/04; 01/05-02/03; 02/04-03/05; 03/06-4/4/2015]
Objective-Parse Number of Refills and Day Supply from screen
Start Date 'CurDat ‘Current Date by Default or users own.
Dim numRefills As String '’ Number of Refills Defaults to 30 Day;
Dim daySupply As String ‘ Default to 30 ‘for Class II Narcotics or User Defined.
This side of having a dynamic screen scrapping table this is my attempt to find an answer.
'==================================Screen Data===========================================
(8) Days Supply: 30 '8 not univeral; may change based on screen edits
(10) # of Refills: 5 (11) Routing: MAIL '10 not univerasl
'==================================Code Below============================================
Code:
Sub gNumRef_Test()
'Get Number of Refills - daySupply
Dim numRefills As Integer
Dim daySupply As Integer
Dim Found As Integer
Dim numLine As Integer
Dim arraySrchNumRefill(1 To 2) As String 'Case Select for status of "of Refills: "
arraySrchNumRefill(1) = "Enter RETURN to continue:"
arraySrchNumRefill(2) = "? Yes//"
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)
Const NEVER_TIME_OUT = 0 'prevents macro Endless Loop
On Error GoTo ErrorHandler
With Session
.CapsLock = True
numRefills = 0
daySupply = 0
Found = 0
numLine = 0
'********* Macro searches for 'of Refills: ' and makes sure its on the screen ******************
.Wait "00:00:01"
.StatusBar = "searching list for Number of Refills"
.Transmit "SL" & CR 'search list
.Transmit "of Refills: " & CR
Select Case .Parent.Application.WaitForStrings(arraySrchNumRefill)
Case (1)
.Transmit "+" & CR 'Press Return to continue
Case (2)
.Transmit "N" & CR 'Refill Found; Find Next? No
'A...... N and CR is ignored 'LEAVING PROMPT ON SCREEN ......................................>
'B...... ACTIVE SCREEN PROMPT: "Find Next "of Refills: '? Yes//" .............................>
'............................................................> GoTo C............................>
End Select
'********* Screenscraping for 'of Refills: '******************************************************
.Wait "00:00:01"
Found = .FindText("of Refills: ", 0, 0)
MsgBox Found
'C....> Found = -1 'Value of Found
'D....> Macro Terminates here '.............................. GoTo to Line Before.............>E
If Not Found Then '# of Refills
MsgBox "Number of Refills Not Found, exiting macro."
Exit Sub
Else 'found # of Refills
numLine = .GetText(.FoundTextRow, 0, .FoundTextRow, 1) 'captures the line#
'E....> Macro Terminates here
MsgBox numLine
numRefills = .GetText(.FoundTextRow, 74, .FoundTextRow, 75)'captures refills remaining
MsgBox numRefills
daySupply = .GetText(.FoundTextRow, 78, .FoundTextRow, 79) 'captures days supply
MsgBox daySupply
End If
End With
Exit Sub
ErrorHandler:
Session.MsgBox Err.description, vbExclamation + vbOKOnly
'G....> Error Type Mismatch
End Sub