ynbIpb
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору araneon, Как-то так: Код: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 189, 152, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 32, 16, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 48, 64, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _check_input() EndSwitch WEnd Func _check_input() $sInputTxt = GUICtrlRead ($Input1) If $sInputTxt = "" Then MsgBox (0, "", "Нет текста!") Return EndIf If StringLen ($sInputTxt) <> 4 Or StringLeft ($sInputTxt, 1) <> "3" Or StringIsDigit ($sInputTxt) = 0 Then MsgBox (0, "", "Неверные данные!") Return EndIf MsgBox (0, "", "Всё ОК!") EndFunc | madmasles, упс... точно, поправил. С регулярками не дружу, по этому выбрал такой подход. | Всего записей: 1645 | Зарегистр. 01-05-2006 | Отправлено: 16:10 18-07-2013 | Исправлено: ynbIpb, 19:33 18-07-2013 |
|