news
About Elegant Chaos
info
About me and my friends
people
Software from Elegant Chaos
software
Other stuff...
stuff

Power

This XFCN provides access to the Power Manager routines on portable macintoshes, including the ability to set the wakeup time on Powerbook 100s.

Power XFCN. Version 1.0d2, by Sam Deane. Copyright 1994 ULTRALAB. Compiled 16:51:39, 28/04/94. Debugging code included.


[last exit to hypercard] [externals index] [download Power]

Description

This XFCN provides access to some of the power managment routines available on the portable macintoshes.

You can check what the status and level of the battery is, and you can get. set and clear a wakup time.


Commands

power

This command returns a number giving the current level of the battery.

The syntax is:

  Power("power")

Example script for power

on mouseUp
  repeat until the mouseClick
    put Power(power)
  end repeat
end mouseUp

status

This command returns current charging status of the battery.

The syntax is:

  Power("status")

The results will contain one or more of the keywords: connected, hicharge, overflow, low, changed.

Example script for status

on mouseUp
  repeat until the mouseClick
    put Power(status)
  end repeat
end mouseUp

wakeStatus

Example script for wakeStatus

on mouseUp
  put Power(WUstatus) into status
  put Power(WUtime) into seconds
  convert seconds to time and date
  answer status && seconds
end mouseUp

wakeTime

This commands lets you get the time of any previously set wake time.

The syntax is:

  get Power("wakeTime")

wakeSet

This commands lets you set a time at which the computer will wake itself up.

The syntax is:

  get Power("wakeSet",<time>)

The time parameter should be the time, in seconds since 1904, at which to wake up. To convert a time and date into seconds you can use the hypertalk convert command, as in the following script:

  get "10/01/94 17:54"
  convert it to seconds

Example script for wakeSet

on mouseUp
  get Power(WUtime)
  convert it to date and time
  ask "Wakeup time?" with it
  if it is not empty then
    convert it to seconds
    get Power(WUset,it)
  end if
end mouseUp

wakeOff

This commands lets you clear any previously set wake time.

The syntax is:

  get Power("wakeOff")

Example script for wakeOff

on mouseUp
  answer Power(WUoff)
end mouseUp

[last exit to hypercard] [externals index] [download Power]

This page was created automatically, on 25/03/1999 from version 3.0d4 of Last Exit To Hypercard.