Freeeee 0 Posted Saturday at 08:20 PM 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
Anders Melander 2051 Posted Saturday at 09:00 PM The functionality you describe is provided by units in Delphi. Please read: https://docwiki.embarcadero.com/RADStudio/Sydney/en/Programs_and_Units_(Delphi) While Delphi does support include files (.INC) you generally only use them for declaring symbols or constant values used as feature switches or, in rare cases, for cross platform support. Share this post Link to post
Freeeee 0 Posted yesterday at 03:39 AM 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
Christophe E. 15 Posted 22 hours ago 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
Anders Melander 2051 Posted 9 hours ago 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
Freeeee 0 Posted 8 hours ago 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
Freeeee 0 Posted 8 hours ago 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
Anders Melander 2051 Posted 7 hours ago 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