Jump to content

Delegates: Difference between revisions

Line 1,360:
=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
Module Version2Version3 {
\\ Third version including using the object without delegate.
\\ Second version
\\ the delegate is a pointer to group
\\ 1. We pass parameters to function operations$(), $ means that this function return string value
Line 1,411:
\\ Normal Group ' no logging to doc$
N=Thing()
Print N.operation$(210,520)
CallbyReference &N
CallbyValue N
N1->N ' N1 is a pointer to a named group
Print N1=>operation$(210,520)
CallbyReference2 &N1
CallbyValue2 N1
N1->(N) ' N1 now is a pointer to a float group (a copy of N)
Print N1=>operation$(210,520)
CallbyReference2 &N1
CallbyValue2 N1
\\ using named groups (A is a group, erased when this module exit)
A=Delegator()
Line 1,449 ⟶ 1,455:
Clipboard Doc$
}
Version3
Version2
 
 
</lang>
Line 1,455 ⟶ 1,462:
<pre>
Output:
10200
10150
1060
200
150
60
200
150
60
Default implementation
Delegate implementation: 200
404

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.