Skip to main content

Hello everyone,
We have upgraded to v16.0 of the new MICRO FOCUS REFLECTION DESKTOP PRO. In the older version of Reflection, v14, I was able to search for text and capture that data in a string using the old .findtext and .gettext methods. In the newer version of Reflection, v16.0, it appears that only the .gettext method is available to me. I have been successful in retrieving data from the screen using this method

Sub SEARCH_NEW()
' Generated by the Reflection Macro Recorder on 07-01-2017 14:19:51.59.
' Generated by Micro Focus Reflection Desktop Pro (16.0.308.0).
'
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim HELLO As Variant

Const NEVER_TIME_OUT = 0

Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M

Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen

LF = Chr(10)
CR = Chr(13)

'this method actually works to retrieve a line of data from the screen as of 7/14/2017.
' need to be able to search for a specific piece of data after splitting the line of text
'
HELLO = ThisScreen.GetText(5, 1, 80)

MsgBox HELLO

Exit Sub

End Sub



In the above listed example, if I have data on my computer screen it will identify the STRING of text on the 5th row starting at column 1 and then going to column 80. This is fine with me, but I am unable to search for a specific identifying word on my screen....
Using the screenshot below, I would be extracting the String " UID: 0771950001 " (notice the leading and trailing spaces. I can use the trim function to condense and the split function to parse)

ACCESSION: UR 0714 1
PATIENT: DUCK, DAFFEY
ORDER #: 1149674
SSN/ID: ABC-12-LMOP
UID: 0771950001
DOB: Oct 31, 1901
LOCATION: ED
DATE ORDERED: Jul 14, 2017
COLLECTED: Jul 14, 2017@02:40
PROVIDER: LEGHORN, FOGHORN
LAB ARRIVAL: Jul 14, 2017@02:48



With the older Reflection, I was able to use the .FindText method to search for a specific Identifying word/phrase and once found, identify the specific screen row and screen column that it was found. This made it easier to capture the specific data pieces based on the KNOWN value above. The screen position is not always the same so my ROW changes from time to time... I want to be able to search for "SSN/ID:" as my string and once found I would then be able to identify the row it was located in. I could then set my variable to increment for each subsequent work/phrase based on that ROW location...


Can anyone suggest a good equivalent method to use in the newer version of REFLECTION...


#Desktop
#Reflection

Hello everyone,
We have upgraded to v16.0 of the new MICRO FOCUS REFLECTION DESKTOP PRO. In the older version of Reflection, v14, I was able to search for text and capture that data in a string using the old .findtext and .gettext methods. In the newer version of Reflection, v16.0, it appears that only the .gettext method is available to me. I have been successful in retrieving data from the screen using this method

Sub SEARCH_NEW()
' Generated by the Reflection Macro Recorder on 07-01-2017 14:19:51.59.
' Generated by Micro Focus Reflection Desktop Pro (16.0.308.0).
'
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim HELLO As Variant

Const NEVER_TIME_OUT = 0

Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M

Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen

LF = Chr(10)
CR = Chr(13)

'this method actually works to retrieve a line of data from the screen as of 7/14/2017.
' need to be able to search for a specific piece of data after splitting the line of text
'
HELLO = ThisScreen.GetText(5, 1, 80)

MsgBox HELLO

Exit Sub

End Sub



In the above listed example, if I have data on my computer screen it will identify the STRING of text on the 5th row starting at column 1 and then going to column 80. This is fine with me, but I am unable to search for a specific identifying word on my screen....
Using the screenshot below, I would be extracting the String " UID: 0771950001 " (notice the leading and trailing spaces. I can use the trim function to condense and the split function to parse)

ACCESSION: UR 0714 1
PATIENT: DUCK, DAFFEY
ORDER #: 1149674
SSN/ID: ABC-12-LMOP
UID: 0771950001
DOB: Oct 31, 1901
LOCATION: ED
DATE ORDERED: Jul 14, 2017
COLLECTED: Jul 14, 2017@02:40
PROVIDER: LEGHORN, FOGHORN
LAB ARRIVAL: Jul 14, 2017@02:48



With the older Reflection, I was able to use the .FindText method to search for a specific Identifying word/phrase and once found, identify the specific screen row and screen column that it was found. This made it easier to capture the specific data pieces based on the KNOWN value above. The screen position is not always the same so my ROW changes from time to time... I want to be able to search for "SSN/ID:" as my string and once found I would then be able to identify the row it was located in. I could then set my variable to increment for each subsequent work/phrase based on that ROW location...


