Commit 3169add and/or commit ab1b7e2 - suspected SetTimer errors.

Issue #69 closed
Winter Laite created an issue

“guitest.ahk”, the large GUI test script, no longer ran.

I removed parts of the GUI piece by piece to narrow this down.

Comments (5)

  1. Winter Laite reporter

    Please see related issue for SetTimer.

    SetTimer_Tests.ahk

    MyGui := Gui()
    
    MousePosText := MyGui.Add("Text", "x10 y+10 cBlue s10 w200", "Uses SetTimer to show mouse position")
    CoordText := MyGui.Add("Text", "x10 y+10 cLime", "")
    ;CoordText.SetFont("s20") 
    SetTimer("UpdateOSD", 200)
    UpdateOSD()  ; Make the first update immediate rather than waiting for the timer.
    
    MyGui.Show()
    
    ; ┌──────────────┐
    ;   Update OSD  
    ; └──────────────┘
    
    
    ; Not used, as SetTimer is causing crashes.
    UpdateOSD()
    {
        Result := MouseGetPos()
        CoordText.SetFont("bold s20")
        CoordText.Text := ("X: " Result["X"] " Y: " Result["Y"])
    }
    

    Error text:

    Uncaught exception: 
    Message: Input string was not in a correct format. 
    Stack:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) 
    at System.String.System.IConvertible.ToInt32(IFormatProvider provider) 
    at System.Convert.ToInt32(Object value) 
    at Keysharp.Scripting.Script.ForceInt(Object input) in C:\Users\HP6300\Documents\repos\keysharp_debug\keysharp\Keysharp.Core\Scripting\Script\Conversion.cs:line 192 
    at Keysharp.Scripting.Script.IndexAt(Object item, Object index) in C:\Users\HP6300\Documents\repos\keysharp_debug\keysharp\Keysharp.Core\Scripting\Script\Objects.cs:line 420 
    at Keysharp.Scripting.Script.Index(Object item, Object key) in C:\Users\HP6300\Documents\repos\keysharp_debug\keysharp\Keysharp.Core\Scripting\Script\Objects.cs:line 108 
    at Keysharp.CompiledMain.Program.UpdateOSD() 
    at Keysharp.CompiledMain.Program.Main(String[] args) 
    

  2. Log in to comment