Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!stjhmc!p88.f15.n300.z1.fidonet.org!Lawson.English From: Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) Newsgroups: comp.sys.mac.programmer Subject: ThinkC TCL's DoCommand() wish Message-ID: <13514.28538C9C@stjhmc.fidonet.org> Date: 8 Jun 91 01:07:43 GMT Sender: ufgate@stjhmc.fidonet.org (newsout1.26) Organization: FidoNet node 1:300/15.88 - Tucson Apple Core, Tucson AZ Lines: 33 Larry Weinberg writes in a message to All LW> Why insn't it implemented as: LW> CBureaucrat::DoCommand(long theCommand, long data) LW> (data could be a pointer to any type of structure that might LW> be needed) LW> Am I alone with this wish? Since I don't have this feature, LW> and I don't want to modify the TCL sources because I want to LW> remain compatible, I create special methods for subclasses that LW> I call directly, hence I must cast explicitly to a given subclass LW> therefore loosing some of that beautiful object oriented generality LW> of not having to know what type of object I am passing a message LW> on to. Am I missing something obvious? Is there some truer message LW> passing scheme implemented in the Class Library's chain of command? LW> Or should I take the plunge and modify the CBureaucrat class LW> and have problems with future versions One thing that you could do is implement a "gCommandDataPtr" global variable. Whenever you wish to pass auxilliary data up the chain of command, set this variable to your dataPtr. Any command that expects extra data could check this global and set it to nil/null when it is done (if it's already nil/null then no data was passed). You could have a change to yourApplication's DoCommand that would set the ptr to nil/null if it yourApplication's DoCommand was reached with a non-sensical command. This is a little kludgey but obviates (whataword) the need to rewrite the TCL's. Lawson -- Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English Internet: Lawson.English@p88.f15.n300.z1.fidonet.org