DATEPICK
A date and time selection accessory for use with r4™

Categories:

visual accessory, date and time selection accessory

Description:

The DATEPICK accessory is used by r4™ programs to acquire a selected date and time. The response value is returned in the system registry.

Since multiple r4™ programs can be active at the same time, the name of a system registry subkey can optionally be passed as a value in the command line. This allows each r4™ program to receive an independent response value. The r4™ program can also pass the initial date to display. The default initial date is today's date.

Usage:

  PROMPT [initialDate[-initialTime] [subkey]]

Arguments:

 initialDate .. initial date, format: YYYYMMDD.
   The default initial date is today's date.
   If the initial date value is '-', today's date is shown.
 
 initialTime .. initial time, format: HHMM.
   The default initial time is 00:00 (midnight).
 
 subkey .. a response subkey.

Returns:

Buttons:

OK
Concludes DATEPICK operation. The selected date and time values are stored in the system registry.

Cancel
Concludes DATEPICK operation, without revising the system registry value.

Example:

The following is the r4™ program that displayed the prompt that was shown above

 /* DatePick.rex
   demonstration program that uses DATEPICK.EXE
 
   usage:
   r4 DatePick [yyyymmdd[-hhmm] [subkey]]
 
   examples:
 
     1. r4 DatePick [ default date is TODAY ]
 
     2. r4 DatePick 20010707 [ use date 20010707 ]
 
     3. r4 DatePick 20010707-1315 [ use date 20010707 time 13:15 (1:15pm) ]
 
   refer to DATEPICK.HTM for a description of the usage of DATEPICK.EXE
 */
 
 trace off /* ignore Cancel button error */
 
 showDate = '-' /* => default date is TODAY */
 
 showTime = '' /* => default time is 00:00 (midnight) */
 
 subkey = ''
 
 if arg(1) <> '' then do
   showDate = word( arg(1), 1 )
   if pos( '-', showDate ) > 0 then
     parse var showDate showDate '-' showTime
   subkey = '\'word( arg(1), 2 )
   end
 
 'DatePick' showDate || copies( '-'showTime, showTime <> '' ) subkey
 
 if rc = 0 then do
   response = value( 'HKLM\Software\Kilowatt Software\DatePick' || subkey || '[Response]', , 'Registry' )
   parse var response year +4 month +2 day '-' hour +2 minute
   say 'You selected:' hour':'minute 'on' month'/'day'/'year
   end

DATEPICK
An r4™ auxiliary rogram.
Version 1.0
Copyright © 2001-2007
All Rights Reserved.
Web: http://www.kilowattsoftware.com/
E-Mail: support@kilowattsoftware.com