Jump to content
Freeeee

Freeeee

Recommended Posts

 

I have looked at the Docs on embarcadero.com/Libraries .

 

In earlier versions of Turbo Pascal  there were functions and/or procedures we could write in a generalized form

and then save them as Dot INC files .  They could then be used in future programs without cutting or pasting

sometimes with a forward reference but  it would be named ...example " MakeDate.INC" 

You could include it in a new file without retyping it simply by putting    'MakeDat.INC"    in the procedures section of new code.

If it were in a separate folder you'd provide a path for the compiler.

Does anything like that now exist in 12.  ?

 

 

 

Share this post


Link to post

thanks for the answer but Unit do not provide the same funcionality

Units are stand alone and will compile and execute.  

and  require USES to tie units together.

 

An Include file was a piece of isolated code that could not be compiled on it's own.

It did 'some thing'  useful.

after working in Turbo pascal for several years you'd have a whole set of useful

include files.  Really nice for defining records too or as you mentioned for constants.

So the answer is NO there are no dot-inc files for Delphi 12.  Correct?

 

Share this post


Link to post

If I understand your question correctly, I would say that this has always existed.

 

You can incorporate pieces of code with {$I filename} , even an entire unit, such as when you want to have code for VCL and Firemonkey.

 

// here the FMX unit

{$I Delphi_Versions.inc}
{$DEFINE UseFMX}
unit FMX.your_unit;

interface

uses
 System.SysUtils, System.Types,  System.Classes;

 {$I your_unit.pas}
// herer VCL unit
{$I Delphi_Versions.inc}
{$IFNDEF UseFMX}
{$DEFINE UseVCL}
unit your_unit;

interface

uses
  SysUtils,Classes;
 
{$ENDIF}


implementation

 // your code for VCL and FMX

end.

 

Share this post


Link to post
15 hours ago, Freeeee said:

An Include file was a piece of isolated code that could not be compiled on it's own.

It did 'some thing'  useful.

after working in Turbo pascal for several years you'd have a whole set of useful

include files.  Really nice for defining records too or as you mentioned for constants.

Yes, that's what you would use units for if you programmed in Delphi - but of course you can pretend that it's still 1985 and continue using include files, if you prefer that.

Share this post


Link to post

Thanks for your reply.  And sarcasm.  

  

I found dot INC files very useful and wondered if they had been preserved.

They have not.  

I think they would still be useful.   

but I can do without them.  cutting and pasting works too.  just a bit tedious.

 

Apparently the  memory size of an "Ap" is no longer a problem.  

 

And it's perfectly acceptable to include all sorts of code in an Ap that the Ap never uses.

After all the IDE automatically includes: 

Winapi. Windows, Winapi.Messages, System.SysUtils,  System.Variants,

System.Classes, Vcl.Graphics,,  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
Just to start a new VCL project.

 

 

 

     

 

 

 

 

Share this post


Link to post

Thanks Christopher 

Just to make sure you get this I'm using the reply to quote.

the URLto Delphi Basics  was REALLY helpful.

Thanks again.    

 

Share this post


Link to post
31 minutes ago, Freeeee said:

I found dot INC files very useful and wondered if they had been preserved.

They have not.  

I think they would still be useful.   

but I can do without them.  cutting and pasting works too.  just a bit tedious.

 

Apparently the  memory size of an "Ap" is no longer a problem.

Include files works just the same in Delphi as they did in TP. It's just that we don't use them as you describe anymore. Not because it isn't possible but because there are better ways of doing things now.

 

47 minutes ago, Freeeee said:

Apparently the  memory size of an "Ap" is no longer a problem.  

Memory size?

Do you think an application uses more memory because it uses units instead of include files? Well, it doesn't. And, if anything, using units will generally produce smaller exe files compared to include files.

 

39 minutes ago, Freeeee said:

And it's perfectly acceptable to include all sorts of code in an Ap that the Ap never uses.

After all the IDE automatically includes: 

Winapi. Windows, Winapi.Messages, System.SysUtils,  System.Variants,

System.Classes, Vcl.Graphics,,  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
Just to start a new VCL project.

You really should read the documentation I linked to - and more. So far most of what you have written are caused by not understanding the basics of Delphi.

Share this post


Link to post

INC files are still in use. Some of the programs I purchased use them.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×