Jump to content

Recommended Posts

Posted

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.
 

Posted

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.

  • Upvote 1

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...