Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!dslg0849 From: dslg0849@uxa.cso.uiuc.edu (Daniel S. Lewart) Newsgroups: comp.lang.pascal Subject: TP5.5: Can't store method in procedure variable Summary: I can't store a method in a procedure variable in TP5.5 Keywords: Method Object Procedure TP5.5 Message-ID: <1990Dec3.061013.22258@ux1.cso.uiuc.edu> Date: 3 Dec 90 06:10:13 GMT Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 32 I am attempting to store an object's method in a procedure variable in TP5.5. However, I get a compiler error in the assignment statement. What am I doing wrong? Is there some way to do what I want to do? Thanks in advance, Daniel Lewart d-lewart@uiuc.edu ------------------------------------------------------------------------------- {$F+} type ObjectType = object procedure Method; end; var Obj: ObjectType; ProcVar: procedure; procedure ObjectType.Method; begin end; procedure Proc; begin end; Begin ProcVar := Proc; { This compiles } ProcVar := Obj.Method; { This doesn't } End. ------------------------------------------------------------------------------- e:\> tpc test Turbo Pascal Version 5.5 Copyright (c) 1983,89 Borland International TEST.PAS(15): Error 143: Invalid procedure or function reference. ProcVar := Obj.Method; { This doesn't } ^ ------------------------------------------------------------------------------- Brought to you by Super Global Mega Corp .com