Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/25/2012 in all areas

  1. New versions of Microsoft Office have been released since the last changes were made to the Word UDF. New file types and new functions need to be supported. This updated version supports Word 2003 up to Word 2010. The latest version of AutoIt is needed to use the latest COM error handler. Some rarely used functionality has been removed, new functions have and will be added. The attached PDF shows what's different between Word.au3 and WordEX.au3 You'll find examples for every function ready to run. Please tell me what you think, about missing functions etc. 2012-07-31 - Version 1.0 - Downloads: 89 2012-08-23 - Version 1.1 - Downloads: 26 2012-08-26 - Version 1.2 - Downloads: 277 2012-12-29 - Version 1.3 - Downloads: 937 2013-07-28 - This download page is no longer needed - the rewritten Word UDF is now part of the latest beta version!
    1 point
  2. ok $GUI = GUICreate("Form1", 307, 439) Will create a window with the title Form1 that has 307pixels width and 439pixels height $Label1 = GUICtrlCreateLabel("Message:", 8, 8, 50, 17) Will create a static Label control ,with the text "Message:",with left coordonate 8 and the right coordonate 8,width 50 pixels and height 17 $TextEdit = GUICtrlCreateEdit("", 8, 32, 289, 369) Will create an Edit control,with left 8px,top 32px,width 289px and height 369px $SaveButton = GUICtrlCreateButton("Save", 112, 408, 75, 25) Will create a button with the text "Save", left 112px,top 408px,width 75px and height 25px GUISetState(@SW_SHOW) Will set the GUI state as "Show" $file=FileOpen("msg.txt",2) FileOpen opens a text file for reading or writing. While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 ;$GUI_EVENT_CLOSE Exit Case $SaveButton $data=GUICtrlRead($TextEdit) FileWrite($file,$data) FileClose($file) MsgBox(64, "Thank you","thanks we will respond soon") Exit EndSwitch Sleep(10) WEnd This is the main loop of the program $nMsg = GUIGetMsg() Polls the GUI to see if any events have occurred. Case -3 ;$GUI_EVENT_CLOSE Exit Check if the "x" (close) button is pressend and close the program Case $SaveButton $data=GUICtrlRead($TextEdit) FileWrite($file,$data) FileClose($file) MsgBox(64, "Thank you","thanks we will respond soon") Exit Check if the "Save" button is pressed and then save the read the text from the Edit control($TextEdit) and save it into $data Then using FileWrite he write the $data into the file Then shows the MessageBox and exit Hope you understant something Sorry for my bad english. Here you can find all functions: http://www.autoitscript.com/autoit3/docs/functions.htm Here is the documentation: http://www.autoitscript.com/autoit3/docs/
    1 point
  3. I was searching Google for something and it led me to this link. After looking at it, and looking at guinness's concerns, I'd like to chime in. 1. IMO, there's no error for a function like this. The person(s) using the function are responsible for managing their parameters. 2. Anything using DllStruct-Create/GetData whatever, is going to be slower normally than a simple concatenation. The only time I could see this being different maybe, is if the strings are huge and memory starts to get eaten up, but AutoIt's memory management is pretty well setup, so I don't see that really happening. This is true for single Chars or 2+Chars. 3. StringFormat(); well, it's not meant for speed, that's for sure. Long story short, the only way I can see it being faster: 1. For long strings, dllcall to dll that manages the data itself without having to manage struct usage inside AutoIt. 2. Get rid of error checking. 3. We can save 1 loop cycle doing it the below way. Func _StringRepeat($sString, $nCount) If $sString = Chr(0) Then Return Local $sRStr = $sString For $i = 1 To Int($nCount) - 1 $sRStr &= $sString Next Return $sRStr EndFunc Edit: This may be faster even: Func _StringRepeat($sString, $nCount) Local $iLen = StringLen($sString) If $iLen = 0 Then Return Local $iMax = $iLen * $nCount While StringLen($sString) < $iMax $sString &= $sString WEnd Return StringLeft($sString, $iMax) EndFunc Edit2: The last one has my vote. After benchmarking each, it was the most consistent in time to finish ( loops tested from 1 to 500 repeats over and over ). At a certain point, it was never more than 3 or 4 milliseconds, while the others were 10, 20, 30+ milliseconds as the string grew (makes sense).
    1 point
×
×
  • Create New...