view examples/celldemo.cc @ 14293:71a198cca35b

improve parsing of classdef methods * oct-parse.yy (fcn_name): also set lexer_flags.parsed_function_name.top() to true when recognizing classdef set.PROPERTY or get.PROPERTY methods. (parse_fcn_file): Also set reading_script_file to true when reading classdef files.
author John W. Eaton <jwe@octave.org>
date Mon, 30 Jan 2012 23:06:01 -0500
parents db1f49eaba6b
children be41c30bcb44
line wrap: on
line source

#include <octave/oct.h>
#include <octave/Cell.h>

DEFUN_DLD (celldemo, args, , "Cell Demo")
{
  octave_value_list retval;
  int nargin = args.length ();

  if (nargin != 1)
    print_usage ();
  else
    {
      Cell c = args (0).cell_value ();
      if (! error_state)
        for (octave_idx_type i = 0; i < c.nelem (); i++)
          retval(i) = c.elem (i);
    }

  return retval;
}