visual accessory, date and time selection accessory
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.
PROMPT [initialDate[-initialTime] [subkey]] |
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. |
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 |