Make $Tt a synonym for trigtime()

This commit is contained in:
Dianne Skoll
2024-04-20 11:50:39 -04:00
parent 592cfe5a20
commit 51aa7aecb9
5 changed files with 662 additions and 628 deletions

View File

@@ -2747,6 +2747,9 @@ Equivalent to \fBwkdaynum(trigdate())\fR.
.B $Ty (read-only)
Equivalent to \fByear(trigdate())\fR.
.TP
.B $Tt (read-only, TIME type)
Equivalent to \fBtrigtime()\fR.
.TP
.B $TimeSep
This variable can be set only to ":" or ".". It holds the character
used to separate portions of a time when \fBRemind\fR prints a TIME or

View File

@@ -114,7 +114,7 @@ EXTERN INIT( int LastTrigValid, 0);
EXTERN Trigger LastTrigger;
EXTERN TimeTrig LastTimeTrig;
EXTERN INIT( int LastTriggerDate, 0);
EXTERN INIT( int LastTriggerTime, 0);
EXTERN INIT( int LastTriggerTime, NO_TIME);
EXTERN INIT( int ShouldCache, 0);
EXTERN char const *CurLine;
EXTERN INIT( int NumTriggered, 0);

View File

@@ -175,6 +175,19 @@ static int terminal_bg_func(int do_set, Value *val)
return OK;
}
static int trig_time_func(int do_set, Value *val)
{
UNUSED(do_set);
if (LastTriggerTime != NO_TIME) {
val->type = TIME_TYPE;
val->v.val = LastTriggerTime;
} else {
val->type = INT_TYPE;
val->v.val = 0;
}
return OK;
}
static int trig_date_func(int do_set, Value *val)
{
UNUSED(do_set);
@@ -887,6 +900,7 @@ static SysVar SysVarArr[] = {
{"Tm", 0, SPECIAL_TYPE, trig_mon_func, 0, 0 },
{"Today", 1, STR_TYPE, &DynamicToday, 0, 0 },
{"Tomorrow", 1, STR_TYPE, &DynamicTomorrow, 0, 0 },
{"Tt", 0, SPECIAL_TYPE, trig_time_func, 0, 0 },
{"Tuesday", 1, STR_TYPE, &DynamicDayName[1], 0, 0 },
{"Tw", 0, SPECIAL_TYPE, trig_wday_func, 0, 0 },
{"Ty", 0, SPECIAL_TYPE, trig_year_func, 0, 0 },

File diff suppressed because one or more lines are too long

View File

@@ -329,6 +329,7 @@ set a052 time(1+2, 3+4)
rem 10 jan 1992 AT 11:22 CAL
set a053 trigdate()
set a054 trigtime()
set a054b $Tt
set a055 trigvalid()
set a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
set a057 value("a05"+"6")
@@ -457,6 +458,7 @@ set a129 23:30 + '2019-02-02@16:44'
REM 13 AT 16:00 DURATION 72:00 MSG 72-hour event
set a130 trigdate()
set a131 trigtime()
set a131b $Tt
set a132 trigdatetime()
set a133 trigduration()
set a134 trigeventstart()
@@ -928,11 +930,13 @@ REM Tue OMIT Wed 2024-01-01 MSG Blort
# Make sure trigtime() is not reset between invocations
REM Tue AT 16:00 DURATION 30 MSG Thing One
REM [$T] AT [trigtime()+trigduration()] DURATION 15 MSG Thing Two
REM [$T] AT [trigtime()+trigduration()] DURATION 30 MSG Thing Three
REM [$T] AT [$Tt+trigduration()] DURATION 30 MSG Thing Three
REM [$T] AT [trigtime()+trigduration()] DURATION 10 MSG Last Thing
# Make sure trigtime is not reset during parsing
REM Tue AT 16:00 MSG blort
REM Tue AT 10:00 DURATION [$Tt] MSG blort
REM Tue AT 16:00 MSG blort
REM Tue AT 10:00 DURATION [trigtime()] MSG blort
# Don't want Remind to queue reminders