Different versions of Delphi (in my case 2007, XE and XE2) seem to use the same code template repository, for example ..\Documents\RAD Studio\code_templates
. Since XE2 uses units with names, this causes problems when you need to use the unit name in the template.
For example, I have a template when I write winbeep
that ends on windows.Beep(300, 100);
, and selects and stops at a frequency, etc. This does not compile on XE2 unless I remove the Winapi.
part Winapi.
block of Windows
in the uses clause (or, of course, add the prefix manually). I must have a unit name, because otherwise SysUtils.Beep
will be passed.
I could not find the parameter entry or registry key or environment variable that determined the location of the templates. It is not even associated with BDSUSERDIR
, in fact I donβt even have a directory on my computer with the path BDSUSERDIR
(which is ..\Documents\RAD Studio\9.0
). Is this my supervision and is it really possible to move code templates? If not, is it possible to use IDE aliases in the use section for new forms?
change
It says here that (highlighting by me) βThe templates you create (and templates provided by third-party add-ins) are saved by default in the \ My Documents \ RAD Studio \ code templates \ directory." This implies that there should be a way to save them in a place other than default. But the article does not mention how.
source share