$Proverka = "Hello"
If $Proverka = "Hello" Then
MsgBox(0, "", "Ok")
EndIf
$Proverka = "1234;730;482;0001"
$String = StringSplit($Proverka, ";")
For $i = 0 To $String[0]
If $String[$i] = 730 Then
MsgBox(0, "", "Ok = " & $String[$i])
EndIf
Next
#Proverka = 123
Или так:
#Proverka= 123
Или так:
#Proverka=123
Или так:
#Proverka = 123
Но не так:
#ProverkaKbn = 123
И не так:
#Proverka = sdkghdkg
MsgBox(0, "", $Proverka)
ConsoleWrite($Proverka & @CRLF)
If $Proverka = 6 Then
;Ваше действие
EndIf
$kolstr = _FileCountLines(@ScriptDir & '\test.txt')
For $i = 1 to $kolstr
If StringRegExp(StringStripWS(FileReadLine(@ScriptDir & '\test.txt', $i), 8), '#Proverka=[\d]*') = 1 Then MsgBox(0, '', 'OK!')
Next
$hFile = FileOpen(@ScriptDir & "\1.txt")
$hRead = FileRead($hFile)
$String = StringSplit($hRead, "=")
MsgBox(0, "", StringStripWS($String[1], 8))
MsgBox(0, "", StringStripWS($String[2], 8))
$hFile = FileOpen(@ScriptDir & "\1.txt")
$hRead = FileRead($hFile)
$String = StringSplit($hRead, "=")
For $i = 1 To $String[0]
MsgBox(0, "", StringStripWS($String[$i], 8))
Next
#include <file.au3>
$kolstr = _FileCountLines(@ScriptDir & '\1.txt')
For $i = 1 to $kolstr
$hRead = FileReadLine(@ScriptDir & "\1.txt", $i)
$String = StringSplit(StringStripWS($hRead, 8), "=")
If $String[1] = '#Proverka' And IsNumber($String[2]) Then MsgBox(0, '', 'OK!')
Next
WriteFile("Test.txt", "AutoIt", "3.3.6.1")
MsgBox(0, "", ReadFile("Test.txt", "AutoIt"))
Func WriteFile($iFile, $iKey, $iValue)
FileWriteLine($iFile, $iKey & "=" & $iValue)
EndFunc
Func ReadFile($iFile, $iKey)
$hFile = FileOpen($iFile)
$hRead = FileRead($hFile)
$hLine = StringSplit($hRead, @CRLF, 1)
For $i = 0 To $hLine[0]
If StringInStr($hLine[$i], $iKey) = 1 Then
Return StringTrimLeft($hLine[$i], StringLen($iKey) + 1)
EndIf
Next
EndFunc
#Include<Array.au3>
$sText = "#Proverka = 123" & @CRLF & _
"Или так:" & @CRLF & _
"#Proverka= 123" & @CRLF & _
"Или так:" & @CRLF & _
"#Proverka=123" & @CRLF & _
"Или так:" & @CRLF & _
"#Proverka = 123" & @CRLF & _
"Но не так:" & @CRLF & _
"#ProverkaKbn = 123" & @CRLF & _
"И не так:" & @CRLF & _
"#Proverka = sdkghdkg"
$sPatern = "(#Proverka\s*=\s*\d+)(?:\r|$)"
$aResult = StringRegExp( $sText, $sPatern, 3 )
_ArrayDisplay($aResult, ' Test Result ')
Автор темы | Похожие темы | Форум | Ответы | Дата |
---|---|---|---|---|
V | Распознание текста c Teseract | Общие вопросы по AutoIt | 0 | |
А | [Окна, Диалоги] распознание изменений в окне | Разработка ботов | 1 | |
A | Распознание активного окна | Автоустановка приложений | 1 | |
A | Распознание голоса(Google) | Общие вопросы по AutoIt | 42 | |
Z | Проблема с распознанием цвета после сноса Win7 | Общение | 14 |