home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sun4nl!wtrlnd!contrast!postmaster
- From: berend@contrast.wlink.nl (Berend de Boer)
- Newsgroups: comp.lang.pascal
- Subject: Calling Local Procedures - Problems
- Message-ID: <725106656.AA00884@contrast.wlink.nl>
- Date: Wed, 23 Dec 1992 08:17:36
- Sender: postmaster@contrast.wlink.nl
- Lines: 40
-
- Jeff Byrne wrote in a message to All:
-
- JB> Procedure TestObj.ForEach (Proc : LocalMethodType);
- JB> Var
- JB> Count : Integer;
- JB> begin
- JB> For Count := 1 to 10 do
- JB> begin
- JB> Proc (@Test); { These would be different instances of
- JB> the object } end;
- JB> end;
-
- Hai Jeff,
-
- I saw your question had already been answered. But here follows the ForEach
- method Borland uses. It should work (although untested):
-
-
- procedure TList.ForEach(Action : pointer);
- var
- Count : integer;
- begin
- for Count := 1 to 10 do begin
- asm
- les di,Test
- push es
- push di
- push word ptr [bp]
- call dword ptr Action
- end;
- end; { of for Count }
- end;
-
-
- Groetjes,
-
- Berend. (-:
- fido: 2:281/527.23
- email: berend@contrast.wlink.nl
-
-