SoFunction
Updated on 2025-04-12

Example explanation of the custom subroutine in the middle of the text with easy language

Let's look at the code first:

Version 2

.Subprogram Take the middle content of the text, Text type
.parameter Full content, Text type
.parameter Text on the left, Text type
.parameter Text on the right, Text type
.Local variables Temporary location, Integer type
.Local variables Total length, Integer type
.Local variables Return result, Text type

Total length = Take text length (full content)

Temporary position = Find text (full content, left text, , false) + Take text length (left text)

Return result = Take the middle of the text (full content, temporary position, total length)

Total length = Take text length (return result)

Temporary position = Search for text (return result, right text, , false) - 1

Return result = Take the middle of the text (return result, 1, temporary position)

Return (return result)

You can test locally, thank you for your support.