[futurebasic] Re: [FB] FB^3 Time

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2002 : Group Archive : Group : All Groups

From: Heather Donahue <hdonahue@...>
Date: Wed, 17 Apr 2002 16:01:38 -0700
>on 4/17/02 3:51 PM, ted Spencer at tedspencer@... wrote:
>
>> Is there a reasonable way to set the Mac clock (time & Date) from an FB
>> program? (This would lead to getting GPS/GLONAS time and imposing it on the
>> Mac, plus or minus the local adjustment.)
>
>This works in FB2 under OS9.x and under.
>
>LOCAL MODE
>LOCAL FN SetDateTime(time&)
>  `     MOVE.L    ^time&,D0
>  `     DC.W      $A03A
>  `     EXT.L     D0
>END FN = REGISTER(D0)
>
>dateTime& = PEEK LONG (&20C)
>newDateTime& = dateTime& + timeOffset&     ' time offset is in  seconds
>err = FN SetDateTime(newDateTime&)

And in FB^3 that translates to simply:

GetDateTime(@dateTime)
newDateTime& = dateTime& + timeOffset&     ' time offset is in  seconds
err = FN SetDateTime(newDateTime&)

It's also CarbonLib compatible


-- 
Heather