OwnProps - not implemented?

Issue #66 closed
Winter Laite created an issue

ISSUE

Unable to create working ‘for k, v in Obj’ type loop in Keysharp, as OwnProps is apparently not implemented.

test script
s := ""
for k, v in {red: 0xFF0000, blue: 0x0000FF, green: 0x00FF00}.OwnProps()
    s .= (k "=" v "`n")
MsgBox(s)

AHK won’t take quotes around the key in an object literal, apparently. How, then, do we create a working “for key, value in Obj” loop in Keysharp?

Comments (3)

  1. Winter Laite reporter

    There is a workaround.

    
    
    for (k, v in {"Red": "ff0000", "Green" : "00ff00", "Blue": "0000ff"})
        MsgBox(k " is " v)
    

  2. Matt Feemster repo owner

    OwnProps will not be implemented until later.

    For this example, as you’ve noted, it’s not needed.

    Closing this issue and we’ll make a new one later specifically to track OwnProps work.

  3. Log in to comment