Can anyone suggest a good equivalent method to use in the newer version of REFLECTION...


#Desktop
#Reflection
marshallgrads,

It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.

These forums are peer-to-peer, best effort, volunteer run and that if your issue
is urgent or not getting a response, you might try one of the following options:

- Visit https://www.microfocus.com/support-and-services and search the knowledgebase and/or check
all the other self support options and support programs available.
- Open a service request: https://www.microfocus.com/support
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.microfocus.com)
- You might consider hiring a local partner to assist you.
https://www.partnernetprogram.com/partnerfinder/find.html

Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.microfocus.com/faq.php

Sometimes this automatic posting will alert someone that can respond.

If this is a reply to a duplicate posting or otherwise posted in error, please
ignore and accept our apologies and rest assured we will issue a stern reprimand
to our posting bot.

Good luck!

Your Micro Focus Forums Team
http://forums.microfocus.com



marshallgrads,

It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.

These forums are peer-to-peer, best effort, volunteer run and that if your issue
is urgent or not getting a response, you might try one of the following options:

- Visit https://www.microfocus.com/support-and-services and search the knowledgebase and/or check
all the other self support options and support programs available.
- Open a service request: https://www.microfocus.com/support
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.microfocus.com)
- You might consider hiring a local partner to assist you.
https://www.partnernetprogram.com/partnerfinder/find.html

Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.microfocus.com/faq.php

Sometimes this automatic posting will alert someone that can respond.

If this is a reply to a duplicate posting or otherwise posted in error, please
ignore and accept our apologies and rest assured we will issue a stern reprimand
to our posting bot.

Good luck!

Your Micro Focus Forums Team
http://forums.microfocus.com


I have been able to figure it out.. The new Reflections v16 offers several GetText methods. GetText, GetText2, GetText3. I am using the GetText2 method.
This seems to work extremely well. I can then set variables based on the extracted/split phrases I need and then have REFLECTIONS automatically enter those into my Macro for an automated run sequence with very little user input... Hurray !!!

In my example, I am wishing to pull out the "UR 0721 1" text.

if screen text =
Select Accessioning menu Option: lookup accession
Select Accession or UID: ur 1
ur URINALYSIS
URINALYSIS (JUL 21, 2017) 1

-------------------------------------------------------------------------------
ACCESSION: UR 0721 1 PATIENT: Duck, Daffey




Sub NAME_TEST()

' Generated by the Reflection Macro Recorder on 07-17-2017 15:17:44.80.
' Generated by Micro Focus Reflection Desktop Pro (16.0.308.0).

'====================================================
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim returnValue As Integer
'====================================================
Const NEVER_TIME_OUT = 0
'====================================================
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
'====================================================
Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen
'====================================================
LF = Chr(10)
CR = Chr(13)
'====================================================

SCRAPETEXT = ThisScreen.GetText2(1, 1, 24, 80)
' CAPTURE THE ENTIRE SCREEN TEXT BY STARTING AT ROW 1, COLUMN 1 AND GO TO ROW 24, COLUMN 80.
MsgBox "THIS IS YOUR SCREEN TEXT: "

Hello everyone,
We have upgraded to v16.0 of the new MICRO FOCUS REFLECTION DESKTOP PRO. In the older version of Reflection, v14, I was able to search for text and capture that data in a string using the old .findtext and .gettext methods. In the newer version of Reflection, v16.0, it appears that only the .gettext method is available to me. I have been successful in retrieving data from the screen using this method

Sub SEARCH_NEW()
' Generated by the Reflection Macro Recorder on 07-01-2017 14:19:51.59.
' Generated by Micro Focus Reflection Desktop Pro (16.0.308.0).
'
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim HELLO As Variant

Const NEVER_TIME_OUT = 0

Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M

Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen

LF = Chr(10)
CR = Chr(13)

'this method actually works to retrieve a line of data from the screen as of 7/14/2017.
' need to be able to search for a specific piece of data after splitting the line of text
'
HELLO = ThisScreen.GetText(5, 1, 80)

MsgBox HELLO

Exit Sub

End Sub



In the above listed example, if I have data on my computer screen it will identify the STRING of text on the 5th row starting at column 1 and then going to column 80. This is fine with me, but I am unable to search for a specific identifying word on my screen....
Using the screenshot below, I would be extracting the String " UID: 0771950001 " (notice the leading and trailing spaces. I can use the trim function to condense and the split function to parse)

