| 1 |
#!/usr/bin/env regina |
| 2 |
/* |
| 3 |
* Test program for Regina 08a |
| 4 |
* |
| 5 |
* This program tests the new ANSI REXX Time conversion functionality. |
| 6 |
* |
| 7 |
*/ |
| 8 |
Trace o |
| 9 |
Say |
| 10 |
Say 'This is the output from the "normal" Time() function' |
| 11 |
Say |
| 12 |
normal_times = "N C O S L M H" |
| 13 |
Do i = 1 To Words(normal_times) |
| 14 |
Call show_times 1, Word(normal_times,i) |
| 15 |
End |
| 16 |
Say |
| 17 |
Say 'This is the output from the Time() conversion function' |
| 18 |
Say |
| 19 |
Call show_times 3,'L','12:45:04','N' |
| 20 |
Call show_times 3,'S','12:45:04','N' |
| 21 |
Call show_times 3,'N','45904','S' |
| 22 |
Call show_times 3,'L','12:50am','C' |
| 23 |
Call show_times 3,'L','12:50pm','C' |
| 24 |
Call show_times 3,'L','00:50am','C' |
| 25 |
Call show_times 3,'L','02:50pm','C' |
| 26 |
Call show_times 3,'L','10','H' |
| 27 |
Call show_times 3,'L','000','H' |
| 28 |
Call show_times 3,'L','12','M' |
| 29 |
Call show_times 3,'L','121','M' |
| 30 |
Call show_times 3,'L','12','S' |
| 31 |
Call show_times 3,'L','8192','S' |
| 32 |
Call show_times 3,'E','8192','S' |
| 33 |
Call show_times 3,'L','12:45:04.345673','L' |
| 34 |
Call show_times 3,'N','12:45:04','N' |
| 35 |
Call show_times 3,'S','45904','S' |
| 36 |
Call show_times 3,'H','10','H' |
| 37 |
Call show_times 3,'M','10','M' |
| 38 |
Call show_times 3,'C','12:50am','C' |
| 39 |
Call show_times 3,'C','12:50pm','C' |
| 40 |
Call show_times 3,'C','02:50am','C' |
| 41 |
Call show_times 3,'C','02:50pm','C' |
| 42 |
Return 0 |
| 43 |
|
| 44 |
show_times: Procedure |
| 45 |
Parse Arg num,arg1,arg2,arg3 |
| 46 |
If num = 1 Then |
| 47 |
Do |
| 48 |
Say Left("Time('"arg1"')",30) "===>" Time(arg1) |
| 49 |
End |
| 50 |
Else |
| 51 |
Do |
| 52 |
Say Left("Time('"arg1"','"arg2"','"arg3"')",30) "===>" Time(arg1,arg2,arg3) |
| 53 |
End |
| 54 |
Return |
| 55 |
/**/ |