Mercurial > hg > octave-lojdl
changeset 15750:05c781cca57e
use numel instead of length in newly imported java functions
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 07 Dec 2012 18:03:01 -0500 |
parents | 54f7ef3f7e63 |
children | 72968fb32c82 |
files | scripts/java/dlgtest.m scripts/java/errordlg.m scripts/java/helpdlg.m scripts/java/inputdlg.m scripts/java/javaArray.m scripts/java/javaclasspath.m scripts/java/listdlg.m scripts/java/msgbox.m |
diffstat | 8 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/java/dlgtest.m +++ b/scripts/java/dlgtest.m @@ -59,7 +59,7 @@ disp('- test listdlg with selectionmode single. No caption, no prompt.'); itemlist = {'An item \\alpha', 'another', 'yet another'}; s = listdlg ( 'ListString',itemlist, 'SelectionMode','Single' ); - imax = length(s); + imax = numel (s); for i=1:1:imax disp(['Selected: ',num2str(i),': ', itemlist{s(i)}]); end @@ -71,7 +71,7 @@ 'Name','Selection Dialog', ... 'InitialValue',[1,2,3,4], 'PromptString',{'Select an item...', '...or multiple items'} ); - imax = length(s); + imax = numel (s); for i=1:1:imax disp(['Selected: ',num2str(i),': ', itemlist{s(i)}]); end
--- a/scripts/java/errordlg.m +++ b/scripts/java/errordlg.m @@ -39,7 +39,7 @@ endif endif - switch length (varargin) + switch (numel (varargin)) case 0 title = "Error Dialog";
--- a/scripts/java/helpdlg.m +++ b/scripts/java/helpdlg.m @@ -39,7 +39,7 @@ endif endif - switch length (varargin) + switch (numel (varargin)) case 0 title = "Help Dialog";
--- a/scripts/java/inputdlg.m +++ b/scripts/java/inputdlg.m @@ -57,7 +57,7 @@ error ("inputdlg: character string or cellstr array expected for prompt"); endif - switch length (varargin) + switch (numel (varargin)) case 0 title = "Input Dialog"; lineNo = 1;
--- a/scripts/java/javaArray.m +++ b/scripts/java/javaArray.m @@ -38,7 +38,7 @@ function retval = javaArray (class_name, varargin) - switch length (varargin) + switch (numel (varargin)) case 0 error ("missing array size");
--- a/scripts/java/javaclasspath.m +++ b/scripts/java/javaclasspath.m @@ -104,7 +104,7 @@ function disp_path_list ( which, path_list ) printf (" %s JAVA PATH\n\n", which); - if (length (path_list) > 0) + if (numel (path_list) > 0) printf (" %s\n", path_list{:}); else printf (" - empty -\n");
--- a/scripts/java/listdlg.m +++ b/scripts/java/listdlg.m @@ -56,9 +56,9 @@ ## @example ## [sel, ok] = listdlg ("ListString", @{"An item", "another", "yet another"@}, "SelectionMode", "Multiple" ); ## if (ok == 1) -## imax = length(sel); -## for i=1:1:imax -## disp(sel(i)); +## imax = numel (sel); +## for i = 1:1:imax +## disp (sel(i)); ## end ## end ## @end example @@ -121,7 +121,7 @@ selmode, listsize, initialvalue, name, prompt, okstring, cancelstring); - if (length(ret) > 0) + if (numel (ret) > 0) varargout = {ret, 1}; else varargout = {{}, 0};