jahlxx Posted April 9, 2018 Share Posted April 9, 2018 Hi.. Someone knows how to include a piece of code in a delphi unit? I have some pieces of code, and must repeat in every unit. Can I have that code in a external file and include in the units I need? I have read about the {$I} directive, but raises compilation error. Thanks. Quote Link to comment Share on other sites More sharing options...
Ron Posted April 9, 2018 Share Posted April 9, 2018 Sure, just choose File->New->Unit - Delphi, and you will get a blank text-only unit file without a form. Give it a name and paste the code there, and then refer to that unit in the uses clause of other units, and you have access. 1 Quote Link to comment Share on other sites More sharing options...
jahlxx Posted April 10, 2018 Author Share Posted April 10, 2018 Ok. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.