Weird, eh?

Marcus Groeber (100712.270@CompuServe.COM)
XXX, 19 Jul 13:18:29 1996 EDT

Hi all,

I just came across an apparent bug involving initialization values of optr
instance variables, which seems to be shown by the glue version that comes with
the OmniGo SDK.

The following code passage should declare a static object named BatteryHistory
with its BHI_genView instance variable referring to the BatteryView object (a
GenViewClass object not shown here, but otherwise working flawlessly) - but when
examining the value of this field with Swat, it turns out to be zero:

> #define MAX 50
> [...]
> @class BattWatchHistoryClass, MetaClass;
> @message void MSG_BATT_HISTORY_UPDATE_LIFE(word life);
> @instance word BHI_history[MAX];
> @instance word BHI_count = 0;
> @instance optr BHI_genView;
> @endc
> @classdecl BattWatchHistoryClass;
> [...]
> @object BattWatchHistoryClass BatteryHistory = {
> BHI_genView = @BatteryView;
> }

The problem disappears when the line declaring BHI_genView is moved two lines up
(i.e. before the BHI_history[] line) - needless to say, that this not exactly
the first thing a programmer tries when messages to the object pointed to by
BHI_genView show now visible effect... :-)

ciao marcus