42 lines
864 B
Plaintext
42 lines
864 B
Plaintext
Module CheckIt {
|
|
Form 60, 40
|
|
Foo=Lambda Id=1 (m)->{
|
|
class Alfa {
|
|
x, id
|
|
Class:
|
|
Module Alfa(.x, .id) {}
|
|
}
|
|
=Alfa(m, id)
|
|
id++
|
|
}
|
|
|
|
Dim A(10)<<Foo(20)
|
|
\\ for each arrayitem call Foo(20)
|
|
TestThis()
|
|
|
|
|
|
\\ call once foo(20) and result copy to each array item
|
|
Dim A(10)=Foo(20)
|
|
TestThis()
|
|
|
|
Bar=Lambda Foo (m)->{
|
|
->Foo(m)
|
|
}
|
|
\\ Not only the same id, but the same group
|
|
\\ each item is pointer to group
|
|
Dim A(10)=Bar(20)
|
|
TestThis()
|
|
|
|
Sub TestThis()
|
|
Local i
|
|
For i=0 to 9 {
|
|
For A(i){
|
|
.x++
|
|
Print .id , .x
|
|
}
|
|
}
|
|
Print
|
|
End Sub
|
|
}
|
|
Checkit
|