PUB substr (strAddr, start, count) | i
{{ returns part of a string for count bytes starting from start byte. }}
bytefill(@ostr, 0, STR_MAX_LENGTH)
i~
IF (count < 0) ' if value is negative, go to the end of the string
count := STR_MAX_LENGTH - start
bytemove(@ostr, strAddr + start, count) ' just move the selected section
return @ostr