home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
326.lha
/
DateRequester
/
test
< prev
next >
Wrap
Text File
|
1989-12-27
|
2KB
|
79 lines
/* Exercise the date requester. */
/* See the comment in uniqueport regarding Delay() and these lines.
if ~show('L','rexxsupport.library') then
call addlib('rexxsupport.library',0,-30)
if ~show('L','rexxarplib.library') then
call addlib('rexxarplib.library',0,-30)
*/
options results
portName = uniqueport()
Say "Unique port name =" portName
address value(portName)
'getformat'
Say 'The default date format is ' result '.'
mydate = NULL
mydate.1 = "1989" /* Year field. */
mydate.2 = "05" /* Month field. */
mydate.3 = "06" /* Day field. */
mydate.4 = "10" /* Hour field. */
mydate.5 = "20" /* Minute field. */
mydate.6 = "21" /* Second field. */
'setfulldate' "MYDATE";
'setformat' "DOS";
'setprompt' "Select the test date:"
'request';
'getdate'
Say 'The final date value =' result'.'
'gettime'
Say 'The final time value =' result'.'
'getdayname'
Say 'The day name for that date is ' result'.'
'getformat'
Say 'The final date format is ' result'.'
'getfulldate' "MYDATE";
Say 'The date components are: '
Say ' Year = ' mydate.1
Say ' Month = ' mydate.2
Say ' Day = ' mydate.3
Say ' Hour = ' mydate.4
Say ' Minute = ' mydate.5
Say ' Second = ' mydate.6
Say ' Weekday = ' mydate.7
'exit';
exit
/* Create a unique rexx port name. */
uniqueport:
portNumber = 0
do forever
testName = "mrdatereq" || portNumber
if ~show('ports', testName) then do
address command
'run' rxdatereq value(testName)
if rc ~= 0 then exit
do until show('ports', value(testName))
/* I know, this is an ugly busy-wait. I'm missing the boat
somewhere, but when I tried to use the addlib calls above,
I got the software failure / task-held requester, even
when I didn't call Delay(). I suspect that I have a name
collision with an entry in one of the libraries, but don't
know what it is. Anyone care to elucidate? Thanks.
call Delay(25);
*/
end
return value(testName);
end
portNumber = portNumber + 1
end