I am trying to use the .Object setMethod() on a stem in order to dump the
content of the stem in a certain format. Any help is appreciated.
This is what I tried:

------------------
  recs.1 = 'aaa'
  recs.2 = 'bbb'
  recs.~setMethod('dump', .methods~dumpCollection)
  say recs.~dump
exit

/**
 * floating method
 */
::method dumpCollection
  mb=.MutableBuffer~new;
  loop i over self~allindexes~sort;
      if i = 'DUMP' then
          iterate;
      mb~append(self~class~id'['i']:'self[i]||.Endofline);
  end;

  return mb~string
-------------------------

and this is what I get:
     5 *-* recs.~setMethod('dump', .methods~dumpCollection)
Error 97 running C:\Keita\REXX\sandbox\testSetMethod.rex line 5:  Object
method
not found
Error 97.1:  Object "RECS." does not understand message "SETMETHOD"

However, replacing the stem by a .Directory does work fine.

Cheers,
Madou
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to