With Morfik Helper Methods you can add new functionality even to primitive types of the language such as integers, strings and booleans. The following code snippet is a short Helper Method written in Morfik Pascal.
function Boolean.ToString: string;
begin
if Self then
Result := 'True'
else
Result := 'False';
end;
The same methods could be written in Morfik Basic as shown in the following code snippet.
function Boolean.ToString as string
if Me then
Return "True"
else
Return "False"
end if
end function
This topic is a bit too extensive to go into all the detail in a regular post, so I decided to make available for download a PDF version of longer article called Understanding and Using Helper Methods.
The information contained in this article is part of the material I have been putting together for the new book I am currently writing.

0 comments:
Post a Comment