Jump to content

include code


jahlxx

Recommended Posts

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.
 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...