ACCESSION: UR 0714 1
PATIENT: DUCK, DAFFEY
ORDER #: 1149674
SSN/ID: ABC-12-LMOP
UID: 0771950001
DOB: Oct 31, 1901
LOCATION: ED
DATE ORDERED: Jul 14, 2017
COLLECTED: Jul 14, 2017@02:40
PROVIDER: LEGHORN, FOGHORN
LAB ARRIVAL: Jul 14, 2017@02:48



With the older Reflection, I was able to use the .FindText method to search for a specific Identifying word/phrase and once found, identify the specific screen row and screen column that it was found. This made it easier to capture the specific data pieces based on the KNOWN value above. The screen position is not always the same so my ROW changes from time to time... I want to be able to search for "SSN/ID:" as my string and once found I would then be able to identify the row it was located in. I could then set my variable to increment for each subsequent work/phrase based on that ROW location...


Can anyone suggest a good equivalent method to use in the newer version of REFLECTION...


#Desktop
#Reflection
You can also utilize the SPLIT function to help you separate and parse data.

SPLIT_TEXT = Split(expression or string you want to parse, parsing term, how many pieces to parse)

Hello everyone,
We have upgraded to v16.0 of the new MICRO FOCUS REFLECTION DESKTOP PRO. In the older version of Reflection, v14, I was able to search for text and capture that data in a string using the old .findtext and .gettext methods. In the newer version of Reflection, v16.0, it appears that only the .gettext method is available to me. I have been successful in retrieving data from the screen using this method

Sub SEARCH_NEW()
' Generated by the Reflection Macro Recorder on 07-01-2017 14:19:51.59.
' Generated by Micro Focus Reflection Desktop Pro (16.0.308.0).
'
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim HELLO As Variant

Const NEVER_TIME_OUT = 0

Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M

Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen

LF = Chr(10)
CR = Chr(13)

'this method actually works to retrieve a line of data from the screen as of 7/14/2017.
' need to be able to search for a specific piece of data after splitting the line of text
'
HELLO = ThisScreen.GetText(5, 1, 80)

MsgBox HELLO

Exit Sub

End Sub



In the above listed example, if I have data on my computer screen it will identify the STRING of text on the 5th row starting at column 1 and then going to column 80. This is fine with me, but I am unable to search for a specific identifying word on my screen....
Using the screenshot below, I would be extracting the String " UID: 0771950001 " (notice the leading and trailing spaces. I can use the trim function to condense and the split function to parse)

ACCESSION: UR 0714 1
PATIENT: DUCK, DAFFEY
ORDER #: 1149674
SSN/ID: ABC-12-LMOP
UID: 0771950001
DOB: Oct 31, 1901
LOCATION: ED
DATE ORDERED: Jul 14, 2017
COLLECTED: Jul 14, 2017@02:40
PROVIDER: LEGHORN, FOGHORN
LAB ARRIVAL: Jul 14, 2017@02:48



With the older Reflection, I was able to use the .FindText method to search for a specific Identifying word/phrase and once found, identify the specific screen row and screen column that it was found. This made it easier to capture the specific data pieces based on the KNOWN value above. The screen position is not always the same so my ROW changes from time to time... I want to be able to search for "SSN/ID:" as my string and once found I would then be able to identify the row it was located in. I could then set my variable to increment for each subsequent work/phrase based on that ROW location...


Can anyone suggest a good equivalent method to use in the newer version of REFLECTION...


#Desktop
#Reflection

Just wanted to add on to this thread.   I was able to figure this out after another user pointed me in the direction.

Sub BUTCH_FINDTEXTONSCREEN()
' as of 11/18/21 this works !!!!

Dim Point As ScreenPoint
Dim text As String


'MsgBox "LINES: " & ThisScreen.DisplayRows
'MsgBox "COLUMNS: " & ThisScreen.DisplayColumns

    'Set Point = ThisScreen.SearchText("data", 1, 1, FindOptions_Backward)                                                               'this works !!
    Set Point = ThisScreen.SearchText("ACCESSION:", 1, 1, FindOptions_Forward)
    'Set Point = ThisScreen.SearchText4("disciplinary", 1, 1, row, Column, FindOptions_Backward, TextComparisonOption_IgnoreCase)       'this DOES NOT work
    
    
    'Get the Text
   text = ThisScreen.GetText(Point.row, Point.Column, 80)                      ' THIS WORKS
   'text = ThisScreen.GetText(Point.row + 1, Point.Column, 80)                  ' THIS WORKS
   'text = ThisScreen.GetText(Point.row + 1, Point.Column + 1, 100)              ' THIS WORKS
  
