# HG changeset patch # User Rik # Date 1288902898 25200 # Node ID b8585f8e11d58305450f7257824aa2782ec77b1c # Parent 364ef2eb2499e470cd6b48fe4d39ad65522fdd3f __fltk_ginput__.m: Use semicolons to prevent internal function evaluations being output to screen. diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-11-04 Rik + + * plot/__fltk_ginput__.m: Use semicolons to prevent internal + function evaluations being output to screen. + 2010-11-04 Rik * plot/module.mk: Add __fltk_ginput__.m to list of scripts diff --git a/scripts/plot/__fltk_ginput__.m b/scripts/plot/__fltk_ginput__.m --- a/scripts/plot/__fltk_ginput__.m +++ b/scripts/plot/__fltk_ginput__.m @@ -29,9 +29,7 @@ error ("ginput: must have at least one axes"); endif - x = []; - y = []; - button = []; + x = y = button = []; ginput_aggregator (0, 0, 0); unwind_protect @@ -64,18 +62,18 @@ endfunction function [x, y, n] = ginput_aggregator (mode , xn, yn) - persistent x y n + persistent x y n; - if (mode == 0), + if (mode == 0) x = []; y = []; n = 0; elseif (mode == 1) - x = [x, xn]; - y = [y, yn]; + x = [x; xn]; + y = [y; yn]; n += 1; elseif (mode == 2) - n = -1 + n = -1; endif endfunction @@ -85,8 +83,8 @@ endfunction function ginput_keypressfcn (src, evt) - if (evt.Key == 10) - ginput_aggregator (2, 0, 0) + if (evt.Key == 10) # linefeed character + ginput_aggregator (2, 0, 0); endif endfunction