Jump to content

TheDcoder

Active Members
  • Posts

    7,103
  • Joined

  • Days Won

    88

Everything posted by TheDcoder

  1. @guinness Sorry but I didn't understand what you said
  2. , There seems to be no way to generate the code in KODA. If that's true, I am afraid that you need to replace the foreign chars in SciTE itself (after pasting the generated code in it) TD
  3. Check this post: https://www.autoitscript.com/forum/topic/169485-paste-chinese-text-in-scite/?do=findComment&comment=1237814 TD
  4. Third Contribution! Maybe useful when you need to convert an 1D Array to an 2D Array #include-once #include <Array.au3> ; <----- ONLY NEEDED FOR EXAMPLE, REMOVE BEFORE USING!!! #include <StringConstants.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: ArraySplit ; Description ...: Similar to StringSplit, Converts an 1D Array to an 2D Array based on delimiters ; Syntax ........: ArraySplit(ByRef $aArray, $sDelimiter) ; Parameters ....: $aArray - Array to process. ; $sDelimiter - Delimiter to split array. ; Return values .: Success: An 2D Array ; Failure: 0 & sets @error to: ; @error : 1 = Not an array ; 2 = Delimiter was not found in an element (@extended contains the element's index no.) ; Author ........: TheDcoder ; Modified ......: N/A ; Remarks .......: There should be only 1 delimiter in each element of the Array!!! Only Text before & after the first delimiter will be present in col 1 & col 2 ; Related .......: StringSplit ; Link ..........: bit.ly/ArraySplitForAutoIt ; Example .......: Yes ; =============================================================================================================================== Func ArraySplit(ByRef $aArray, $sDelimiter) If Not IsArray($aArray) Then Return SetError(1, 0, 1) ; The statment itself states what it does $iArrayLen = Ubound($aArray) ; We need Array's length (or no. of elements) Local $aReturn[$iArrayLen][2] ; Delare a 2D Array with 2 coloumns for returning For $i = 0 To $iArrayLen - 1 ; Loop through Array $aTempArray = StringSplit($aArray[$i], $sDelimiter, $STR_ENTIRESPLIT) ; StringSplit the string & store it in an array If $aTempArray[0] = 1 Then Return SetError(2, $i, 0) $aReturn[$i][0] = $aTempArray[1] ; Put the first string in Coloumn 0 $aReturn[$i][1] = $aTempArray[2] ; Put the second string in Coloumn 1 Next Return $aReturn ; Return the Array EndFunc ; Example Local $aArray[3] = ["x=1", "y=2", "z=3"] ; Declare the Array $aArray = ArraySplit($aArray, '=') ; Convert an 1D Array to an 2D Array based on a delimiter _ArrayDisplay($aArray) ; Display the array #cs ---------------------- Visual example ---------------------- This is our $aArray: | Data | ----------------------- 0. | "x=1" | ----------------------- 1. | "y=2" | ----------------------- 2. | "z=3" | ----------------------- This is our $aArray after ArraySplit (with delimiter as "=" (Equal Sign)): | Column 0 | Column 1 | --------------------------------- 0. | "x" | 1 | --------------------------------- 1. | "y" | 2 | --------------------------------- 2. | "z" | 3 | --------------------------------- #ce ---------------------- Visual example ----------------------Hope you may find it useful, TD
  5. @guinness There are 3 main reasons, 1 is there is a new (production) version which has a new data type called "Tables Map" IIRC, 2nd is that it looks like a bit outdated & hard for beginners to understand, 3rd is that we should aware new (& some old) users of AutoIt so that they can get the most out of it... TD
  6. @water I saw it used in For loops contained in For loops, like this: For $i = 0 To UBound($aArray) For $j = 0 To $iNumber ; Code Next NextI saw that in Array.au3 IIRC, TD
  7. First issue : There is a missing prefix called "j" in the "Name of variables" section... I hope someone can add it! TD
  8. Hello ! This thread is dedicated for the wiki page named "Best coding practices". You can post any issues, comments & suggestion here... This thread is useful if: 1. You are busy & you want someone to fix it. 2. You lack the knowledge to fix it. 3. You can't understand wiki syntax. That wiki page contains *so much* potential but it needs some attention, love & care! Please include as much information as possible before posting your issue or comment or suggestion. TD
  9. @Jon Yes, you can down vote there too.
  10. How about a IRC server dedicated to AutoIt?
  11. @minx Oh , I think I mis-understood whole concept of up & down vote system. I think its a great way to select a best answer, instead of OP having to choose it like in the previous forum
  12. @Jon Maybe removing the up vote & down vote system would be better, If someone likes the post they will "like" it
  13. Oh no, I wanted to post the code, maybe someone can find my work useful It has code in it, so I think it would fit in dev forum, . But if you feel like moving it to example script, do it! I don't have any objections TD
  14. @guinness Its discontinued now... I made it for my Magic Number Calculator , I was gonna replace magic numbers with constants until I found the execute function TD
  15. Hello , I am very sad today ... I (half) made a complicated function which already exists in AutoIt... I call it CalcStringExp (Calculates math expression which are enclosed in strings [or which are in a string variant]) which is a clone of Execute. Here is the source code if you wish to see it (its not fully complete): Lesson Learnt: Always search the help file as many times as possible before committing to anything! (like asking a question or making a function) TD P.S This thread was lost in yesterday's upgrade, so I re-posted it (that mean today = yesterday!)
  16. If you follow water's advice to extract your images to a temporary folder, there is something which you need to remember: You can extract files from .rar but NOT add files to a .rar Just my 2 cents, TD P.S I know that this is water's style! But I wanted to do it!
  17. @water Don't mistake me, the gift is the link to the utility
  18. Take this, Its a gift from me. Hope you many know how to use it, TD
  19. @kashamalasha Excellent! I am glad that you figured it out... I posted this to tell you that M23 is not gonna reply anytime soon, because he is on vacation (or atleast that's what his title says) TD
  20. jchd meant You need to provide more info if you want us to help you, TD
  21. @pd This UDF was last updated in 2009... Since 2009 there were many script breaking changes, You need to work around the UDF to make it work TD
×
×
  • Create New...