The UnmidStr function returns an enlarged string with some memory contents if it is called with a too large value for pos. I think it would make sense in this case not to change the string.
Code: Select all
Function p_PrintHex(st$)
Debugstr$=""
For i=0 To StrLen(st$, #ENCODING_RAW)-1
Debugstr$=Debugstr$ .. MidStr((HexStr(ByteAsc(st$, i))),1).." "
Next
DebugPrint(Debugstr$)
EndFunction
t1$="abc"
p_PrintHex(t1$)
t2$=UnmidStr(t1$, 50, 1)
p_PrintHex(t2$)
DebugPrint(StrLen(t2$))