Annotation of freem/mlib/%TUIMENU.m, revision 1.1
1.1 ! snw 1: %TUIMENU ; FREEM MENU HANDLER
! 2: Q
! 3: GO(S,I) ;
! 4: N %,C,DS,OPT S (%,OPT)=""
! 5: D DISP(S,I)
! 6: NXT S DS=1 W "Select ",$$G^%DB(S,I,"NAME")," Option//",$$G^%DB(S,I,"DEFAULT")," "
! 7: R %
! 8: I (%="q")!(%="Q") W " Quit",! Q
! 9: I %="?" D DISP(S,I) G NXT
! 10: S:%="" %=$$G^%DB(S,I,"DEFAULT"),DS=0
! 11: S %=$TR(%,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
! 12: S:'$D(@S@(I,"OPTS",%)) %=""
! 13: I %="" W !,"Invalid selection. Press ? to view all options.",! G NXT
! 14: W:DS " " W @S@(I,"OPTS",%)
! 15: I ('$D(@S@(I,"ACT",%)))&('$D(@S@(I,"TAG",%))) W !,"No action or tag defined for ",%,".",! G NXT
! 16: K %TAG I $D(@S@(I,"TAG",%)) S %TAG=@S@(I,"TAG",%)
! 17: I $D(@S@(I,"ACT",%)) S C="D "_@S@(I,"ACT",%) X C K C G NXT
! 18: Q
! 19: DISP(S,I) ;
! 20: N % S %=""
! 21: W !,$$G^%DB(S,I,"DESC")," - ",$$G^%DB(S,I,"NAME"),!,!
! 22: F S %=$O(@S@(I,"OPTS",%)) Q:%="" D
! 23: . W " ",%,") ",@S@(I,"OPTS",%),!
! 24: W !," Q) Quit",!,!
! 25: Q
! 26:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>