Annotation of freem/contrib/%KEY.m, revision 1.1.1.1
1.1 snw 1: %KEY(to,mode) ; A.Trocha ; keyb-handler [1999/01/29- 6:01:56]
2: ; $Source: /cvsroot-fuse/gump/FreeM/mlib/%KEY.m,v $
3: ; $Revision: 1.2 $ $Date: 2000/02/18 15:13:41 $
4: ; <to> timeout (sec) default: no timeout
5: ; <mode> 0 or "" or n.d : return values
6: ; 1 : interpret
7: ;
8: N buf,x,exec
9: ;
10: S to=$G(to)
11: I to="" S to=-1,exec="R *x"
12: E S exec="R *x:"_to
13: ;
14: S buf=""
15: ;
16: get X exec I '$T Q ""
17: ;
18: D add(x)
19: ;
20: loop R *x:0 I '$T G interp
21: D add(x)
22: G loop
23: ;
24: interp ;--- interpret buffer and return string
25: I $G(mode)=1 Q $$^%KEYINT(buf)
26: Q buf
27: ;
28: add(x) ;--- add key-value to buffer
29: I buf'="" S buf=buf_"-"
30: S buf=buf_x
31: Q
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>