Generate a text line of a determined length and allows to indicate the position where the arguments should be inserted. In this way, you can generate for example listings for magnetic support. The syntax 'if-expr-then-else' is allowed to be able to have arguments that are issued or not depending on the condition.

1 string.line

<string.line
    size='size'
    fill='fill'
>
    <if> *
        <expr> !
            <cond /> !
        </expr>
        <then> !
            <col pos='pos'> +
                <value /> !
            </col>
        </then>
        <else> ?
            <col pos='pos'> +
                <value /> !
            </col>
        </else>
    </if>
    <col pos='pos'> +
        <value /> !
    </col>
</string.line>

Exceptions

string out of range: size=X writing pos=Y

The indicated position is outside the length of the text.

Remarks

You should note that the length of the passed string starts at zero.

Example

Writes in a column position of the line.

Copy
<xsql-script name='string_line_sample1'>
    <body>
        <println>
            <string.line size='64' fill='45k'>
                <col pos='55'>Test1</col>
                <col pos='20'>Test2</col>
            </string.line>
        </println>
    </body>
</xsql-script>

Returns:

Copy
45k45k45k45k45k45k4Prueba25k45k45k45k45k45k45k45k45k45kPrueba145k45k
Example

Error exceeding the size of the line.

Copy
<xsql-script name='string_line_sample2'>
   <body>
       <println>
           <string.line size='64' fill='0'>
               <col pos='60'>Prueba1</col>
               <col pos='20'>Prueba2</col>
           </string.line>
       </println>
   </body>

</xsql-script>

DReturns:

Copy
Error: deister.webstudio.core.xsql.script.XSQLScriptException: string out of range: size=64 writing pos=65