Mercurial > hg > octave-nkf
diff src/pt-loop.cc @ 3215:bc3fdfe311a3
[project @ 1998-11-10 14:06:21 by jwe]
author | jwe |
---|---|
date | Tue, 10 Nov 1998 14:12:07 +0000 |
parents | bef7b73c0724 |
children | 8b1f46ac2b64 |
line wrap: on
line diff
--- a/src/pt-loop.cc +++ b/src/pt-loop.cc @@ -215,22 +215,41 @@ do_for_loop_once (ult, rhs, quit); } + else if (rhs.is_string ()) + { + charMatrix chm_tmp = rhs.char_matrix_value (); + int nr = chm_tmp.rows (); + int steps = chm_tmp.columns (); + + if (error_state) + return; + + if (nr == 1) + DO_LOOP (chm_tmp (0, i)); + else + { + for (int i = 0; i < steps; i++) + { + octave_value val (chm_tmp.extract (0, i, nr-1, i), true); + + bool quit = false; + + do_for_loop_once (ult, val, quit); + + if (quit) + break; + } + } + } else if (rhs.is_matrix_type ()) { - charMatrix chm_tmp; Matrix m_tmp; ComplexMatrix cm_tmp; int nr; int steps; - if (rhs.is_string ()) - { - chm_tmp = rhs.char_matrix_value (); - nr = chm_tmp.rows (); - steps = chm_tmp.columns (); - } - else if (rhs.is_real_matrix ()) + if (rhs.is_real_matrix ()) { m_tmp = rhs.matrix_value (); nr = m_tmp.rows (); @@ -246,26 +265,7 @@ if (error_state) return; - if (rhs.is_string ()) - { - if (nr == 1) - DO_LOOP (chm_tmp (0, i)); - else - { - for (int i = 0; i < steps; i++) - { - octave_value val (chm_tmp.extract (0, i, nr-1, i), true); - - bool quit = false; - - do_for_loop_once (ult, val, quit); - - if (quit) - break; - } - } - } - else if (rhs.is_real_matrix ()) + if (rhs.is_real_matrix ()) { if (nr == 1) DO_LOOP (m_tmp (0, i));