[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
'REM This line calls the macro subroutine


'- 題名:〇
'------------------------------------------------------------------------------
'- 名称:
'- 機能:
'- 目的:
'- 環境:
'- 記述:
'- メモ:
'- 使方:
'------------------------------------------------------------------------------
'- 作成:Create by ozzne 2003.02.07
'- 更新:Update by ozzne 2003.07.31
'-
'=============================================================================
'= main routin = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
'
    Option Explicit

    autECLSession.SetConnectionByName(ThisSessionName)
    call subSub1_



'= end of main = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
'==============================================================================
'= subtoutins  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
'
'- 機能:〇メインルーチン
'------------------------------------------------------------------------------
'- 引数:
'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'- 戻値:
'------------------------------------------------------------------------------
'- 作成:Create by ozzne 2003.02.07
'- 更新:Update by ozzne 2003.07.31
'-
Sub subSub1_()
    Const NextPageStr = "続く"

    Dim autPsObj 'As AutPS 'PCOMM.autECLPS.1
    Dim FlgBoo 'As Boolean
    Dim RowLng 'As Long
    Dim ColLng 'As Long
    Dim SearchStr 'As String
    Dim LoopCounter 'As Long

    Set autPsObj = autECLSession.autECLPS
    SearchStr = InputBox("検索したい文字列を指定してください。")
    If SearchStr = "" Then
        MsgBox "値が入力されていないかキャンセルされました。"
    Else
        FlgBoo = False: RowLng = 1: ColLng = 1
        Do While autPsObj.SearchText(NextPageStr, 1, RowLng, ColLng)
            '画面に指定文字列が存在するか検索
            'pcSrchForward = 1: pcSrchBackward = 2
            RowLng = 1: ColLng = 1
            If autPsObj.SearchText(SearchStr, 1, RowLng, ColLng) Then
                MsgBox "画面に " & SearchStr & " が見つかりました。" & _
                       vbCrLf & "Row:" & RowLng & " Col:" & ColLng
                autPsObj.SetCursorPos RowLng, ColLng
                FlgBoo = True: Exit Do
            Else
                With autECLSession
                    '以下4行は実行する順序が重要なので修正時に注意
                    .autECLOIA.WaitForInputReady
                    .autECLPS.SendKeys "[roll up]"
                    .autECLPS.WaitForAttrib 20,6,"00","3c",3,5000
                    .autECLOIA.WaitForAppAvailable
                End With
            End If
            If LoopCounter >= 10 then Exit Do
            LoopCounter = LoopCounter + 1
            RowLng = 1: ColLng = 1
        Loop
        '最後のページ又は1ページしかない場合の処理
        If FlgBoo = False Then
            RowLng = 1: ColLng = 1
            If autPsObj.SearchText(SearchStr, 1, RowLng, ColLng) Then
                MsgBox "画面に " & SearchStr & " が見つかりました。" & _
                       vbCrLf & "Row:" & RowLng & " Col:" & ColLng
                autPsObj.SetCursorPos RowLng, ColLng
            Else
                MsgBox "指定文字列が見つかりません。"
            End If
        End If
    End If
    Set autPsObj = Nothing
End Sub


'= end of sub  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
'==============================================================================
'