File: memopad.mac

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 (72 lines) | stat: -rw-r--r-- 1,834 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
62
63
64
65
66
67
68
69
70
71
72
%% Copyright (C) 2005 David Sugar, 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.
%%
%% A simple memopad system, used to distribute system memos.
%%
%% Primary macros:
%%	memopad::record		record a new memo
%%	memopad::play		play unplayed memo's for given user
%%	memopad::name		used to record name/heading for memos

	dir memopad
	use property
	use sort
	use time
	property .after:32 .order:1

macro name
	keywords user limit
	define %user="system" %limit="10s"
	const %temp "temp-" %user {.au}
	const %name "name-" %user {.au}
	record %temp timeout=%limit prefix=memopad
	move %temp %name
	return

macro record
	keywords user limit
	define %user="system" %limit="600s"
	date %today
	const %stamp %session.uid {.au}
	const %temp "memopad/temp-" %stamp
	const %memo "memopad/memo-" %stamp
	const %name "memopad/name-" %user {.au}
	build %temp %name &date %today
	append %temp timeout=%limit
	move %temp %memo
	return

macro play
	keywords user after
	define %user="none" %after="none"
	array size=32 count=20 %memo
	begin
	case %after != "none"
		set .after %after
	case %user != "none"
		load id=%user
	otherwise
		set .after ""
	endcase
	list %memo memopad after=&.after match="memo-" extension={.au}
	if #memo -lt 1 then return
	sort %memo
	if .order == "r" then revsort %memo
	foreach %item %memo 
		play %item prefix=memopad
	loop
	begin
	case %after != "none"
		set %after .after
	case %user != "none"
		save id=%user
	endcase
	return