Forum > Beginners
using Units
(1/1)
CharlyTango:
Hi,
I'm just switching from Delphi to fpc/Lazarus and faced some basic obstacles.
One of the annoying things is that i do not find anything about the concept of using units with simple procedures and functions in other units.
Given should be a unit where some tools are collected (e.g. helper funktions ). In Delpi i collected those funktions in a unit where the function definitions were in the const part of the unit and the function bodies were in the implementation part.
How to manage this in fpc/lac?
Tanks in advance
CT.
rvk:
You can do what you described ("i collected those funktions in a unit where the function definitions were in the const part of the unit and the function bodies were in the implementation part") the EXACT same way as you did in Delphi. (Only the const-part you referring to is called the interface-part.)
(see http://wiki.freepascal.org/Unit)
Where are you getting stuck?
Thaddy:
Yup. FPC is hugely compatible with Delphi upto and including D2009 and higher provided in $mode delphi/delphiunicode.
Where are you stuck? Normally it just works...
CharlyTango:
Thanks a lot!
The crucial hint was to declare the functions in the interface part of the unit.
Case closed.
Thank you
Navigation
[0] Message Index