Mercurial > hg > octave-lyh
changeset 211:4adbab9c31cd
[project @ 1993-11-12 14:12:22 by jwe]
author | jwe |
---|---|
date | Fri, 12 Nov 1993 14:12:22 +0000 |
parents | 7947b7a6b6da |
children | 6188aa8d1fec |
files | scripts/miscellaneous/menu.m |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/menu.m +++ b/scripts/miscellaneous/menu.m @@ -1,11 +1,11 @@ -function s = menu (t,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16) +function s = menu (t, ...) -# usage: menu (title, opt1, opt2, ..., opt16) +# usage: menu (title, opt1, ...) # # See also: disp, printf, input - if (nargin < 2 || nargin > 17) - error ("usage: menu (title, opt1, opt2, ..., opt16)"); + if (nargin < 2) + error ("usage: menu (title, opt1, ...)"); endif # Force pending output to appear before the menu. @@ -28,9 +28,10 @@ s = 0; while (1) page_screen_output = "false"; + va_start (); for i = 1:nopt - command = sprintf ("printf (\" [%2d] \"); disp (x%d)", i, i); - eval (command); + printf (" [%2d] ", i); + disp (va_arg ()); endfor printf ("\n"); page_screen_output = save_page_screen_output;