The error is you contact string method.  That method is supposed to return a string value for the object, not say the value.  Since your return statement did not return a value, it fell back to the default behavior of returning "a CONTACT" which is the value getting displayed in the loop.  Here is the corrected method: 

::method string   public                 -- convert the attributes to a string.
  expose name fullName phoneNumber
  trace normal
  return name ~ left(12) fullName ~ left(25) phoneNumber ~ right(12) -- minor change

Rick


On Tue, Jun 3, 2014 at 2:48 AM, J. Leslie Turriff <jlturriff@centurylink.net> wrote:
On Sunday 01 June 2014 14:58:09 you wrote:
> You didn't include any test data, so I wrote a little program that created
> a phone book and stored it and then a second that unloaded it.  Your
> load/unload methods had a number of errors in them that I've corrected so
> this is a working version.
>
> I did not tackle the unknown method issues because I really don't
> understand what you are trying to accomplish.  I suggest forgetting
> whatever you've done with that and first define how you really want this to
> behave and I'll help you to an implementation.  What you are doing now is
> not on the right path.
        Yes, that works okay.  (email mangled your example a bit and I had to rebuild
it, but I finally got it straightened out.) :-)  I also wrote a test program
that incorporates the logic of your load and unload methods.
        So then I added a report method to .PhoneBook to say all of the contacts
(with a minor change to .contact:string), but it writes "a CONTACT" after
every line.  It appears to be coming from .contact:string; how do I get rid
of it?

Leslie

Output:
$PhoneBook5
Name         Full Name                 Phone Number
------------ ------------------------- ------------
MIKE         Mike H.                       555-6123
a CONTACT
ann          Little Anne                   555-1234
a CONTACT
MOLLY        Molly M.                      555-3948
a CONTACT
ANN          Ann B.                        555-6220
a CONTACT
JEFF         Jeff G.                       555-5115
a CONTACT
MARK         Mark C.                       555-5017
a CONTACT
Rick         Rick M.                       555-5110
a CONTACT
Jenny        Jenny Jenny                   555-5309
a CONTACT

Exact match:
Jenny        Jenny Jenny                   555-5309
a CONTACT

--
"Disobedience is the true foundation of liberty. The obedient must be
slaves." --Henry David Thoreau

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users