Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/05/2015 in all areas

  1. 5/3/2015: Uploaded a new SciTE4AutoIt3.exe installer with an updated SciTE v3.5.4 release. These are the major changes: - See details below. Enjoy, Jos Addition/Changes/Fixes in the current installer: -------------------------------------------------------------------------------------------------- 5/3/2015 *** Merged the SciTE v 3.5.4 by Neil Hodgson with our own version of SciTE. (Jos) Added utf8.auto.check which will autodetect UTF8 encoded files without BOM and files containing Highvalue ASCII characters and setting the correct encoding. We have set the default to 4 which means that the encoding is set to UTF8 without BOM for any script containing normal ASCII characters. #~ Enhance function of auto checking utf8: providing two methods #~ utf8.auto.check=1: detect utf8 and add BOM automatically #~ utf8.auto.check=2: detect utf8 and do not add BOM #~ utf8.auto.check=3: detect ascii high characters and if none found set default encoding to UTF8 and add BOM utf8.auto.check=4: detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM *** Updated Au3Stripper v15.503.1200.0 (Jos) - 14.801.2025.1: Fix for AdlibUnRegister() without parameter avoid warning and hardcrash. - 14.801.2025.2: Fix handling ".\" relatives paths in #include statements. *** Updated AutoIt3Wrapper v15.503.1200.0 (Jos) - 14.801.2025.1: Fix for #2851 -> au3records returning some SciTE console info that shouldn't be there. - 14.801.2025.2: Added support for UTF8 without BOM scripts to be able to update the version and GUI information. - 14.801.2025.3: Decode %xx% in the OutputFile Directives - 14.801.2025.4: Make single line script with directive work - 14.801.2025.5: Added check for AUT2EXE failure adding FileInstall() files. and set return code to 1. - 14.801.2025.6: Fix error trigered by "#AutoIt3Wrapper_Run_Debug_Mode=Y " when script contains Switch-Case-EndSwitch - 14.801.2025.7: #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=Y will now also increment #pragma compile(Fileversion, 0.62) statements. Also now support for: #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=Y #AutoIt3Wrapper_Res_Fileversion=0.62.0.4 #AutoIt3Wrapper_Res_ProductVersion=%fileversion% - 14.801.2025.8: Added: #AutoIt3Wrapper_Res_HiDpi= ;(Y/N) Compile for high DPI. Default=N (Idea: unexpectedpanda) - 14.801.2025.9: Fixed regression in .7 - 14.801.2025.10: Fixed missing info in the HiDpi data - 14.801.2025.11: Added 2 keywords for AutoIt3Wrapper.ini which can set the Restart and StopExecuting Hotkeys in AutoIt3Wrapper: (mLipok) [Other] SciTE_STOPEXECUTE=^{END} SciTE_RESTART=^!{END} *** Updated Tidy v15.503.1200.0 (Jos) - Fixed regression for #include-once statements - Fixed Spacing for #include statements - Fixed bug with #tidy_On/#Tidy_Off - Fixed hardcrash with longfilenames. - Changed SortFunc option from 15 to 65 characters of the FuncName to sort on. *** Updated SciTEConfig v15.503.1200.0 (Jos) - 14.801.2025.1 Fixed issue with setting CallTip dynamically. - 14.801.2025.2 Added About button. - 14.801.2025.3 Fix UserCallTip Manager big (Melba23) - 14.801.2025.4 added Alpha level for Selected line background and changed the logoic for displaying the Alpha value label. - 14.801.2025.5 Added checks for SciTEUSer info to Option "Run AutoIt3/SciTE Check". showing SciTEUser file location at the bottom. (mLipok) - 14.801.2025.6 Added option to open AutoIt3Wrapper.ini and Tidy.Ini -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE/Scintilla updates. ==> Visit the SciTE4AutoIt3 Download page for the latest versions ==> Check the newly formatted the online documentation for an overview of all extras you get with this installer.
    1 point
  2. sigh ... @TheDcoder, I am slowly growing tired of your over enthusiastic posting lately without first properly reading. The OP clearly indicated that he found the issue and on top of that: The last provided script is simply wrong as the clipboard is overwritten each loop. Please start to control yourself and simply refrain from posting when not needed. This should sound familiar as this is requested a couple of time lately and my patience is really running thin now! Jos
    1 point
  3. If that doesn't work, try @‌MAX. ...But only if it wouldn't work.
    1 point
  4. This property is set in SciTE at start time and is retrieved from the Enviroment variable SCITE_USERHOME. When this doesn't exists it will use SCITE_HOME. There is no other way to set this. Jos
    1 point
  5. WM_KEYDOWN does not fire when you press an arrow key in an empty GUI. Use a hook procedure: -snip-
    1 point
  6. compact21, Reading a file line by line is slow. It is also unnecessary to read the file every time the function is entered. Consider the following code. I added some error checking and changed the detection logic... #include <File.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Quest", 425, 126, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $OkLabel = GUICtrlCreateLabel("0", 392, 8, 20, 41) GUICtrlSetFont($OkLabel, 24, 400, 0, "MS Sans Serif") GUICtrlSetColor($OkLabel, 0x00FF00) $input = GUICtrlCreateInput("", 8, 64, 369, 21) ; initialize to blank $Label2 = GUICtrlCreateLabel("Please say the word:", 8, 24, 272, 28) GUICtrlSetFont($Label2, 14, 400, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Say!", 128, 96, 145, 25) GUICtrlSetOnEvent($Button1, "Button1Click") $ErrLabel = GUICtrlCreateLabel("0", 392, 64, 20, 41) GUICtrlSetFont($ErrLabel, 24, 400, 0, "MS Sans Serif") GUICtrlSetColor($ErrLabel, 0xFF0000) GUISetState(@SW_SHOW) ; read list of words to a string variable Local $sWordList = FileRead(@ScriptDir & '\wordlist.txt') While 1 Sleep(999999) ; Rip Van Winkle WEnd Func Button1Click() ; check that a word was entered if guictrlread($input) = '' then MsgBox($MB_ICONERROR, 'ERROR', "Please enter a word in the input area") GUICtrlSetState($input,$GUI_FOCUS) Return endif ; case statement to return true if word found or false if word not found Switch StringRegExp($sWordList, '\b' & GUICtrlRead($input) & '\b') Case True MsgBox(Default, Default, "Word Ok!") GUICtrlSetData($ErrLabel, GUICtrlRead($ErrLabel) + 1) Case False $sWordList &= @crlf & guictrlread($input) Filedelete(@ScriptDir & '\wordlist.txt') FileWrite(@ScriptDir & '\wordlist.txt', $sWordList) MsgBox(Default, Default, "Word nOK!") GUICtrlSetData($OkLabel, GUICtrlRead($OkLabel) + 1) EndSwitch GUICtrlSetData($input, "") ; blank out input control GUICtrlSetState($input,$GUI_FOCUS) ; force focus to input control EndFunc ;==>Button1Click Func Form1Close() Exit EndFunc ;==>Form1Close This is the file I used for testing -> wordlist.txt kylomas
    1 point
  7. More or less... _SQLite_Startup() Global $g_hDataBase1 = _SQLite_Open($Database_File_1) Global $g_hDataBase2 = _SQLite_Open($Database_File_2) Func _LoadDatabase($Database_File = -1, $Database_Structure = -1, $Table_Name = -1, $_Automatic_Unload = 1) _DefaultAnalyser($Database_File, 'DataBase.db3') _DefaultAnalyser($Database_Structure, 'id INTEGER PRIMARY KEY,data TEXT,parameters TEXT') _DefaultAnalyser($Table_Name, 'Database') _DefaultAnalyser($_Automatic_Unload, 1) If $_Automatic_Unload Then OnAutoItExitRegister('_UnloadDatabase') If Not FileExists($Database_File) Then ; do not use -1... use variable's database _SQLite_Exec($g_hDataBase1, "CREATE TABLE " & $Table_Name & " (" & $Database_Structure & ")") _SQLite_Exec($g_hDataBase2, "CREATE TABLE " & $Table_Name & " (" & $Database_Structure & ")") $_Just_Created = True ;I made This Variable to know that I should Insert The Values or Update Them........ ;Since we cannot insert the same id twice(will cause error because it is Declared as PRIMARY KEY) Else _SQLite_Open($Database_File) EndIf If @error Then Return SetError(1, @error, -1) Return 1 EndFunc ;==>_LoadDatabase Func on_exit() _SQLite_Close($g_hDataBase1) _SQLite_Close($g_hDataBase2) EndFunc
    1 point
  8. jvds

    Use ControlGetText

    hum this? $var = ControlGetText ("Local Disk (D:)", "", "[CLASS:ToolbarWindow32; INSTANCE:2]") ConsoleWrite('!$var='&$var&@lf)EDIT: or these ones $winarray = WinList() for $x=1 to $winarray[0][0] $var = ControlGetText ($winarray[$x][1], "", "[CLASS:ToolbarWindow32; INSTANCE:2]") if $var then ConsoleWrite('windowname = '&$winarray[$x][0]&@CRLF) ConsoleWrite("[CLASS:ToolbarWindow32; INSTANCE:2] = "&$var&@CRLF&@CRLF) EndIf Next $winarray = WinList("[CLASS:CabinetWClass]") for $x=1 to $winarray[0][0] $var = ControlGetText ($winarray[$x][1], "", "[CLASS:ToolbarWindow32; INSTANCE:2]") ConsoleWrite('windowname = '&$winarray[$x][0]&@CRLF) ConsoleWrite("adress = "&$var&@CRLF&@CRLF) Next
    1 point
  9. Use a boolean #include <File.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Quest", 425, 126, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $OkLabel = GUICtrlCreateLabel("0", 392, 8, 20, 41) GUICtrlSetFont($OkLabel, 24, 400, 0, "MS Sans Serif") GUICtrlSetColor($OkLabel, 0x00FF00) $input = GUICtrlCreateInput("word", 8, 64, 369, 21) $Label2 = GUICtrlCreateLabel("Please say the word:", 8, 24, 272, 28) GUICtrlSetFont($Label2, 14, 400, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Say!", 128, 96, 145, 25) GUICtrlSetOnEvent($Button1, "Button1Click") $ErrLabel = GUICtrlCreateLabel("0", 392, 64, 20, 41) GUICtrlSetFont($ErrLabel, 24, 400, 0, "MS Sans Serif") GUICtrlSetColor($ErrLabel, 0xFF0000) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Button1Click() Local $sFilePath = "words.txt", $found = 0 Local $hFileOpen = FileOpen($sFilePath, $FO_READ) $read = GUICtrlRead($input) For $x = 1 to _FileCountLines($sFilePath) $sFileRead = FileReadLine($hFileOpen, $x) If StringInStr($sFileRead, $read) Then $found = 1 Exitloop EndIf Next If $found = 1 Then MsgBox(default, default, "Word Ok!") GUICtrlSetData($ErrLabel, GUICtrlRead($ErrLabel)+1) Else FileWriteLine("words.txt", $read) MsgBox(default, default, "Word nOK!") GUICtrlSetData($OkLabel, GUICtrlRead($OkLabel)+1) EndIf FileClose($hFileOpen) GUICtrlSetData($input, "") EndFunc Func Form1Close() Exit EndFunc
    1 point
  10. mikell

    Csv and arrays

    Using many files to build your database is not a very convenient way Anyway please try this Func list() $buylist = _FileListToArray(@ScriptDir & "\Database\Buy") Local $buy_array[$buylist[0]][2] For $i = 1 To $buylist[0] $tmp = StringSplit(FileRead(@ScriptDir & "\Database\Buy\" & $buylist[$i]),";") $buy_array[$i-1][0] = $tmp[1] $buy_array[$i-1][1] = $tmp[4] Next _ArraySort($buy_array) ;_ArrayDisplay($buy_array, "sorted") For $i = UBound($buy_array)-1 to 1 step -1 If $buy_array[$i][0] = $buy_array[$i-1][0] Then $buy_array[$i-1][1] += $buy_array[$i][1] _ArrayDelete($buy_array, $i) EndIf Next ; _ArrayDisplay($buy_array, "duplicates managed") $selllist = _FileListToArray(@ScriptDir & "\Database\Sell") For $i = 0 To UBound($buy_array)-1 $sold = 0 for $x = 1 to $selllist[0] $sold_array = StringSplit(FileRead(@ScriptDir & "\Database\Sell\" & $selllist[$x]),";") $soldprod = $sold_array[1] if $soldprod = $buy_array[$i][0] Then $sold += $sold_array[4] Next $stock = $buy_array[$i][1] - $sold GUICtrlCreateListViewItem($i & "|" & $buy_array[$i][0] & "|" & $buy_array[$i][1] & "|" & $sold & "|" & $stock , $hListView) Next EndFunc
    1 point
  11. You can use recursive regulare expressions. Func AreParanthesisBalanced ($string) Static $parenthesis = "(?:\((?P>brackets)\))" Static $brace = "(?:\{(?P>brackets)\})" Static $bracket = "(?:\[(?P>brackets)\])" Static $nonBracket = "(?:[^(){}\[\]])" Static $brackets = "(?<brackets>(" & $parenthesis & "|" & $brace & "|" & $bracket & "|" & $nonBracket & ")*)" Static $regex = "^" & $brackets & "$" Return StringRegExp ($string, $regex) EndFunc
    1 point
×
×
  • Create New...