fork download
  1. {$mode objfpc}
  2. {$modeswitch typehelpers}
  3.  
  4. type
  5. TRoosters = (GoldenRooster, Junglefowl, FightingCock, Fjalarr, Gullinkambi, GallicRooster, You);
  6.  
  7. TRoostersHelper = type helper for TRoosters
  8. public
  9. function toString: string;
  10. end;
  11.  
  12. function TRoostersHelper.toString: string;
  13. begin
  14. WriteStr(Result, self)
  15. end;
  16.  
  17. begin
  18. Writeln(FightingCock.toString)
  19. end.
  20.  
Success #stdin #stdout 0s 336KB
stdin
Standard input is empty
stdout
FightingCock