Test := returnTest()
MsgBox % Test
returnTest() {
return 123
}
возвращение по ссылке:
returnByRef(A,B,C)
MsgBox % A "," B "," C
returnByRef(ByRef val1, ByRef val2, ByRef val3)
{
val1 := "A"
val2 := 100
val3 := 1.1
return
}
возвращение значения из массива:
Test1 := returnArray1()
MsgBox % Test1[1] "," Test1[2]
Test2 := returnArray2()
MsgBox % Test2[1] "," Test2[2]
Test3 := returnObject()
MsgBox % Test3.id "," Test3.val
returnArray1() {
Test := [123,"ABC"]
return Test
}
returnArray2() {
x := 456
y := "EFG"
return [x, y]
}
returnObject() {
Test := {id: 789, val: "HIJ"}
return Test
}