0

Recently, my IBM PCOMM had been upgraded at my job to version 12.0.0.1. Ever since, if I'm trying to detect blank space, and something was already there previously, that text will show up when I use autECLPS.GetText even though all I see is black. I need a way to see if there is hidden text so I know I can go onto the next procedure. I've been using autECLPS.GetTextRect to see if I can match entire blocks of text, but that's becoming tedious. Any suggestions?

UPDATED

Here's what I have so far:

ElseIf LineCount < 3 Then
    ' If we've gone through less than three lines, we need
    ' to determine if the next line is visible.
    ' ***************************************************************
    ' Due to IBM PCOMM changing their process from actually clearing
    ' screens when going from one to the next to changing the
    ' color of the previous data, there may be some ghost data
    ' present. This code checks to see if any previous data is
    ' hidden from view and determines whether or not to continue.
    ' ***************************************************************
    If SMonth = EMonth Or SMonth <> EMonth And j > 1 And k > 1 Then
        If ScreenName = "MHI" And EditWarnMsg = "E065NO MORE CLMS ON FILE," Then
            Result = objUNET.autECLPS.GetTextRect(SvcLn1, 1, SvcLn3, 80)
            If Left(Result, 2) = POS(j) And Trim(Mid(Result, 4, 6)) = Serv(j) And Trim(Mid(Result, 36, 2)) = RC(j) Then
                Exit Do
             ElseIf Left(Result, 2) = POS(j - 1) And Trim(Mid(Result, 4, 6)) = Serv(j - 1) And Trim(Mid(Result, 36, 2)) = RC(j - 1) Then
                 Exit Do
             ElseIf Left(Result, 2) = POS(j - 2) And Trim(Mid(Result, 4, 6)) = Serv(j - 2) And Trim(Mid(Result, 36, 2)) = RC(j - 2) Then
                  Exit Do
              ElseIf Left(Result, 2) = POS(j - 3) And Trim(Mid(Result, 4, 6)) = Serv(j - 3) And Trim(Mid(Result, 36, 2)) = RC(j - 3) Then
                  Exit Do
              ' If the initial If criteria renders ICN to not have been
              ' found, this will cause a range error. We want to resume
              ' on to the next process if such error occurs.
              On Error Resume Next
              ElseIf Trim(Mid(Result, 165, 10)) = ICN(k) And Trim(Mid(Result, 28, 10)) = Draft(k) Then
                  Exit Do
              ElseIf Trim(Mid(Result, 165, 10)) = ICN(k - 1) And Trim(Mid(Result, 28, 10)) = Draft(k - 1) Then
                  Exit Do
              On Error GoTo 0
              Else
                  GoTo POSBlank
              End If
          End If
      End If
  End If
End If
Lou
  • 389
  • 3
  • 20
  • 38
  • Wrap your `GetTextRect` calls into a utility function, call that function instead of doing the whole thing every time? If you [edit] to add the code you're using, people could help. Right now I'm not sure you'll get many answers, I doubt IBM PCOMM devs are swarming Stack Overflow's VBA tag... – Mathieu Guindon Aug 11 '17 at 19:26
  • Sorry about that. I added the code that I'm using to do my search. All of these are array elements that have been created while searching from page to page. I'm going back in this section to see if what is being copied in the `GetTextRect` is previous info that I don't want to copy again. – Lou Aug 11 '17 at 19:55
  • 1
    changing color of text to make it invisible sounds like it may pose a data security threat. bring it to the attention of your employer. maybe your employer will get something changed so that the data does not linger on screen. – jsotola Aug 11 '17 at 20:19
  • It's not much of a security threat. PCOMM accesses a very secure database structure. Data is merely getting masked instead of erased...which makes it difficult to detect blank space. – Lou Aug 16 '17 at 14:11

1 Answers1

0

After receiving advice from the talented people on SO, and doing a bit more research, I've changed my code to a solution that works. It's not much different from the original, but it's more reliable.

If SMonth = EMonth Or SMonth <> EMonth And j > 1 And k > 1 Then
    If ScreenName = "MHI" And EditWarnMsg = "E065NO MORE CLMS ON FILE," Then
        ' Attempt to refresh the connection list
        ' to get current data on the screen.
        objConnMgr.autECLConnList.Refresh
        Result = objUNET.auteclps.GetTextRect(SvcLn1, 1, SvcLn3, 80)
        ' See if we've already processed this place of service
        If Left(Result, 2) = POS(j - 1) Or Left(Result, 2) = POS(j - 2) Or Left(Result, 2) = POS(j - 3) Then
            ' See if we've already processed this service code matching the POS
            If Trim(Mid(Result, 4, 6)) = Serv(j - 1) Or Trim(Mid(Result, 4, 6)) = Serv(j - 2) Or Trim(Mid(Result, 4, 6)) = Serv(j - 3) Then
                ' See if we've already processed this remark code matching the POS and service code
                If Trim(Mid(Result, 36, 2)) = RC(j - 1) Or Trim(Mid(Result, 36, 2)) = RC(j - 2) Or Trim(Mid(Result, 36, 2)) = RC(j - 3) Then
                    ' If start month equals end month, stop the process
                    If SMonth = EMonth Then
                        Exit Do
                    Else
                        GoTo POSBlank  ' Continue process by going to label
                    End If
                End If
            End If
            ' See if we've already processed this ICN
            If Trim(Mid(Result, 165, 10)) = ICN(k - 1) Or Trim(Mid(Result, 165, 10)) = ICN(k - 2) Then
                ' See if we've already processed this draft number matching the ICN
                If Trim(Mid(Result, 28, 10)) = Draft(k - 1) Or Trim(Mid(Result, 28, 10)) = Draft(k - 2) Then
                    If SMonth = EMonth Then
                        Exit Do
                    Else
                        GoTo POSBlank
                    End If
                End If
            End If
        End If
    End If
End If
Lou
  • 389
  • 3
  • 20
  • 38