MsgBox text
MsgBox "The specified text was found on ROW: " & Point.row & " Column: " & Point.Column
'MsgBox Point.Column
'MsgBox Point.row

MsgBox "LENGTH OF TEXT IS: " & Len(text)

End Sub

Hello everyone,
We have upgraded to v16.0 of the new MICRO FOCUS REFLECTION DESKTOP PRO. In the older version of Reflection, v14, I was able to search for text and capture that data in a string using the old .findtext and .gettext methods. In the newer version of Reflection, v16.0, it appears that only the .gettext method is available to me. I have been successful in retrieving data from the screen using this method

Sub SEARCH_NEW()
' Generated by the Reflection Macro Recorder on 07-01-2017 14:19:51.59.
' Generated by Micro Focus Reflection Desktop Pro (16.0.308.0).
'
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim HELLO As Variant

Const NEVER_TIME_OUT = 0

Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M

Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen

LF = Chr(10)
CR = Chr(13)

'this method actually works to retrieve a line of data from the screen as of 7/14/2017.
' need to be able to search for a specific piece of data after splitting the line of text
'
HELLO = ThisScreen.GetText(5, 1, 80)

MsgBox HELLO

Exit Sub

End Sub



In the above listed example, if I have data on my computer screen it will identify the STRING of text on the 5th row starting at column 1 and then going to column 80. This is fine with me, but I am unable to search for a specific identifying word on my screen....
Using the screenshot below, I would be extracting the String " UID: 0771950001 " (notice the leading and trailing spaces. I can use the trim function to condense and the split function to parse)

ACCESSION: UR 0714 1
PATIENT: DUCK, DAFFEY
ORDER #: 1149674
SSN/ID: ABC-12-LMOP
UID: 0771950001
DOB: Oct 31, 1901
LOCATION: ED
DATE ORDERED: Jul 14, 2017
COLLECTED: Jul 14, 2017@02:40
PROVIDER: LEGHORN, FOGHORN
LAB ARRIVAL: Jul 14, 2017@02:48



With the older Reflection, I was able to use the .FindText method to search for a specific Identifying word/phrase and once found, identify the specific screen row and screen column that it was found. This made it easier to capture the specific data pieces based on the KNOWN value above. The screen position is not always the same so my ROW changes from time to time... I want to be able to search for "SSN/ID:" as my string and once found I would then be able to identify the row it was located in. I could then set my variable to increment for each subsequent work/phrase based on that ROW location...


Can anyone suggest a good equivalent method to use in the newer version of REFLECTION...


#Desktop
#Reflection

I am not getting along at all well with V16. I used to love v14. I cant even work out how to do a 'Find' to search for text on the screen history as I could with v14 (where I'd use control + F). I have set the Terminal Setup for standard keyboard shortcuts. I'm pulling my hair out!!


Just wanted to add on to this thread.   I was able to figure this out after another user pointed me in the direction.

Sub BUTCH_FINDTEXTONSCREEN()
' as of 11/18/21 this works !!!!

Dim Point As ScreenPoint
Dim text As String


'MsgBox "LINES: " & ThisScreen.DisplayRows
'MsgBox "COLUMNS: " & ThisScreen.DisplayColumns

    'Set Point = ThisScreen.SearchText("data", 1, 1, FindOptions_Backward)                                                               'this works !!
    Set Point = ThisScreen.SearchText("ACCESSION:", 1, 1, FindOptions_Forward)
    'Set Point = ThisScreen.SearchText4("disciplinary", 1, 1, row, Column, FindOptions_Backward, TextComparisonOption_IgnoreCase)       'this DOES NOT work
    
    
    'Get the Text
   text = ThisScreen.GetText(Point.row, Point.Column, 80)                      ' THIS WORKS
   'text = ThisScreen.GetText(Point.row + 1, Point.Column, 80)                  ' THIS WORKS
   'text = ThisScreen.GetText(Point.row + 1, Point.Column + 1, 100)              ' THIS WORKS
  
MsgBox text
MsgBox "The specified text was found on ROW: " & Point.row & " Column: " & Point.Column
'MsgBox Point.Column
'MsgBox Point.row

MsgBox "LENGTH OF TEXT IS: " & Len(text)

End Sub

I am not getting along at all well with V16. I used to love v14. I cant even work out how to do a 'Find' to search for text on the screen history as I could with v14 (where I'd use control + F). I have set the Terminal Setup for standard keyboard shortcuts. I'm pulling my hair out!!