%KEY(to,mode) ; A.Trocha ; keyb-handler [1999/01/29- 6:01:56]
; $Source: /home/cvsroot/freem/contrib/%KEY.m,v $
; $Revision: 1.1.1.1 $ $Date: 2025/01/19 02:04:04 $
; <to> timeout (sec) default: no timeout
; <mode> 0 or "" or n.d : return values
; 1 : interpret
;
N buf,x,exec
;
S to=$G(to)
I to="" S to=-1,exec="R *x"
E S exec="R *x:"_to
;
S buf=""
;
get X exec I '$T Q ""
;
D add(x)
;
loop R *x:0 I '$T G interp
D add(x)
G loop
;
interp ;--- interpret buffer and return string
I $G(mode)=1 Q $$^%KEYINT(buf)
Q buf
;
add(x) ;--- add key-value to buffer
I buf'="" S buf=buf_"-"
S buf=buf_x
Q
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>