Jump to content

Search the Community

Showing results for tags 'double'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 6 results

  1. good morning all. first lit me give you all a thinks to your help you're help me allot thank you all. sirs today i've a new problem it's not a problem but thing i want to add it to blind accessability. the ListBox can send a notification when the user send a double click on it items but as we know that the blind users can't use the mouse for that they use the keybord to navigate. as we know that the enter replace the double click on the keybord for that i need when the user send a inter above any listBox item the list send a double click notification. i know some of you tell me that i can use the GUISetAccelerators function but the enter has a other tasks such as leav a blanc line on edits and activate the defaultButton and other tasks. that what i need and i hope that you can help me this is a simple example. #include <GUIConstantsEx.au3> #include <StructureConstants.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListBoxConstants.au3> Example() Func Example() Local $sMESSAGE = "The following buttons have been clicked" GUICreate("My GUI list") ; will create a dialog box that when displayed is centered Local $idButton_Add = GUICtrlCreateButton("Add", 64, 32, 75, 25) Local $idButton_Clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) global $idMylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling GUICtrlSetData(-1, $sMESSAGE) global $DummyList = GUICtrlCreateDummy() GUICtrlSendToDummy($DummyList, 1) Local $idButton_Close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUIRegisterMsg($WM_command, "WM_command") GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton_Add GUICtrlSetData($idMylist, "You clicked button No1|") Case $idButton_Clear GUICtrlSetData($idMylist, "") Case $idButton_Close MsgBox($MB_SYSTEMMODAL, "", "the closing button has been clicked", 2) Exit case $DummyList $g_iTemp = GUICtrlRead($DummyList) if $g_iTemp = $LBN_DBLCLK then ;$LBN_DBLCLK then msgBox(64, "", "") endIf GUICtrlSendToDummy($DummyList, 0) EndSwitch WEnd EndFunc ;==>Example Func WM_command($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = $lParam $iCode = BitShift($wParam, 16) ; Hi Word Switch $hWndFrom Case GUICtrlGetHandle($idMylist) Switch $iCode Case $LBN_SELCHANGE, $LBN_DBLCLK, $LBN_SELCANCEL, $LBN_SETFOCUS GUICtrlSendToDummy($DummyList, $iCode) case else ;GUICtrlSendToDummy($DummyTreeview, 1) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
  2. Hi, Recently I have had the need to do a sort and then do a second sort while the item of the first sort stays the same ( double sorting , first on column x then while column x is the same sort column y). I did not put much efffort into error checking but so far I did not need it. For my applications so far it works perfectly however if someone is willing I want to test this extensivly. If anyone has big lists of random stuff to sort could you try this out please? #include <Array.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ArraySort_Double ; Description ...: ; Syntax ........: _ArraySort_Double (Byref $array[, $first_index = Default[, $second_index = Default[, $ascending = Default]]]) ; Parameters ....: $array - 2d array to sort. ; $first_index - [optional] first column to sort. Default is 0. ; $second_index - [optional] second column to sort. Default is 1. ; $ascending - [optional] ascending/descending. Default is 1. ; Return values .: 1 if no errors occured , -1 if errors occured ; Author ........: Ternal ; Remarks .......: Needs excessive testing. ; Related .......: _arraysort() ; =============================================================================================================================== Func _ArraySort_Double (byref $array, $first_index = Default, $second_index = Default, $ascending = Default) Local $temp_value Local $counter = 1 If UBound($array, $UBOUND_DIMENSIONS) <> 2 Then MsgBox(0, "error", "error") return -1 EndIf If $first_index = Default Then $first_index = 0 If $second_index = Default Then $second_index = 1 If $ascending = Default Then $ascending = 1 _ArraySort($array, $ascending, 0, 0, $first_index); you can alter settings of primary sort here If @error Then MsgBox(0, "error", @error) return -1 EndIf $temp_value = $array[0][$first_index] For $x = 1 to UBound($array, 1) - 1 If Mod( $x, 10000) = 0 Then ConsoleWrite("at " & $x & " of a total : " & UBound($array, 1) & @CRLF) If $array[$x][$first_index] = $temp_value Then $counter+= 1 If $x = UBound($array, 1) - 1 Then; do last line here(if last line is not a new item) _ArraySort($array, $ascending, $x - $counter, $x, $second_index);you can alter settings of secondary sort here(don't forget to place line 34 the exact same) If @error Then MsgBox(0, "error", @error) return -1 EndIf EndIf Else If $counter > 0 Then ;at least 2 of the same _ArraySort($array, $ascending, $x - $counter, $x - 1, $second_index);you can alter settings of secondary sort here(don't forget to place line 29 the exact same) If @error Then MsgBox(0, "error", @error) return -1 EndIf $counter = 1 EndIf EndIf $temp_value = $array[$x][$first_index] Next Return 1 EndFunc Kind regards, Ternal
  3. Hello Need technical support with math in AutoIt. Result code below should be 0. but is 2.8421709430404e-014 $a = 3.99 - 3 ConsoleWrite(VarGetType($a) & ": " & $a & @CRLF) $a *= 100 ConsoleWrite(VarGetType($a) & ": " & $a & @CRLF) $a -= 99 ConsoleWrite(VarGetType($a) & ": " & $a & @CRLF)
  4. Hello again, my second post in 24 hs! It's my first GUI... and my first progress bar also! Sorry if I make a newbie mistake. I want to configure a GUI Progress Bar by a double "for" loop. Here is my code with a specific annotation with what I want to do: Edit: new problem, I have no idea how can I continue with the next $a as if the current $a, I do not skip it because the line is an element less (I need help with both problems): #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WinAPI.au3> #include <File.au3> #include <String.au3> #include <Array.au3> Local $idGUI = GUICreate("ProgressBar", 220, 130, 100, 200) Opt("GUIOnEventMode", 1) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEButton") Local $idInput = GUICtrlCreateInput("",80,20,60,20,$ES_NUMBER) Local $idProgressBar = GUICtrlCreateProgress(10, 60, 200, 20) Local $idButton1 = GUICtrlCreateButton("Start",85,100,50) GUICtrlSetOnEvent($idButton1, "StartProgressBar") Local $aFileOpen = _WinAPI_GetOpenFileName("Open a text file", "Text Files (*.txt)") Local $idCountLines = _FileCountLines($aFileOpen[2]) Local $idInputValue, $idSomething, $aFileResult, $idStringBetween GUISetState(@SW_SHOW, $idGUI) While 1 Sleep(20000) WEnd Func StartProgressBar() If StringInStr($aFileOpen[2], ".txt") = True Then $idInputValue = Int(GUICtrlRead($idInput)) If IsFloat($idCountLines/$idInputValue) = 1 Then $idStringBetween = _StringBetween(String($idCountLines/$idInputValue),"", ".") $idSomething = Number($idStringBetween[0]) + 1 Else $idSomething = $idCountLines/$idInputValue EndIf For $i = 1 To $idSomething $aFileResult = @ScriptDir & "\result-" & $i & ".txt" _FileCreate($aFileResult) FileOpen($aFileResult,2) For $a = ( ( ( $i - 1 ) * $idInputValue ) + 1 ) To ( $i * $idInputValue ) If FileReadLine($aFileOpen[2], $a) = "" Then ; Here I have no idea how can I continue with the next $a as if the current $a, I do not skip it because the line is an element less EndIf FileWrite($aFileResult,FileReadLine($aFileOpen[2], $a) & " - ") ;Here I want to set the progress bar value = current percentage (line that it is currently reading) of the 100% (total of lines in the file opened) Next FileClose($aFileResult) Next MsgBox(0,"Done","Done") GUICtrlSetData($idProgressBar,0) Else MsgBox(0,"Hello :)","Please open a file :D") EndIf EndFunc Func CLOSEButton() Exit EndFunc Thanks in advance.
  5. Good morning community, I wrote an Autoit script with a double Gui.The button in the second gui wont work any ideas? Much appriciated #include <ButtonConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $hGUI, $hGUI2 vertical() func vertical() $hGUI = GUICreate("Medication", 60, 376, -1, -1, $WS_POPUP) GUISetBkColor(0x000000) $rotatebutton = GUICtrlCreateButton("", 20, 0, 16, 16) GUICtrlSetOnEvent($rotatebutton, "rotate") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd endfunc func horizontal() $hGUI2 = GUICreate("Medication", 376, 60, -1, -1, $WS_POPUP) GUISetBkColor(0x000000) $rotatebackbutton = GUICtrlCreateButton("", 20, 0, 16, 16) GUICtrlSetOnEvent($rotatebackbutton, "rotateback") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd endfunc func rotate() msgbox(0,"ROTATE","ROTATE") GUISetState(@SW_HIDE, $hGUI) horizontal() EndFunc func rotateback() msgbox(0,"ROTATE BACK","ROTATE BACK") ; NEVER GETS TO THIS POINT? GUISetState(@SW_HIDE, $hGUI2) EndFunc
  6. Hi all, I am presently creating a program in C++, and part of this program uses the WINAPI QueryPerformanceCounter() function to work out the time taken for certain events. The issue I am having is when I convert the double that my calculation gives me into a string, using sprintf(tempbuff, "%.15g", tok->fValue); When in the 'Debug' solution Config, it works perfectly well, producing numbers like 1.8736523754e+006 However, when in the release solution Config, it will produce something completely wrong: 1873652.3754... What is causing this? How can I fix the problem? What is the difference between the two configs anyway? Thankyou in advance.
×
×
  • Create New...