[fpc-pascal] Best method for code reuse?

Richard Ward roward at mac.com
Sun Apr 5 06:15:56 CEST 2009

Francisco Reyes writes :  (snipped)

 >>The sample code in the ref document doesn't document the simplest  
case, but goes over what I think is a more complex example of a unit  
that uses another unit.
It also doesn't have any actual code to do anything, so it is kind of  
an abstract example . I was looking on the other docs to see if there  
were any examples, but did not find any.

---  I see some people have answered and provided one or more  
examples.   If you need more, I have several demo programs I have used  
in my own learning of FPC which you are welcome to.   If interested,  
email me privately.   Also, it took me a while to find out how to get  
at the example sources for the code snippets included in the various  
manual.   If you need these, I can try to save you some time searching  
there as well.

 >>For starters I don't really follow the diagrams in the ref  
document. It probably is some type of formal definition, but I am  
neither familiar with it, nor seem to get it. Even when I look at a  
simpler case like procedure declaration I can't follow those blocks.

---  I personally have never been able to grasp syntax diagrams too  
well on first (or second+ glance) either and like to look at examples  
and go back and forth till I understand it or think I do.   Examples  
are good and my vote is for more examples but they do make the manuals  
a lot lengthier which might be better served by tutorials.   And yes,  
I have found it hard to find good tutorials due to broken links and  
what not, and like you mention, looking for Delphi information can  
yield good results.

 >>I am finding many contributed units with broken links to both the  
code and the homepage URL.

 >>A few thoughts. We could clean all entries to which both the code  
and the refering URL are broken. We could email the author and give  
them a week or two, but if we get no replies then we should remove the  

---  This is a good idea.   I would go further and suggest that some  
of the wiki pages be reorganized to make them easier to navigate and  
find things.   Since FPC is a community effort, that means that  
someone has to take the time and do it and it usually comes down to  
the "someone" being the one who suggests it.  Pointing a finger at  
myself in this case :)

--- _If_ you have access to a Macintosh, I would suggest downloading  
and trying out Ingemar's Lightweight IDE.   This IDE is VERY easy to  
use and hides a lot of complexity which is especially useful for  
newbie's .  You can concentrate on learning syntax and trying out  
Pascal code immediately rather than having to initially wade through  
linking peculiarities, makefiles and command line stuff ... unless you  
like or need them for whatever reason.  - ROW

More information about the fpc-pascal mailing list