1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
|
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)
ACTION
'_____________________________________________________________________________________________
Function TmpFic
TmpFic = "D:\Temp\tmp_find.txt"
End Function
'_____________________________________________________________________________________________
sub ACTION()
Dim NbCols
Dim NbLigs
dim TxtStx
dim TxtIni
Dim Rech
Dim i
Dim j
Dim Ok
Dim Arret
Dim LigDebut
Dim ColDebut
'for i = 1 to 3
' autECLSession.autECLPS.SendKeys "[roll up]"
' autECLSession.autECLOIA.WaitForAppAvailable
' 'autECLSession.autECLOIA.WaitForInputReady
'next
'exit sub
Rech = Ucase(inputbox("Chaine à rechercher :", "Recherche dans sous-fichier", LIT_MOT_CLE))
if TRIM(Rech)="" then
exit sub
end if
STOCK_MOT TRIM(Rech)
Ok=0
NbCols = autECLSession.autECLPS.NumCols
NbLigs = autECLSession.autECLPS.NumRows
LigDebut=autECLSession.autECLPS.CursorPosRow
ColDebut=autECLSession.autECLPS.CursorPosCol
TxtIni = autECLSession.autECLPS.GetText(1, 1, NbLigs * NbCols)
TxtStx = TxtIni
Do while ok = 0
j=LigDebut
for j=LigDebut to NbLigs
i=ColDebut
for i=ColDebut to NbCols - len(Rech)
if Rech = UCase(Mid(TxtStx, i + ((j-1)*NbCols), len(Rech))) then
autECLSession.autECLPS.SetCursorPos j, i
Ok=1
Exit For
End if
Next
If Ok=1 then
Exit For
End if
ColDebut = 1
Next
'msgbox j & " - " & i
LigDebut = 1
if ok = 0 THEN
autECLSession.autECLPS.SendKeys "[roll up]"
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
END IF
if ok = 1 then 'or TxtStx = autECLSession.autECLPS.GetText(1, 1, NbLigs * NbCols) or TxtIni = autECLSession.autECLPS.GetText(1, 1, NbLigs * NbCols) then
Exit Do
Else
TxtStx = autECLSession.autECLPS.GetText(1, 1, NbLigs * NbCols)
End If
loop
If ok=0 then
Msgbox "'" & Rech & "' n'a pas été trouvé..."
end if
end sub
'_____________________________________________________________________________________________
Sub STOCK_MOT(Mot_Cle)
Dim Fs, f
Set Fs = CreateObject("Scripting.FileSystemObject")
If Fs.fileExists(TmpFic) = false then
Fs.CreateTextFile TmpFic, True
end if
Set f = Fs.OpenTextFile(TmpFic, 2, -2)
f.writeline Mot_Cle
f.Close
End Sub
'_____________________________________________________________________________________________
Function LIT_MOT_CLE
Dim Fs, f
Set Fs = CreateObject("Scripting.FileSystemObject")
If Fs.fileExists(TmpFic) = false then
Exit Function
end if
Set f = Fs.OpenTextFile(TmpFic, 1, -2)
LIT_MOT_CLE = f.Readline
f.Close
End Function |
Partager