Thanks for the response Lexikos.
1: It doesn't.
1. Why doesn't 'k' and 'v' variables equal to "" or 0 inside while loop?
A: bc 'k' and 'v' are initialized by enum[k, v] command (I'm replying to myself).
obj := Object("red", 0xFF0000, "blue", 0x0000FF, "green", 0x00FF00)
; Enumerate!
enum := obj._NewEnum()
MsgBox % "k=" k " v=" v " enum[k,v]=" enum[k,v] ; "" "" 1
; ""invoking enum[k, v] increases enumerator counter (see while loop)" - this is false" - no, this is actually true ;)
;
; enum[k, v] initializes k and v variables! (table index passed as byRef?)
msgbox, % k " " v ; "red" 0xFF0000
While enum[k, v]
{
msgbox, % isObject(k) " " isObject(v) ; 0 0
t .= k "=" v "`n"
}
msgbox % t
2. are 'k' and 'v' variables somehow passed 'by ref' into the enum object? (this looks strange to me in comparison to arrays of arrays syntax)
cat := Object("fur", "black", "eyes", "green", "smiles", true)
enum := ObjNewEnum(cat)
Msgbox % cat["fur"] ; black
msgbox % enum[box] ; 1
;msgbox % enum(box) ; call to nonexistent function
msgbox % box ; eyes
3. how to create an object, whose method / constructor will initialize variables through obj[variable] syntax? (like the enumerator object does with 'box' variable)