File: macros.def

package info (click to toggle)
bayonne 2.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 11,180 kB
  • ctags: 3,662
  • sloc: cpp: 38,791; sh: 9,323; ansic: 1,391; makefile: 485; perl: 471; java: 405; cs: 402; php: 354; python: 293
file content (61 lines) | stat: -rw-r--r-- 1,638 bytes parent folder | download
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
%% Copyright (C) 2005 Tycho Softworks.
%%
%% This file is free software; as a special exception the author gives
%% unlimited permission to copy and/or distribute it, with or without
%% modifications, as long as this notice is preserved.
%%
%% This program is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
%% implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%%
%% This defines some general case and convenience macros

	use time

%% record a file with rename and include a date stamp
macro record-stamp
	keywords limit name prefix extension exitkey min intro
	define limit="600s" min="0" extension={.au} exitkey={#} stamp="date"
	begin
	date %dnow
	time %tnow 
	case !defined %prefix
		const %tmp tmp- %session.timeslot %extension
		const %ren %name %extension
	otherwise
		const %tmp %prefix / tmp- %session.timeslot %extension
		const %ren %prefix / %name %extension
	endcase
	erase %tmp
	case %stamp == "date"
		if -defined %intro
		then
			build %tmp %intro &date %dnow
		else
			build %tmp &date %dnow
		endif
	case %stamp == "time"
		if -defined %intro
		then
			build %tmp %intro &time %tnow
		else
			build %tmp &time %tnow
		endif
	otherwise
                if -defined %intro
                then
                        build %tmp %intro &date %dnow &time %tnow
                else
                        build %tmp &date %dnow &time %tnow
                endif

	endcase
	beep 
	cleardigits
	timer %audiotimer
	append %tmp %ren exit=%exitkey timeout=%limit
	if %min > 0 and %audiotimer < %min then erase %ren
	return