#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $text =""
Local $space_words = ""
Local $hGUI = GUICreate("Работа с текстом",700,500)
Local $myedit = GUICtrlCreateEdit ("", 0, 0,500,200, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
Local $mybutton1 = GUICtrlCreateButton ("сгенерировать текст", 0, 200,180,40)
GUISetState(@SW_SHOW, $hGUI)
While 1
$msg = GUIGetMsg()
if $msg = $GUI_EVENT_CLOSE then
ExitLoop
endif
if $msg = $mybutton1 then
generate_text()
GUICtrlSetData($myedit,$space_words)
endif
Wend
Func generate_text()
for $z = 0 to 250
$text &= Chr(Random(65, 91, 1))
Next
for $z = 0 to 250
$r = Random(5,15,1)
for $i = 0 to $r
$space_words &= StringMid($text,$z+$i,1)
next
$space_words &= StringMid($text,$z+$i,1) & " "
Next
EndFunc
|