tonni
tonni

Reputation: 1255

Can xml get clipboard text?

I need get clipboard text in variable in xml, is there any function that connect to clipboard and use those values, is it possible to do that?

Reason why i want to do that is to help me programming faster in delphi (or c++ builder) and xml acts just template.

Here is example

<?xml version="1.0" encoding="utf-8" ?>

<codetemplate   xmlns="http://schemas.borland.com/Delphi/2005/codetemplates"
                version="1.0.0">
    <template name="if" surround="true" invoke="auto">
        <point name="expr">
            <script language="C">
                invoke_code_completion();
            </script>
            <hint>
                conditional expression
            </hint>
            <text>
                true
            </text>
        </point>
        <description>
            if statement
        </description>
        <author>
            Embarcadero
        </author>
        <code language="C" context="methodbody"><![CDATA[if ($expr$) {
$selected$$*$$end$
}
]]>
        </code>
    </template>
</codetemplate>

this will produce if (true) { } with focus on true, what i need is tu use instead word true some clipboard text.

Upvotes: 0

Views: 346

Answers (1)

Quentin
Quentin

Reputation: 943562

XML is a data format. It can't "do" anything and doesn't have variables.

Update based on revised question:

A code template appears to be a piece of code (in some programming language) that appears as data in an XML document that includes metadata about it (presumably so that it can be stored and searched for in a code library).

The XML seems to be irrelevant to the problem. You would write code that would access the clipboard in the <code> element in whatever language you wanted using the usual APIs.

Upvotes: 1

Related Questions