AtanaSuite Connect - Tips

SurroundsWith Snippet Example

By: | Posted on: | Category:

Here is the XML code for a sample SurroundsWith snippet. In this example, the SUBSTRING SQL function will be inserted around the selected text in the SQL editor window prompting the user for first character index and number of characters.

NOTE - This sample is also included in the example snippet.xml file that is created in the users snippets folder upon first use of snippets within AtanaSuite.

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="">
    <CodeSnippet Format="1.0.0">
            <Description>Extracts a portion of a string.</Description>
                <SnippetType>SurroundsWith</SnippetType><!-- Expansion inserts new text at the caret; SurroundsWith places new text before and after the selection -->
                    <ToolTip>The index of the first character to return.</ToolTip>
                    <ToolTip>The number of characters to return.</ToolTip>
                The following tokens can be used in the Code element below:
                    $literal ID$ - The ID of a literal defined in the Declarations section above.
                                   If a literal is referenced multiple times, the first instance
                                   is editable and the value will be applied to all locations.
                    $selected$ - The selected text in the editor at the time a SurroundsWith snippet was inserted.
                    $end$ - The location for the caret after completion.
            <Code Language="sql">
<![CDATA[SUBSTRING($selected$, $start$, $length$)$end$]]>
© 2002 - 2021 Atanasoft LLC. All rights reserved.