5
我正在将我的应用程序迁移到德尔福2009年。我的应用程序仍然必须使用很多AnsiString。在迁移过程中,我发现自己总是转换:我如何制作一个“环绕”类型的Delphi模板?
abc := def;
到:
abc := string(def);
或
abc := TDeviceAnsiString(def);
我知道我应该能够使用模板来做到这一点,但我觉得templates--虽然功能强大 - 不容易工作。这是我一直在尝试:
<?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>
它不会出现在环绕声菜单,它不会激活,只要我想要。我希望能够
abc := **das***[tab]*def;
或选择“高清”和使用“环绕声”中获得:
abc := TDeviceAnsiString(def);
感谢您的帮助!
谢谢弗朗索瓦!它完美地工作。也谢谢你的链接! – 2008-10-29 20:22:30