Nefarious wrote:
Ive spent about 5 hours trying to make a stretchy text box using TEXT2 but simply cannot do it ...
Are there any GS staff here that can shed some light on this situation?
I'm not familiar with richtext as I still use V81.
The stretchy box shouldn't be a problem but stretchy text is.
You will need the object to read through your text breaking it down into individual words using "STRSTR" to find the position of the spaces.
"SUBSTR" can be used to isolate just that word and "STW" used to find the length of that word.
This can then be cummulative for each subsequent word then when the length exceeds that of your stretchy box you have your first line of text.
I haven't actually tried this - just thoughts off the top of my head - but it's a starting point.
I've seen this done by counting the number of characters in text and having a max number of characters per line rather than the length but I guess it could be possible.
In fact there is a string wrapping routine for this in DNC's GDL Cookbook.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11