-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtritask.mac
780 lines (628 loc) · 16.4 KB
/
tritask.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
LabelTop:
____DEFINE____:
FIX_DISPLAYPOS:
// メニュー表示位置を変える.
// if キー押下 then キー割り当て経由なのでキャレット位置に.
// else メニューやツールバーからの起動とみなしてマウス位置に.
// キー割り当ては修飾キーを必ず使うので shift, ctrl, alt を見れば十分.
#use_mouse_pos = true;
if(iskeydown(0x10)){
#use_mouse_pos = false;
}
if(iskeydown(0x11)){
#use_mouse_pos = false;
}
if(iskeydown(0x12)){
#use_mouse_pos = false;
}
// Pageup/Pagedown
if(iskeydown(0x21)){
#use_mouse_pos = false;
}
if(iskeydown(0x22)){
#use_mouse_pos = false;
}
MENU_CONSTRUCTION:
#cnt=0;
#I_ADD = #cnt; #cnt=#cnt+1;
#I_ADDINBO = #cnt; #cnt=#cnt+1;
#I_COPY = #cnt; #cnt=#cnt+1;
#I_START = #cnt; #cnt=#cnt+1;
#I_END = #cnt; #cnt=#cnt+1;
#I_CLOSE = #cnt; #cnt=#cnt+1;
#I_POST_END = #cnt; #cnt=#cnt+1;
#I_EDIT_TASK = #cnt; #cnt=#cnt+1;
#I_SEP1 = #cnt; #cnt=#cnt+1;
#I_WALK = #cnt; #cnt=#cnt+1;
#I_WALK_1 = #cnt; #cnt=#cnt+1;
#I_TO_TODAY = #cnt; #cnt=#cnt+1;
#I_CLR_DATE = #cnt; #cnt=#cnt+1;
#I_SEP2 = #cnt; #cnt=#cnt+1;
#I_SORT = #cnt; #cnt=#cnt+1;
#I_JUMP_STA = #cnt; #cnt=#cnt+1;
#I_OPEN_CMD = #cnt; #cnt=#cnt+1;
#I_REF = #cnt; #cnt=#cnt+1;
#I_SIMPLE_COMP = #cnt; #cnt=#cnt+1;
#I_SEP3 = #cnt; #cnt=#cnt+1;
#I_REPORT_TODAY= #cnt; #cnt=#cnt+1;
#I_SEP4 = #cnt; #cnt=#cnt+1;
#I_EDIT_SCRI = #cnt; #cnt=#cnt+1;
#I_EDIT_ME = #cnt;
// [[[ menu item start
#idx=#I_ADD; $items[#idx] = "(&A)Add Task";
#idx=#I_ADDINBO; $items[#idx] = "(&X)Add Inbox";
#idx=#I_COPY; $items[#idx] = "(&C)Copy Task";
#idx=#I_START; $items[#idx] = "(&S)Start Task";
#idx=#I_END; $items[#idx] = "(&E)End Task";
#idx=#I_POST_END; $items[#idx] = "(&0)End Task(Posteriori End)";
#idx=#I_CLOSE; $items[#idx] = "(&Q)Close Task";
#idx=#I_EDIT_TASK; $items[#idx] = "(&/)Edit Task";
#idx=#I_SEP1; $items[#idx] = "\x01";
#idx=#I_WALK; $items[#idx] = "(&D)Walk day <Multi> <FindInToday>";
#idx=#I_WALK_1; $items[#idx] = "(&1)Walk +1 day(Smart-walk) <Multi> <FindInToday>";
#idx=#I_TO_TODAY; $items[#idx] = "(&T)Change to Today <Multi> <FindInToday>";
#idx=#I_CLR_DATE; $items[#idx] = "(&I)Clear Date";
#idx=#I_SEP2; $items[#idx] = "\x01";
#idx=#I_SORT; $items[#idx] = "(& )Sort";
#idx=#I_JUMP_STA; $items[#idx] = "(&J)Jump to Starting-Task";
#idx=#I_REF; $items[#idx] = "(&R)Open Reference";
#idx=#I_OPEN_CMD; $items[#idx] = "(&O)Open Commandline";
#idx=#I_SIMPLE_COMP; $items[#idx] = "(&W)Simple Completion";
#idx=#I_SEP3; $items[#idx] = "\x01";
#idx=#I_REPORT_TODAY; $items[#idx]= "(&.)Report Today or Selected-Range";
#idx=#I_SEP4; $items[#idx] = "\x01";
#idx=#I_EDIT_SCRI; $items[#idx] = "(&P)Programming helper script";
#idx=#I_EDIT_ME; $items[#idx] = "(&P)Programming this macro";
#idx=#idx+1; #maxidx = #idx;
// menu item end ]]]
CONSTS:
// 012345678901234567890123456789
// INBOX
// M 2017/07/11 Thu 9:52 10:33 YESTERDAY
// M 2017/07/12 Wed TODAY 未着手
// M 2017/07/12 Wed 9:52 TODAY 作業中
// M 2017/07/12 Wed 9:52 10:33 TODAY 終了
// M 2017/07/13 Thu TOMORROW
#POS_SORTMARK = 0;
#POS_DATE = 2;
#POS_DOW = 13;
#POS_STARTTIME = 17;
#POS_ENDTIME = 23;
#POS_DESCRIPTION = 29;
#LEN_SORTMARK = 1;
#LEN_DATE = strlen("YYYY/MM/DD");
#LEN_DOW = strlen("DOW");
#LEN_FULLDATE = #LEN_DATE + 1 + #LEN_DOW; // includes a space.
#LEN_TIME = strlen("HH:MM");
#LEN_BEFORE_DESC = #LEN_SORTMARK + 1 + #LEN_FULLDATE + 1 + (#LEN_TIME+1)*2;
$EMPTY_SORTMARK = " ";
$EMPTY_DATE = " ";
$EMPTY_DOW = " ";
$EMPTY_TIME = " ";
$EMPTY_FULLDATE = $EMPTY_DATE + " " + $EMPTY_DOW;
// 現在開いてる trita ファイル絡みの情報.
$OPENING_FILE_FULLPATH = filename;
// pythonw を使うと DOS 窓非表示で実行できる.
// ただし pythonw を使うと秀丸エディタが再アクティブにならず
// リロード確認ダイアログも出なくなってしまうため,
// 明示的にリロードを行わせる必要がある.
//$USING_PYTHON_BIN = "python"
//#use_explicit_reload = false;
$USING_PYTHON_BIN = "pythonw";
#use_explicit_reload = true;
$FULLPATH_HIDEMARU_BIN = hidemarudir+"\\hidemaru.exe";
$FULLPATH_HELPER = currentmacrodirectory + "\\helper.py";
$COMMANDLINE_HELPER = $USING_PYTHON_BIN + " " + $FULLPATH_HELPER;
____OPTION_INTERPRETATION____:
// コマンドラインオプション解釈.
// 最終的に DO_XXXX: を実行させる仕組み.
$mode = getarg(0);
if($mode=="mode_start"){
#si = #I_START;
goto ____ACTIONS____;
}
if($mode=="mode_end"){
#si = #I_END;
goto ____ACTIONS____;
}
if($mode=="mode_sort"){
#si = #I_SORT;
goto ____ACTIONS____;
}
____MENU_TRACKING____:
// メニュー表示.
// ユーザー側が行動するまで停止.
if(#use_mouse_pos==true){
mousemenuarray $items, #maxidx;
}else{
menuarray $items, #maxidx;
}
// 何か行動したら再開.
if(result==0){
// Cancel
endmacro;
}
#si = result-1;
$sn = $items[#si];
____BEFORE_ACTION____:
// 日付操作など直接入力を使うことが多いので自動的に IME オフにしてみる.
call ime_off;
____ACTIONS____:
if(#si==#I_EDIT_ME){
$path = hidemarudir+"\\hidemaru.exe " + currentmacrofilename;
run $path;
endmacro;
}
if(#si==#I_EDIT_SCRI){
// helper script を秀丸エディタで開く.
$path = hidemarudir+"\\hidemaru.exe " + $FULLPATH_HELPER;
run $path;
endmacro;
}
if(#si==#I_ADD){
call DO_ADD;
endmacro;
}
if(#si==#I_ADDINBO){
call DO_ADD;
call DO_CLEAR_DATE;
endmacro;
}
if(#si==#I_COPY){
call DO_COPY;
endmacro;
}
if(#si==#I_START){
call DO_START;
endmacro;
}
if(#si==#I_END){
// starttime endtime
// - - 何もしない(startしてないものはendできない)
// - o 何もしない(startしてないものはendできない)
// o o end をキャンセルする.
// o - end する
call get_current_starttime;
$cur_starttime = $$return;
call get_current_endtime;
$cur_endtime = $$return;
if($cur_starttime == $EMPTY_TIME){
endmacro;
}
call DO_END;
endmacro;
}
if(#si==#I_POST_END){
// 既存タスクを誤って上書きするのを防ぐため,
// starttimeもendtimeも両方空のときのみ発動させる.
//
// starttime endtime
// - - 報告的終了する
// - o 何もしない
// o o 何もしない
// o - 何もしない
call get_current_starttime;
$cur_starttime = $$return;
call get_current_endtime;
$cur_endtime = $$return;
if($cur_starttime != $EMPTY_TIME){
endmacro;
}
if($cur_endtime != $EMPTY_TIME){
endmacro;
}
call DO_POST_END;
endmacro;
}
if(#si==#I_CLOSE){
call DO_START;
call DO_END;
endmacro;
}
if(#si==#I_EDIT_TASK){
call DO_EDIT_TASK;
endmacro;
}
if(#si==#I_EDIT_TASK_S){
call DO_EDIT_TASK_AND_SELECT;
endmacro;
}
if(#si==#I_JUMP_STA){
call DO_JUMP_TO_START;
endmacro;
}
if(#si==#I_CLR_DATE){
call DO_CLEAR_DATE;
endmacro;
}
if(#si==#I_TO_TODAY){
call DO_CHANGE_TO_TODAY;
endmacro;
}
if(#si==#I_SORT){
call DO_SORT;
endmacro;
}
if(#si==#I_WALK){
call if_not_trita_then_end;
$day_str = input("Input a day diff.(Ex: 1, +7, -7)");
if(result==false){
endmacro;
}
call DO_WALK $day_str;
endmacro;
}
if(#si==#I_WALK_1){
call if_not_trita_then_end;
call DO_SMARTWALK;
endmacro;
}
if(#si==#I_REF){
call DO_OPEN_REFERENCE;
endmacro;
}
if(#si==#I_OPEN_CMD){
call DO_OPEN_COMMANDLINE;
endmacro;
}
if(#si==#I_SIMPLE_COMP){
call DO_SIMPLE_COMPLETION;
endmacro;
}
if(#si==#I_REPORT_TODAY){
call DO_REPORT_TODAY;
endmacro;
}
endmacro;
____SUBROOTIN_ACTIONS____:
DO_START:
call if_blank_then_end;
golinetop;
right #POS_STARTTIME;
// 既に入力済ならクリアする.
$curval = gettext(x, y, x+#LEN_TIME, y, 0);
call delete_timestr;
if($curval==$EMPTY_TIME){
call get_currenttime;
$curtime = $$return;
insert $curtime;
}else{
insert $EMPTY_TIME;
}
return 0;
DO_END:
call if_blank_then_end;
golinetop;
right #POS_ENDTIME;
// 既に入力済 -> クリアする.
// まだ入力がない -> 入力する, 加えて repeat 操作も実施.
$curval = gettext(x, y, x+#LEN_TIME, y, 0);
call delete_timestr;
if($curval==$EMPTY_TIME){
call get_currenttime;
$curtime = $$return;
insert $curtime;
call DO_REPEAT_IF_POSSIBLE;
}else{
insert $EMPTY_TIME;
}
return 0;
DO_POST_END:
call if_not_trita_then_end;
call if_blank_then_end;
save;
call get_target_lineno_commandline;
$yargs = $$return;
title "Do posteriori end...";
$args = "-i " + $OPENING_FILE_FULLPATH + " " + $yargs + " --end-now";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
call smart_reload;
return 0;
DO_JUMP_TO_START:
// 検索設定が上書きされるのを防ぐため,
// 現在の設定を保持してから検索を行い, 終わった後で復旧する.
#oldsettings = searchoption;
$oldgrepee = grepfilebuffer;
$oldquery = ""; // 元々検索語は保持されてないのでテキトーに空文字で.
$query = "[0-9]{2}\\:[0-9]{2}( ){7}";
searchdown2 $query, regular, loop;
setsearch $oldquery, #oldsettings;
setgrepfile $oldgrepee;
return 0;
DO_CHANGE_TO_TODAY:
call if_not_trita_then_end;
call if_blank_then_end;
save;
call get_target_lineno_commandline;
$yargs = $$return;
title "Changing to today...";
$args = "-i " + $OPENING_FILE_FULLPATH + " " + $yargs + " --to-today";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
call smart_reload;
return 0;
DO_CLEAR_DATE:
call if_blank_then_end;
golinetop;
right #POS_DATE;
call delete_fulldate;
insert $EMPTY_FULLDATE;
// タスク内容を編集するのが自然だと思う.
golinetop;
right #LEN_BEFORE_DESC;
return 0;
DO_ADD:
// 挙動のバリエーション:
//
// 2 2019/03/25 Mon task today 1 ★1
// 3 2019/03/26 Tue task tomorrow ★2
// ★3
//
// 位置 1~2 の時はその行の datetime を使うことにする.
// なぜ?
// -> より自然だから.
// 特に 3 の位置でのタスク追加 = 26 日のタスクとして追加したい, を意味するから.
// v1.7.0 以前では(今日が 25 日だとしたら)25 日固定となり, 直感的でない.
//
// 位置 3 の時は v1.7.0 以前のとおり今日の datetime を使う.
if(linelen==0){
// 空行ならその位置に今日の日付を挿入する.
call get_currentfulldate;
$fulldate = $$return;
}else{
// 空行でないならその行の日付文字列を流用する.
golinetop;
call get_currentfulldatefield;
$fulldate = $$return;
if(strlen($fulldate) < #LEN_FULLDATE){
return;
}
insertline;
}
insert $EMPTY_SORTMARK + " " + $fulldate + " " + $EMPTY_TIME + " " + $EMPTY_TIME + " ";
return 0;
DO_EDIT_TASK:
call if_blank_then_end;
golinetop;
right #POS_DESCRIPTION;
// 本当は ← 方向で範囲選択したかった(カーソルが #POS_DESCRIPTION に来て扱いやすい)が,
// x - #POS_DESCRIPTION などの差分計算では日本語含む場合に狂うので断念.
beginsel;
golineend;
endsel;
return 0;
DO_WALK:
// 現在行の日付部分を walk する.
// @param[string] day_str walkしたい日数
$day_str = $$1;
save;
call get_target_lineno_commandline;
$yargs = $$return;
title "Walking days...";
$args = "-i " + $OPENING_FILE_FULLPATH + " " + $yargs + " -d " + $day_str + " --walk";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
call smart_reload;
return 0;
DO_SMARTWALK:
save;
call get_target_lineno_commandline;
$yargs = $$return;
title "Smartwalking...";
$args = "-i " + $OPENING_FILE_FULLPATH + " " + $yargs + " --smartwalk";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
call smart_reload;
return 0;
DO_REPEAT_IF_POSSIBLE:
call if_not_trita_then_end;
call get_currentdescription;
$description = $$return;
#pos = strstr($description, "rep:");
if(#pos==-1){
return 0;
}
// 以下のやり方でリピートタスクをつくる.
// - 1. タスクを複製する
// - 2. 1 のタスクの rep 値を見て, その日数分だけ日付を walk する
call DO_COPY;
save;
title "Repeating...";
$args = "-i " + $OPENING_FILE_FULLPATH + " -y " + str(y) + " --repeat";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
call smart_reload;
return 0;
DO_COPY:
call if_blank_then_end;
call get_currentline;
$curline = $$return;
// 次行を確保してコピーを挿入
golineend;
insertreturn;
golinetop;
insert $curline;
// 開始終了部分は邪魔なので消す.
golinetop;
right #POS_STARTTIME;
call delete_timestr;
delete;
call delete_timestr;
insert $EMPTY_TIME + " " + $EMPTY_TIME;
// 複製後はタスク内容をいじるのが自然だと思う.
golineend;
return 0;
DO_SORT:
// 関係無いファイル上でうっかり実行しちゃった時に
// 悲惨なことになりかねないのでガードをかけておく.
call if_not_trita_then_end;
// 以後のソート処理は元ファイルを読み込んでから処理するため
// 上書き保存しておかないと現在の内容でソートされない.
save;
title "Sorting...";
$args = "-i " + $OPENING_FILE_FULLPATH + " --sort";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
call smart_reload;
return 0;
DO_OPEN_REFERENCE:
call if_not_trita_then_end;
// ref:YYMMDD_HHMMSS を末尾に自動挿入する.
// いちいち ref:XXXXX の XXXXX 部分を考えるのが面倒くさい.
// 秒単位だから衝突することもないはず.
//
call get_currentline;
$curline = $$return;
$query = "ref:";
if(strstr($curline, $query)==-1){
// 終了済タスクの場合は新規するコンテキストじゃないのでしない.
call get_current_endtime;
$cur_endtime = $$return;
if($cur_endtime != $EMPTY_TIME){
endmacro;
}
golineend;
// tasknameref:XXX
// task ref:XXX
// ^
// ここ空けないと属性としてみなせない.
insert " ";
call get_currentshortdate;
$curshortdate = $$return;
insert $query + $curshortdate;
}
save;
title "Opening the reference...";
$args = "-i " + $OPENING_FILE_FULLPATH + " -y " + str(y) + " --ref";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
return 0;
DO_OPEN_COMMANDLINE:
call if_not_trita_then_end;
call get_currentline;
$curline = $$return;
$query = "o:";
if(strstr($curline, $query)==-1){
return 0;
}
title "Opening the commandline...";
$args = "-i " + $OPENING_FILE_FULLPATH + " -y " + str(y) + " --open";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
return 0;
DO_SIMPLE_COMPLETION:
call if_not_trita_then_end;
// 以後の処理は元ファイルを読み込んでから処理するため, 先に上書き保存しておく.
save;
title "Doing simple completion...";
$args = "-i " + $OPENING_FILE_FULLPATH + " --use-simple-completion";
run $COMMANDLINE_HELPER + " " + $args;
title 0;
call smart_reload;
return 0;
DO_REPORT_TODAY:
call if_not_trita_then_end;
// 複数選択時なら selected-range dialog report を、
// それ以外なら today dialog report を呼び出す。
if(selecting==1){
call get_target_lineno_commandline;
$yargs = $$return;
title "Dislaying report of selected range...";
$args = "-i " + $OPENING_FILE_FULLPATH + " " + $yargs + " --selected-range-dialog-report";
}else{
title "Dislaying today report...";
$args = "-i " + $OPENING_FILE_FULLPATH + " --today-dialog-report";
}
run $COMMANDLINE_HELPER + " " + $args;
title 0;
return 0;
____SUBROOTINS____:
if_blank_then_end:
if(linelen==0){
endmacro;
}
return 0;
if_not_trita_then_end:
if(filetype!=".trita"){
endmacro;
}
return 0;
ime_off:
#IME_ON = 1;
#IME_OFF = 0;
if(imestate == #IME_ON){
imeswitch;
}
return 0;
smart_reload:
if(#use_explicit_reload==true){
title "Reloading...";
reopen;
title 0;
}
return 0;
delete_fulldate:
#i = 0;
while(#i < #LEN_FULLDATE){
delete;
#i = #i + 1;
}
return 0;
delete_timestr:
#i = 0;
while(#i < #LEN_TIME){
delete;
#i = #i + 1;
}
return 0;
get_target_lineno_commandline:
$targetline = "";
if(selecting==0){
$targetline = "-y " + str(y);
return $targetline;
}
if(seltopy!=selendy){
$targetline = "-y " + str(seltopy) + " --y2 " + str(selendy);
return $targetline;
}
// get current selected range text
$walking_tag = gettext(seltopx, seltopy, selendx ,seltopy, 0);
$targetline = "--walking-tag " + $walking_tag;
return $targetline;
get_currentshortdate:
// midstr(year, 2, 2) だと動作しないので変数でワンクッション.
$curyear = year;
$curyear = midstr($curyear, 2, 2);
return $curyear + month + day + "_" + hour + minute + second;
get_currentfulldate:
call get_currentdate;
$curdate = $$return;
call get_currentdow;
$dow = $$return;
return $curdate + " " + $dow;
get_currentdate:
return year + "/" + month + "/" + day;
get_currentdow:
$dowlist = "SunMonTueWedThuFriSat";
return midstr($dowlist, dayofweeknum*3, 3);
get_currenttime:
return hour + ":" + minute;
get_currentline:
return gettext(0, y, linelen ,y, 0);
get_currentfulldatefield:
call get_currentline;
$curline = $$return;
return midstr($curline, #POS_DATE, #LEN_FULLDATE);
get_currentdescription:
call get_currentline;
$curline = $$return;
return midstr($curline, #POS_DESCRIPTION, );
get_current_starttime:
call get_currentline;
$curline = $$return;
return midstr($curline, #POS_STARTTIME, #LEN_TIME);
get_current_endtime:
call get_currentline;
$curline = $$return;
return midstr($curline, #POS_ENDTIME, #LEN_TIME);