home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09962.iso / auto / cm95-10.zip / WILCMDS.TXT < prev    next >
Text File  |  1996-08-30  |  9KB  |  218 lines

  1. /****************************************************************************/
  2.                              CLOCKMAN COMMANDS
  3. /****************************************************************************/
  4. sList = CMEvtItemize (@CMFirst)
  5.  
  6. Creates a space-delimited list of the ClockMan events.
  7.  
  8. Parameters:
  9.     (number)    Which events to itemize:
  10.                 @CMFirst itemizes all events starting with the first one.
  11.                 (This is currently the only value ClockMan recognizes.)
  12.  
  13. Returns:
  14.     (string)    A space-delimited list of all event IDs in ClockMan's
  15.                 database.
  16.  
  17. After calling CMEvtItemize(), you'd normally loop through the returned list
  18. using ItemExtract() to get each event ID in the string. You use this event ID
  19. to get or set information about the event.
  20.  
  21. See Also:
  22.     CMGetEvtInfo, CMSetEvtInfo
  23.  
  24.  
  25. /****************************************************************************/
  26. sInfo = CMGetEvtInfo (nEventID, nWhichInfo)
  27. nInfo = CMGetEvtInfo (nEventID, nWhichInfo)
  28.  
  29. Extracts information about an event.
  30.  
  31. Parameters:
  32.     (number)    Which event to get information on. @CMThisEvt gets info about
  33.                 the event that launched this WIL script.
  34.     (number)    Which piece of information to return:
  35.                 @CMEvtTime - When this event occurred, in WIL datetime fmt.
  36.                 @CMIsActive - Will this event ever occur again?
  37.                 @CMMsgType - One of these:
  38.                     @CMMsgAnn - Simple announcement box.
  39.                     @CMMsgCfm - Confirmation box.
  40.                     @CMMsgCount - Countdown box.
  41.                     @CMMsgTSquare - TimeSquare(tm).
  42.                     @CMMsgNone - No message.
  43.                 @CMMsg - The message text to display.
  44.                 @CMTune - Whether the "Beep" box is checked. @TRUE or @FALSE.
  45.                 @CMTuneName
  46.                 @CMAction - Which action this event carries out. One of these:
  47.                     @CMACMsgOnly - Just a message box.
  48.                     @CMACRunPgm - Run a program.
  49.                     @CMACRunWIL - Run a WIL script.
  50.                     @CMACShutdown - Shutdown the computer.
  51.                     @CMACAdj - Adjust the system time up or down.
  52.                 @CMPgmLine - The full command line to execute.
  53.                 @CMPgmShowAs - How to show the program we launch.
  54.                 @CMPgmKeys - The keystrokes to send to the program.
  55.                 @CMAdjSecs - How many seconds to adjust the time. (Negative
  56.                 number implies adjusting backwards; positive is forwards.)
  57.  
  58. Returns:
  59.     (string)    if @CMNextTime, @CMMsg, @CMTuneName, @CMPgmLine, or @CMPgmKeys.
  60.     (number)    if @CMIsActive, @CMMsgType, @CMTune, @CMAction, @CMPgmShowAs,
  61.                 or @CMAdjSecs.
  62.  
  63. See Also:
  64.     CMSetEvtInfo
  65.  
  66.     
  67. /****************************************************************************/
  68. nTime = CMGetSysTime ()
  69.  
  70. Gets the PC's current system time as a Unix time (secs since 00:00:00 GMT
  71. 1/1/70). (For the current time in WIL datetime format, use TimeYmdHms.)
  72.  
  73. Returns:
  74.     (number)        The number of secs since 00:00:00 GMT 1/1/70.
  75.  
  76. See Also:
  77.     CMSetSysTime
  78.  
  79.  
  80. /****************************************************************************/
  81. sDesc = CMGetTimeDesc (@CMTimeNow, sFmt)
  82.  
  83. Lets you build a custom date & time string using replacement variables.
  84.  
  85. Parameters:
  86.     (string)    The time to convert to a string, or @CMTimeNow for the current
  87.                 time. (This function currently only recognizes @CMTimeNow.)
  88.     (string)    The format to use in converting the time. You use these 
  89.                 replacement variables:
  90.                 &dt - Windows-defined short date
  91.                 &y4 - 4-digit year
  92.                 &yy - 2-digit year
  93.                 &MO - Full month name ("January".."December")
  94.                 &mo - Abbreviated month ("Jan".."Dec")
  95.                 &mm - Month of year w/o leading zeros ("1".."12")
  96.                 &0m - Month of year w/leading zero if necessary ("01".."12")
  97.                 &DA - Day of week ("Sunday".."Saturday")
  98.                 &da - Abbreviated DOW ("Sun".."Sat")
  99.                 &dd - Day of month w/o leading zeros ("1".."31")
  100.                 &0d - Day of month w/leading zero if necessary ("01".."31")
  101.                 &hr - Hour of day ("0".."24")
  102.                 &0h - Hour w/leading zero if necessary ("00".."24")
  103.                 &mi - Minute ("0".."59")
  104.                 &se - Second ("0".."59")
  105.  
  106. Returns:
  107.     (string)    Your custom date & time string.
  108.  
  109. This command creates a custom date & time description string using the same
  110. syntax you use to customize the ClockMan icon's title.
  111.  
  112. Example:
  113.     szNow = CMGetTimeDesc (@CMTimeNow, "It is now &hr:&mi on &DA, &MO &dd")
  114.     sets szNow to "It is now 15:37 on Monday, August 15".
  115.     
  116.  
  117. /****************************************************************************/
  118. nInfo = CMGetTimeInfo (sTime, nWhichInfo)
  119.  
  120. Returns information about a specified time.
  121.  
  122. Parameters:
  123.     (string)    The time to get information about, in WIL "datetime" format
  124.                 ("yy:mm:dd:hh:mi:ss").
  125.     (number)    Which piece of information to get from it:
  126.                     @CMYear - The year (00..99)
  127.                     @CMMonth - The month (1..12)
  128.                     @CMDayOfMonth - The day of month (1..31)
  129.                     @CMDayOfWeek - The day of the week (0-Sun..6-Sat)
  130.                     @CMHour - The hours (0..11)
  131.                     @CMMinute - The minutes (0..59)
  132.                     @CMSecond - The seconds (0..59)
  133.  
  134. Returns:
  135.     (number)    The information requested above.
  136.  
  137. See Also:
  138.     CMSetTimeInfo
  139.  
  140.  
  141. /****************************************************************************/
  142. CMLogMessage (sMessage)
  143.  
  144. Writes a message out to CLOCKMAN.LOG.
  145.  
  146. Parameters:
  147.     (string)    The message to write out, up to 256 characters.
  148.  
  149. This command writes out the current date & time, and then the message you
  150. specify. The log file name is the same as the current .ALR file, except with
  151. a .LOG extension. This is usually CLOCKMAN.LOG.
  152.  
  153.     
  154. /****************************************************************************/
  155. CMSetEvtInfo (nEventID, nWhich, nData)
  156. CMSetEvtInfo (nEventID, nWhich, sData)
  157.  
  158.  
  159. Parameters:
  160.     (number)    Event identifier. (See CMGetEvtInfo)
  161.     (number)    Which piece of data to set. (See CMGetEvtInfo)
  162.     (number) or The new data. It's a string if setting @CMEvtTime, @CMMsg,
  163.     (string)    @CMTuneName, @CMPgmLine, or @CMPgmKeys; it's a number if
  164.                 setting @CMMsgType, @CMTune, @CMAction, @CMPgmShowAs, or
  165.                 @CMAdjSecs.
  166.  
  167. Note: you can't use @CMIsActive. (When you call CMGetEvtInfo with @CMIsActive,
  168. it merely tells you if the event will ever occur again. This depends on
  169. whether it's a recurring or a one-time event, and whether or not this one time
  170. is set in the future or in the past.)
  171.  
  172. See Also:
  173.     CMGetEvtInfo
  174.  
  175.  
  176. /****************************************************************************/
  177. CMSetSysTime (sTime)
  178.  
  179. Sets the PC's system time.
  180.  
  181. Parameters:
  182.     (string)        The new system time. This can be the local time in WIL
  183.                     datetime format ("yy:mm:dd:hh:mi:ss") or a single Unix time
  184.                     (secs since 00:00:00 GMT 1/1/70).
  185.  
  186. See Also:
  187.     CMGetSysTime
  188.  
  189.  
  190. /****************************************************************************/
  191. sNewTime = CMSetTimeInfo (sOldTime, nWhichInfo, nData)
  192.  
  193. Changes specific parts of a WIL "datetime" string.
  194.  
  195. Parameters:
  196.     (string)    The time to change information about, in WIL "datetime" format
  197.                 ("yy:mm:dd:hh:mi:ss").
  198.     (number)    Which info to change:
  199.     (number)    Which piece of information to change:
  200.                     @CMYear - The year (00..99)
  201.                     @CMMonth - The month (1..12)
  202.                     @CMDayOfMonth - The day of month (1..31)
  203.                     @CMHour - The hours (0..11)
  204.                     @CMMinute - The minutes (0..59)
  205.                     @CMSecond - The seconds (0..59)
  206.                     @CMUnixTime - Assumes the string is a single number
  207.                         representing how many seconds have elapsed since
  208.                         00:00:00 GMT on 1/1/70. This will convert it to a
  209.                         WIL "datetime" string.
  210.     (number)    The new data. (Ignored if @CMUnixTime.)
  211.  
  212. Returns:
  213.     (string)    The time in WIL "datetime" format, with the appropriate data
  214.                 changed.
  215.  
  216. See Also:
  217.     CMGetTimeInfo
  218.