writeln an object

gedaiu szabobogdan at yahoo.com
Thu Apr 18 10:56:58 PDT 2013


On Thursday, 18 April 2013 at 17:42:53 UTC, JN wrote:
> On Thursday, 18 April 2013 at 17:36:10 UTC, gedaiu wrote:
>> Hi,
>>
>> how i can control what writeln outputs when I pass an object 
>> parameter?
>>
>> Thanks,
>> Bogdan
>
> You can override the toString() method, like this 
> http://dpaste.dzfl.pl/db7dbe28

i've done that but i get this error:

Error: function base.Value.Value.toString cannot override a 
non-virtual function
Error: function base.Value.Value.toString override only applies 
to class member functions


More information about the Digitalmars-d-learn mailing list