Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/07/2013 in all areas

  1. Just thought I'd contribute something simple. If you want simple version control, you can just do this at the beginning of your code. Source Versioning: #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Run_After=mkdir "%scriptdir%\ver" #AutoIt3Wrapper_Run_After=copy /V /Y "%in%" "%scriptdir%\ver\%scriptfile%_%fileversion%.au3" Binary Versioning Add: #AutoIt3Wrapper_Run_After=copy /V /Y "%out%" "%scriptdir%\ver\%scriptfile%_%fileversion%.exe" The mkdir will only be used first time to create the versioning folder, then gets ignored in subsequent tries. I add this to all my code. Rick
    2 points
  2. look into conditionally using continueloop, or only proceeding to the next _myfunction if the return of the current is as expected While 1 _MyFunction_1() _MyFunction_2() If Not _MyFunction_3() Then ContinueLoop _MyFunction_4() WEnd --OR-- While 1 _MyFunction_1() _MyFunction_2() $bContinue = _MyFunction_3() If $bContinue Then _MyFunction_4() WEnd --OR-- While 1 _MyFunction_1() _MyFunction_2() If _MyFunction_3() Then _MyFunction_4() WEnd Func _MyFunction_3() If $x = 1 Then ;RESTART THE MAIN While Return False Else ... EndIf Return True EndFunc ;==>_MyFunction_3 lots of ways to skin the cat
    1 point
  3. use wingetpos: #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 386, 274) $Tab1 = GUICtrlCreateTab(0, 0, 385, 273) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") GUICtrlSetState(-1, $GUI_SHOW) $input1 = GUICtrlCreateInput("Click in here", 60, 34, 100, 22) $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Tab1 $pos = WinGetPos($Form1) If GUICtrlRead($Tab1) = 0 Then WinMove($Form1, "", $pos[0], $pos[1], 386, 274) GUICtrlSetPos($Tab1, -1, -1, 386, 274) ElseIf GUICtrlRead($Tab1) = 1 Then WinMove($Form1, "", $pos[0], $pos[1], 276, 300) GUICtrlSetPos($Tab1, -1, -1, 276, 300) EndIf EndSwitch WEnd edit: made it "tidy"
    1 point
  4. Hi, Welcome to the autoit forum You should post in the Example Scripts forum section in so far as it's not to ask for help. Maybe a moderator will move your topic. Br, FireFox.
    1 point
  5. Melba23

    Text-converter not working

    p2p2, I strongly suggest you rewrite your function to use arrays and loops - then it will be easier to debug. This shows how you might do it - you will obviously need to make the array much bigger, but the rest of the code is good. #include <Array.au3> $sText = "abcba" $sRet = _HEX($sText) ConsoleWrite($sRet & @CRLF) ConsoleWrite(@CRLF) $sRet = _New_HEX($sText) ConsoleWrite($sRet & @CRLF) Func _New_HEX($text) Local $aTrans[3][6] = [ _ ["A", "6", "9", "f", "9", "9"], _ ["B", "e", "9", "e", "9", "e"], _ ["C", "6", "8", "8", "8", "6"]] Local $aHex[6] = [0, "", "", "", "", ""] For $i = 1 To StringLen($text) $sChar = StringUpper(StringMid($text, $i, 1)) $iIndex = _ArraySearch($aTrans, $sChar) If $iIndex <> -1 Then For $j = 1 To 5 $aHex[$j] &= $aTrans[$iIndex][$j] & " " Next EndIf Next $sRet = "" For $i = 1 To 5 $sRet &= $aHex[$i] & @CRLF Next Return $sRet EndFunc ;==>_HEX Func _HEX($text) Local $hex1, $hex2, $hex3, $hex4, $hex5 $hex1 = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($text, " ", "0 "), "A", "6 "), "B", "e "), "C", "6 "), "D", "e "), "E", "f "), "F", "f "), "G", "6 "), "H", "9 "), "I", "6 "), "J", "f "), "K", "9 "), "L", "8 "), "M", "9 "), "N", "d "), "O", "6 "), "P", "e "), "Q", "6 "), "R", "e "), "S", "6 "), "T", "f "), "U", "9 "), "V", "9 "), "W", "9 "), "X", "9 "), "Y", "9 "), "Z", "f "), " ", " "), "!", "6 ") $hex2 = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($text, " ", "0 "), "A", "9 "), "B", "9 "), "C", "8 "), "D", "9 "), "E", "8 "), "F", "8 "), "G", "8 "), "H", "9 "), "I", "6 "), "J", "1 "), "K", "9 "), "L", "8 "), "M", "f "), "N", "d "), "O", "9 "), "P", "9 "), "Q", "9 "), "R", "9 "), "S", "8 "), "T", "6 "), "U", "9 "), "V", "9 "), "W", "9 "), "X", "9 "), "Y", "9 "), "Z", "1 "), " ", " "), "!", "6 ") $hex3 = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($text, " ", "0 "), "A", "f "), "B", "e "), "C", "8 "), "D", "9 "), "E", "f "), "F", "f "), "G", "8 "), "H", "f "), "I", "6 "), "J", "1 "), "K", "e "), "L", "8 "), "M", "9 "), "N", "f "), "O", "9 "), "P", "e "), "Q", "9 "), "R", "e "), "S", "6 "), "T", "6 "), "U", "9 "), "V", "9 "), "W", "9 "), "X", "6 "), "Y", "6 "), "Z", "6 "), " ", " "), "!", "6 ") $hex4 = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($text, " ", "0 "), "A", "9 "), "B", "9 "), "C", "8 "), "D", "9 "), "E", "8 "), "F", "8 "), "G", "9 "), "H", "9 "), "I", "6 "), "J", "1 "), "K", "9 "), "L", "8 "), "M", "9 "), "N", "b "), "O", "9 "), "P", "8 "), "Q", "b "), "R", "9 "), "S", "1 "), "T", "6 "), "U", "9 "), "V", "6 "), "W", "f "), "X", "9 "), "Y", "6 "), "Z", "8 "), " ", " "), "!", "0 ") $hex5 = StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($text, " ", "0 "), "A", "9 "), "B", "e "), "C", "6 "), "D", "e "), "E", "f "), "F", "8 "), "G", "7 "), "H", "9 "), "I", "6 "), "J", "6 "), "K", "9 "), "L", "f "), "M", "9 "), "N", "b "), "O", "6 "), "P", "8 "), "Q", "7 "), "R", "9 "), "S", "6 "), "T", "6 "), "U", "6 "), "V", "6 "), "W", "9 "), "X", "9 "), "Y", "6 "), "Z", "f "), " ", " "), "!", "6 ") Return StringReplace(StringReplace($hex1&"!"&@CRLF&$hex2&"!"&@CRLF&$hex3&"!"&@CRLF&$hex4&"!"&@CRLF&$hex5&"!", " ", " "), " !", "") EndFunc ;==>_HEX You will notice that the results from the 2 functions are not identical although I did use the data in your function. So I fear that you may have more then the one error in your existing code. At least this way you can check easily that you do have the correct values for each letter. I hope this helps. M23
    1 point
  6. You just asked if it could run faster. If I give you my code, you don't learn. j/k...knock yourself out. GeoIP.zip
    1 point
×
×
  • Create New...