Slavko 0 Posted June 1, 2011 Hello good souls, I am a poet and programming codes, we just do not go by the hand ... and still standing in the dark with eyes tied! This script is just a picture of what I would have liked to help in the writing of sonnets .... I try to imagine how the records count on the fingers and the worst is that I do not have enough fingers, the sonnets have a 11-12 record ... Once again I ask for help when writing code ... I leave with a smile ... Slavko expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <file.au3> Opt('MustDeclareVars', 1) Example1() Func Example1() Local $msg, $myedit, $font GUICreate("write songs", 800, 650, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) GUISetState() GUICtrlCreateEdit("Mod: write songs: Title song", 250, 50, 300, 400) ;-----------Search Baze_1.txt (dictionary)------ ( *.xxxx, *.xxx , *.xx )-- GUICtrlCreateListView("off|Found rhymes ", 560, 50, 160, 400) ;-----------Search Baze_1a.txt (new - dictionary)----- ( *.xxxx, *.xxx , *.xx )-- GUICtrlCreateListView("Poet rhymes ", 55, 50, 160, 400) ;-----------Search Baze_1a.txt (dictionary)--------------------------------- GUICtrlCreateListView("alphabetical order first letter", 55, 460, 160, 150) ;-----------Search Baze_[$poets].txt (new-poets of the world)---------------- GUICtrlCreateListView("verse - with the required set of |name of the poet", 250, 460, 470, 150) ;-----------example of how to count syllables (a, e, i, o, u)---------- ;-----------in sonnet verse has 11 syllables, the English sonnet 12---- GUICtrlCreateEdit("T" & @CRLF & @CRLF & "11" & @CRLF & "12" & @CRLF & "12" _ & @CRLF & "11" & @CRLF & @CRLF & "8" & @CRLF,225, 50, 20, 400) ;---------------------------------------------------------------------- $font = "Comic Sans MS" GUISetFont(12, 400, 4, $font) ; will display underlined characters GUICtrlCreateLabel("CreateEdit", 340, 10) ;---------------------------------------------------------------------- ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() EndFunc ;==>Example1 Share this post Link to post Share on other sites
Slavko 0 Posted June 5, 2011 It may sound unbelievable, I'm trying to figure out and I'm very concerned but do not go, I do not know where'm wrong .... I have a base in which to find a suitable rhyme and write it in List1 expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <file.au3> #Region ### START Koda GUI section ### Form=traži stih.kxf $Form1_1 = GUICreate("pronađi stihove", 249, 497, 396, 129) $upis_rime = GUICtrlCreateInput("upis_rime", 8, 8, 233, 21) $List1 = GUICtrlCreateList("", 8, 72, 233, 396, BitOR($LBS_SORT,$LBS_STANDARD,$WS_VSCROLL,$WS_BORDER)) $Button1 = GUICtrlCreateButton("trži", 8, 40, 105, 25, 0) $Button2 = GUICtrlCreateButton("izlaz", 136, 40, 105, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $baza1 = @ScriptDir & "\Stihovi_1.txt" $baza2 = $upis_rime $baza3 = $List1 Global $aBaza1 _FileReadToArray($baza1,$aBaza1) For $i=1 to $aBaza1[0] FileWrite($baza3,"-" & $aBaza1[$i] & @CRLF & @CRLF) If StringLen($aBaza1[$i])=5 Then $aBaza2[$i] = StringTrimLeft($aBaza1[$i],1) For $j=1 to $aBaza1[0] $checking=StringRegExp(".*" & $aBaza1[$i] & "\z",$aBaza1[$j],0) If $checking=1 Then GUICtrlSetData($baza3, $checking) EndIf Next If $i < $aBaza1[0] Then GUICtrlSetData($baza3, $checking & @CRLF & @CRLF) Next FileClose($hbaza3) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Share this post Link to post Share on other sites