swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getCurrentActivity()


From: Doug Donalson;
Subject: getCurrentActivity()
Date: Wed, 5 Feb 1997 15:54:24 -0800 (PST)

Roger,

   If you remember, you had me use getCurrentActivity()
as a way to get the current system time when using the 
two level version of the time schedule.  Particularly,
I use the the main schedule tiem as the integer part of my time
and the subschedule time as the decimal part.  When executing
an event, I am in the time subschedule so I use the code

  eventTime=getCurrentTime();  
  activity=getCurrentActivity();  
  if( activity != nil )  
  {
     ownerActivity = [activity getOwnerActivity];     
     while ( ! [ownerActivity respondsTo: M(getCurrentTime)] )        
     ownerActivity = [ownerActivity getOwner];     
     superTime = [ownerActivity getCurrentTime];     
     time=superTime+ eventTime*precison; //precison right shifts eventTime
  }

so that I have 'superTime.eventTime' as my system time.

Please tell me that there is another procedure that takes the place
of getCurrentActivity!  If there isn't and there isn't another way
to do this same thing then I'm shut down.

Cheers?

   Doug Donalson
***************************************************************************
* Doug Donalson                          * Office: (805) 893-2962         *
* Ecology, Evolution, and Marine Biology * Home:   (805) 961-4447         *
* UC Santa Barbara                       * email address@hidden
* Santa Barbara Ca. 93106                *                                *
***************************************************************************
*                                                                         *
*   The most exciting phrase to hear in science, the one that             *
*   hearlds new discoveries, is not "EUREKA" (I have found it) but        *
*   "That's funny ...?"                                                   *
*                                                                         *
*       Isaac Asimov                                                      *
*                                                                         *
***************************************************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]