PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/test-suite/octave/director_string_runme.m

#
MATLAB | 27 lines | 18 code | 9 blank | 0 comment | 2 complexity | 253061c50e9f69d1d7f90b0bf7c64b21 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. director_string
  2. function out=get_first(self)
  3. out = strcat(self.A.get_first()," world!");
  4. end
  5. function process_text(self,string)
  6. self.A.process_text(string);
  7. self.smem = "hello";
  8. end
  9. B=@(string) subclass(A(string),'get_first',@get_first,'process_text',@process_text);
  10. b = B("hello");
  11. b.get(0);
  12. if (!strcmp(b.get_first(),"hello world!"))
  13. error(b.get_first())
  14. endif
  15. b.call_process_func();
  16. if (!strcmp(b.smem,"hello"))
  17. error(b.smem)
  18. endif