caramen Posted August 16, 2018 Share Posted August 16, 2018 Hi, Still learning String commands I whould like to know if there is a way to search a word (Windows) in all my patterns. In one time. I know how to find the word in one line. :: I made that : Func Copie() Send ("^c") $dData = ClipGet () $aSplit = StringSplit($dData, @CRLF, 3) ;~ _ArrayDisplay ($aSplit) Local $WindowsHere = StringInStr(""&$aSplit[0], "Windows") If $WindowsHere <> 0 Then MsgBox($MB_SYSTEMMODAL, "Windows", "Windows word is here") EndIf EndFunc This is my input in my ClipGet () : Chacune des commandes suivantes peut être lancée via l'option "Exécuter" Windows 7. Ce menu peut également être ouvert à l'aide du raccourci clavier Touche Windows + R. A noter que les commandes peuvent-être directement tapées dans le champs "Rechercher" du menu démarrer. Si vous utilisez Windows Vista, vous pouvez consulter l'astuce des commandes de Vista. Activation de Windows L’assistant : dans <Exécuter> taper slui puis OK Ajout/Fonctionnalité Windows : dans <Exécuter> taper optionalfeatures puis OK Ou <Panneau de configuration> - <Programmes> dans < Programmes et Fonctionnalités> dans la partie gauche Activer ou désactiver des fonctionnalités Windows Ajout/Suppression de programmes : dans <Exécuter> taper appwiz.cpl puis OK Ou <Panneau de configuration> - <Programmes> Désinstaller un programme Administrateur BDE : dans <Exécuter> taper bdeadmin.cpl puis OK Ou dans C:\Programmes\Common Files\Borland My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 16, 2018 Share Posted August 16, 2018 @caramen Don't split the Clipboard content Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted August 16, 2018 Author Share Posted August 16, 2018 (edited) @FrancescoDiMuro Haha ok What is the command then with StringinStr ? Local $WindowsHere = StringInStr(""&$dData, "Windows",0,1) How can i check if i got 1 or more result ? Edited August 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 16, 2018 Share Posted August 16, 2018 @caramen If you want to use StringInStr(), you have to use another variable that counts how many occurrences are in the string. Or, you could use StringRegExp(), but don't ask me how Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted August 16, 2018 Author Share Posted August 16, 2018 (edited) I am taking this as a challenge ok i come back with the correct syntaxt !!! @FrancescoDiMuro Just if you can learn me how to to use another variable that counts how many occurrences are in the string. I am checking myself with stringregexp Edited August 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 16, 2018 Share Posted August 16, 2018 Go for it! Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted August 16, 2018 Author Share Posted August 16, 2018 14 minutes ago, FrancescoDiMuro said: Go for it! $aArray = StringRegExp(''&$dData, 'Windows', $STR_REGEXPARRAYGLOBALFULLMATCH) $aMatch = 0 For $i = 0 To UBound($aArray) - 1 $aMatch = $aArray[$i] For $j = 0 To UBound($aMatch) - 1 MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 4 - " & $i & ',' & $j, $aMatch[$j]&@CRLF&"Total = "&$Count + 1) $Count = $Count + 1 Next ;~ $Total = $Count ;~ MsgBox($MB_SYSTEMMODAL, "Bumber of occurrence = "&$Total ) Next $Total = $Count MsgBox($MB_SYSTEMMODAL, "Occurrence","Number of occurrence = "&$Total ) EndFunc Working My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted August 16, 2018 Author Share Posted August 16, 2018 (edited) FrancescoDiMuro Just if you can learn me how to to use another variable that counts how many occurrences are in the string. With the first methode i mean. Edited August 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted August 16, 2018 Author Share Posted August 16, 2018 (edited) Func Copie() $Total = 0 Send ("^c") $dData = ClipGet () $aArray = StringRegExp(''&$dData, 'Windows', $STR_REGEXPARRAYGLOBALFULLMATCH) $aMatch = 0 For $i = 0 To UBound($aArray) - 1 $aMatch = $aArray[$i] For $j = 0 To UBound($aMatch) - 1 MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 4 - " & $i & ',' & $j, $aMatch[$j]&@CRLF&"Total = "&$Count + 1) $Count = $Count + 1 Next Next $Total = $Count MsgBox($MB_SYSTEMMODAL, "Total","Total = "&$Total) EndFunc I never used For ... Next How to get that working ? $Total = $Count MsgBox($MB_SYSTEMMODAL, "Total","Total = "&$Total) Becose it s nice but i whould like to not straying stuck in the while xD Edited August 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
mikell Posted August 16, 2018 Share Posted August 16, 2018 4 hours ago, caramen said: how to to use another variable that counts how many occurrences are in the string. Hint : StringReplace($text, "Windows", "Windows") $n = @extended Msgbox(0,"", $n & " occurences") caramen 1 Link to comment Share on other sites More sharing options...
caramen Posted August 16, 2018 Author Share Posted August 16, 2018 thx My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now