Rod Anderson
Member
I'm dragging myself kicking and screaming into the world of OO. I'm trapped in a 11.2A (Linux) world right now so I know things are limited but it's a start by just trying to understand the basics.
I started by trying to remove some of my pub/sub logic. The program below works (yea!) however I want to publish sub-program calls (see tmp/tmp.p in the code) to the same log. If I add Logit = NEW com.base.LogManager(). in that program it creates a new instance which I would expect. If I do nothing it doesn't understand the method call in tmp.p. I'm basically trying to replicate the "subscribe to EventName anywhere" feature. Hopefully I'm close in the basics?
Finally do I need the delete object logit code?
Thanks in advance, beat me up
Rod
I started by trying to remove some of my pub/sub logic. The program below works (yea!) however I want to publish sub-program calls (see tmp/tmp.p in the code) to the same log. If I add Logit = NEW com.base.LogManager(). in that program it creates a new instance which I would expect. If I do nothing it doesn't understand the method call in tmp.p. I'm basically trying to replicate the "subscribe to EventName anywhere" feature. Hopefully I'm close in the basics?
Finally do I need the delete object logit code?
Thanks in advance, beat me up
Rod
Code:
/* pre oo stuff including DataViewer */
{common/DynTempLoad.i}
DEF VAR Logit AS CLASS com.base.LogManager NO-UNDO.
CREATE WIDGET-POOL.
Logit = NEW com.base.LogManager().
/* Send Some different type messages */
Logit:PubInfo(SUBSTITUTE("TODAY is the &1",TODAY)).
Logit:PubWarning("Snow is a coming!").
/* run tmp/tmp.p and add to same temp table */
/* Dyn Browse to view data */
RUN DataViewer(Logit:GetTempTableHandle()).
/* is this needed? I think? */
IF VALID-OBJECT(Logit) THEN DELETE OBJECT Logit.
DELETE WIDGET-POOL.