Jump to content

TheDcoder

Active Members
  • Posts

    7,103
  • Joined

  • Days Won

    88

Everything posted by TheDcoder

  1. I doubt that there would be a "_Word_Test.doc" in @TempDir ready for me to open... I am guessing that you copy & pasted that from the example? By the way, I am trying to create an empty word document using the Word UDF.
  2. @Jfish Oh! , Thanks for pointing it out , Here is my modified code: #include <Word.au3> Global $oWord = _Word_Create(False, True) Global $oDoc = _Word_DocAdd($oWord) _Word_DocSaveAs($oDoc) MsgBox(0, @error, @extended) But... I am still getting the same error
  3. Hello, I am trying to save an word document but it won't work , This is my REALLY simple script: #include <Word.au3> Global $oWord = _Word_Create(False, True) _Word_DocSaveAs($oWord) MsgBox(0, @error, @extended) And my MsgBox: I know that its a COM error because @error is set 2... but what about the COM error code? I cannot find anything related to -2147352570!
  4. If anyone wants me to be specific, I am looking for a way to insert text into the "Outline" of the document rather than in the document itself!
  5. Hello, a long time since I have posted in this section . Its always tricky to find Microsoft Documentation , does anyone know where the Word COM API's Documentation is located? Thanks in Advance! TD
  6. Try this code: #include <Array.au3> #include <String.au3> #include <ButtonConstants.au3> #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1_1 = GUICreate("Form1", 863, 645, 192, 123) $Tab1 = GUICtrlCreateTab(8, 8, 841, 553, $TCS_FIXEDWIDTH) $Main = GUICtrlCreateTabItem("Main") $idDate1 = GUICtrlCreateMonthCal(@YEAR &'/'&@MON &'/'& @MDAY, 142, 157, 249, 185) $idDate2 = GUICtrlCreateMonthCal(@YEAR &'/'&@MON &'/'& @MDAY, 478, 157, 257, 185) $Label1 = GUICtrlCreateLabel("Start Date", 227, 125, 83, 28) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("End Date", 563, 125, 82, 28) GUICtrlSetFont(-1, 15, 400, 0, "MS Sans Serif") $go = GUICtrlCreateButton("Run", 568, 382, 99, 33) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $stop = GUICtrlCreateButton("Stop and Exit", 216, 382, 99, 33) GUICtrlSetFont(-1, 8, 400, 0, "Arial") GUICtrlCreateTabItem("") $Progress1 = GUICtrlCreateProgress(8, 608, 390, 25) $Progress2 = GUICtrlCreateProgress(430, 609, 390, 25) $Label5 = GUICtrlCreateLabel("Main Progress", 8, 584, 74, 17) $Label6 = GUICtrlCreateLabel("Current Process Progress", 429, 589, 123, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $stop Exit Case $go $Date1 = GUICtrlRead($idDate1) $Date2 = GUICtrlRead($idDate2) ;GuiDelete($Form1) $Date1 = StringSplit($Date1,'/',2) $Date2 = StringSplit($Date2,'/',2) MsgBox(0,'Date',$Date1[0] & '/' & $Date1[1] & '/' & $Date1[2] & ' - ' & $Date2[0] & '/' & $Date2[1] & '/' & $Date2[2]) EndSwitch WEnd You were using the same variable for the StringSplit string and the Date Control ID, The Date control ID would be overwritten when StringSplit is called... in the 2nd run GUICtrlRead cannot read the Date control because there is no control ID in $Date1 and $Date2.
  7. @Muhammad_Awais_Sharif There is a link called "Report post" at the top of every post .
  8. There is no repository for UDFs, you have to just download the .au3 scripts from the web and read them in SciTE, that's the only way
  9. TheDcoder

    SQLite

    I understand now...
  10. TheDcoder

    SQLite

    Can you please tell me how you made that kind of boxes?
  11. @edwick I have been successfully using VirtualBox to demo my scripts, they work just as well in VMs . If your setup was normal, everything should go fine!
  12. I don't think that silent installation gives you much options though ...
  13. Oh, I am sad ... I will be waiting for a improved version though
  14. There are 2 ways you can use my UDF. The 1st is the simplest which returns the Exit Code + Output at the end, The 2nd one is more hard to do but with it you will be able to get the output from the start of the process! The 2nd method is demonstrated in the example script, its the part where you see live output from tracert google.com , you can study the code and check the documentation for more information .
  15. You can just #include my .au3 file to call them, open the au3 file separately to see the code
  16. Ok .... btw, its not required to use my functions, just study them and make your code work using it as a reference
  17. You spelled it wrong! , Its "TheDcoder" . Anyway, have you downloaded my UDF yet? It contains an example for reading the output of a program, you should study the code! I can help you with anything you don't understand in it .
  18. I have updated the tutorial to match with freenode's current infrastructure
  19. I made an UDF called Process UDF, it has useful functions and examples for reading console output .
  20. Here we have another strange issue again... Have anyone of you guys experienced a black hole? I mean, not a physical black hole , but a internet blackhole I have a situation where sometimes the selected records don't get received and I get an empty array: And sometimes the Query which I send to the MySQL server never reaches to it... Also, in both cases NO error was being reported.
  21. That is bad, I have 6 GB of RAM and most of time, its not used .
  22. No worries , I always appreciate input no matter how its presented to me . Thanks for the link! but I am not really very serious about this implementation of a PRNG , I only did this as an exercise... I know that this PRNG is highly unsuitable for any real world use... and I am not planning to make it a PRNG which can be used in Cryptographic operations!! I know that its VERY HARD . I just submitted this piece of code for someone who is looking to get started. I have decided to add a big red WARNING message near the code .
  23. Hmm... Yes, you are correct. That code is flawed and is not even middle square method... As I have expected, I am not good at this! I will try to wrap my brain around this again, so expect a retouch to the code soon...
  24. Hello! After watching a whole day of "Journey into cryptography" at Khan Academy, I have got to know the secrets behind some sneaky things! . This is one of em', A PRNG (Pseudo Random Number Generator). Its features (atleast what I believe) are: Simple, short and crappy. Great for beginners who are baffled by the mechanics of random number generation in computers! Support for custom seeds! EIGHT DIGITS OF RANDOMNESS!!! Unlike all other PRNGs, This one is predictable 1000 possible PRNs when using @MSEC as the seed. No option for min or max, the min is 10000000 and the max is 99999999. The Unlicensed . #cs LICENSE This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org/> #ce LICENSE ; #FUNCTION# ==================================================================================================================== ; Name ..........: MiddleSquareRandom ; Description ...: Pseudo-random number generator based on the infamous "Middle Sqaure" method. ; Syntax ........: MiddleSquareRandom([$iSeed = @MSEC]) ; Parameters ....: $iSeed - [optional] A seed for generation of the random number. Default is @MSEC. ; Return values .: A pseudorandom 8 digit integer. ; Author ........: John von Neumann ; Modified ......: Damon Harris (TheDcoder) - Conversion into AutoIt and simplification + further crappification. ; Remarks .......: Fun Fact - The output is based on the $iSeed passed, Same $iSeed = Same pseudo-random number. ; Related .......: Random() ; Link ..........: https://en.wikipedia.org/wiki/Middle-square_method ; Example .......: ConsoleWrite(MiddleSquareRandom() & @CRLF) ; =============================================================================================================================== Func MiddleSquareRandom($iSeed = @MSEC) Local Const $TURNS = 8 Local $sRandomNumber, $sSeed For $iTurn = 1 To $TURNS $iSeed = $iSeed * 2 $sSeed = String($iSeed) $sRandomNumber &= StringMid($sSeed, Ceiling(StringLen($iSeed) / 2), 1) Next Return Int($sRandomNumber) EndFunc Enjoy your numbers, TD . P.S NEVER USE THIS FUNCTION IN A REAL WORLD IMPLEMENTATION OF SOMETHING WHICH USES RANDOM NUMBERS!!! THIS ONE IS VERY UNSUITABLE FOR THAT PURPOSE! READ THE POSTS BELOW FOR MORE INFORMATION.
×
×
  • Create New...