BaBernd
5th January 2018, 10:40
Hello to All,

I have a string field of length 12. But I only need the first 4 characters and afterwards the 5.th character. How can I extract this number signs also as string out of the given string.
I've tried with sprintf$() function, but the manual description is not fully clear for me.
With the following code I can extract the first 4 characters:
main.leac = trim$(sprintf$("%4.4s", tfgld106.leac))

But to extract the only 5.th character I found nothing for sprintf$().

Best Regards
Bernd

Juergen
5th January 2018, 11:17
Hello Bernd,

should be simple.

First 4 characters
main.leac = tfgld106.leac(1;4)
Only the 5.th character
main.leac = tfgld106.leac(5;1)

Regards,
Juergen

BaBernd
5th January 2018, 11:38
Hello Juergen,

Thanks a lot. It's just so simple :eek:

Best Regards
Bernd