I am porting my application to delphi 2009. My application should still use a lot of AnsiString. during migration, I always convert:
abc := def;
in
abc := string(def);
or
abc := TDeviceAnsiString(def);
I know that I should be able to do this with templates, but I find the templates - albeit powerful ones - not so easy to work with. here is what i tried:
<?xml version="1.0" encoding="utf-8" ?>
<codetemplate xmlns="http://schemas.borland.com/Delphi/2005/codetemplates"
version="1.0.0">
<template name="das" invoke="auto">
<point name="expr">
<script language="Delphi">
InvokeCodeCompletion;
</script>
<hint>
MP: TDeviceAnsiString
</hint>
<text>
True
</text>
</point>
<description>
MP: TDeviceAnsiString
</description>
<author>
Mike
</author>
<code language="Delphi" context="any" delimiter="|"><![CDATA[TDeviceAnsiString(|selected|)|end|]]>
</code>
</template>
</codetemplate>
it does not appear in the Surround menu, and it does not activate when I want. I would like to be able
abc := **das***[tab]*def;
or select "def" and use "surround" to get:
abc := TDeviceAnsiString(def);
Thank you for your help!
X ray source
share