NeriXs
Messages postés116Date d'inscriptionlundi 4 mai 2015StatutMembreDernière intervention18 août 2020
-
24 déc. 2017 à 11:33
NeriXs
Messages postés116Date d'inscriptionlundi 4 mai 2015StatutMembreDernière intervention18 août 2020
-
26 déc. 2017 à 23:34
Bonjour,
J'ai un petit souci avec ce code!
Lorsqu'une modification est faite depuis le TxtSource, celle-ci n'est pas prise en compte lors du click sur mon button.
Pouvez-vous m'indiquer comment recharger le contenue du TxtSource?
<html> <head> <title>My HTML application</title> <HTA:APPLICATION APPLICATIONNAME="My HTML application" ID="MyHTMLapplication" VERSION="1.0"/> </head>
<!-- LABEL TxtSource --> <label for="LabSource">Saisir le texte à traiter:</label></P>
<!-- TEXTBOX TxtSource --> <TEXTAREA type="text" name="TxtSource" Value ="" style="height:55px; width:500px">-\-\\\*-****/Un test, Pourquoi faire? c'est fou ça! \****-*///*/</TEXTAREA></P>
bpermute = True Do While bpermute = True bpermute = False For t = 0 To UBound(arrDicoItem)-1 If CInt(Split(arrDicoItem(t),": ")(1)) > CInt(Split(arrDicoItem(t + 1),": ")(1)) Then cprovisoire = arrDicoItem(t) arrDicoItem(t) = arrDicoItem(t + 1) arrDicoItem(t + 1) = cprovisoire bpermute = True End If Next Loop
strList = objDico.Count & " correspondance(s) trouvée(s):" & vbcrlf For i = 0 To UBound(arrDicoItem) strList = strList & "(" & i+1 & ")" & " " & arrDicoItem(i) & vbCrLf Next
Dim result result = StrText For i=UBound(arrDicoItem) To 0 Step -1 Dim parse1, parse2, intstr parse1 = "(" & Left(Split(arrDicoItem(i),"trouvée " & """")(1),1) & ")" parse2 = Split(arrDicoItem(i),"position: ")(1) intstr = Len(result) result = Left(result,parse2) & parse1 & Right(result, intstr - parse2 - 1) Next
Set objDico = Nothing
Sub Button_Onclick() TxtList.value = strList TxtResult.value = result End Sub
Sub Recherche(Caractere) Dim regex, matches Dim Pattern, match, i Pattern = "([^" & Caractere & "]|^)(" & Caractere & ")(?!" & Caractere & ")"
Set regex = New RegExp regex.Pattern = Pattern regex.Global = True
Set matches = regex.Execute(StrText)
For Each match In matches For i = 1 To match.Submatches.Count - 1 Step 2 If Not (match.Submatches(i) = "") Then objDico.Add match.FirstIndex + Len(match.Value) - 1, _ "Correspondance trouvée """ & _ match.Submatches(i) & """ en position: " & _ match.FirstIndex + Len(match.Value) - 1 End If Next Next