BUG??? GUICtrlSetData mit For To Step

  • Hi Leute,
    habe hier ein kleines Problem festgestellt, siehe Beispiel

    Spoiler anzeigen
    [autoit]


    #include
    #include
    #include
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 207, 177, 192, 124)
    $Combo1 = GUICtrlCreateCombo("0.10", 65, 42, 73, 25)
    for $data = 0.2 to 9.90 Step 0.1
    GUICtrlSetData(-1, $data)
    Next
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]


    Ab dem Wert 5,9 vestehe ich nur noch Bahnhof
    autoit.de/wcf/attachment/6444/
    Mfg Eddi

  • Kein Bug --> Rechenfehler der CPU meines Erachtens.

    StringFormat macht Abhilfe

    Spoiler anzeigen
    [autoit]

    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 207, 177, 192, 124)
    $Combo1 = GUICtrlCreateCombo("0.10", 65, 42, 73, 25)
    for $data = 0.2 to 9.90 Step 0.1
    GUICtrlSetData(-1, StringFormat("%.2f", $data))
    Next
    GUICtrlSetData(-1, "0.00")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    Edit: So gehts auch:

    Spoiler anzeigen
    [autoit]

    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 207, 177, 192, 124)
    $Combo1 = GUICtrlCreateCombo("0.10", 65, 42, 73, 25)
    for $data = 2 to 99
    GUICtrlSetData(-1, $data / 10)
    Next
    GUICtrlSetData(-1, "0.00")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]
  • Bei mir funktioniert es wunderbar...
    Liegt vieleicht an deinem Rechner !
    Ich sehe so keinen Fehler ^^


    Edit:
    Zu langsam ;(
    Funkey war professioneller :D

  • Habe den Code nochmal editiert, Zeile 10 rausgenommen, die war ja voellig ueberfluessig.

    Zitat


    Bei mir funktioniert es wunderbar...
    Liegt vieleicht an deinem Rechner !
    Ich sehe so keinen Fehler


    Das ist ja ein Ding ;(
    Soll das etwa heissen, das meine CPU schrott ist. Gibt es eine Moeglichkeit die CPU zu pruefen???

    - MfG OpaEd

  • Hallo opaed,
    noch eine Möglichkeit:

    Spoiler anzeigen
    [autoit]

    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 207, 177, 192, 124)
    $Combo1 = GUICtrlCreateCombo("0.10", 65, 42, 73, 25)
    for $data = 0.2 to 9.9 Step 0.1
    GUICtrlSetData(-1, round($data,1))
    Next
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    mfg (Auto)Bert

  • Man könnte die "." auch durch "," ersetzten

    [autoit]

    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 207, 177, 192, 124)
    $Combo1 = GUICtrlCreateCombo("0.10", 65, 42, 73, 25)
    for $data = 2 to 99
    GUICtrlSetData(-1,StringReplace($data / 10,".",","))
    Next
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit]