[Gambas-user] Text-Wrapping

Bruce adamnt42 at gmail.com
Wed Nov 11 19:32:32 CET 2020


On 12/11/20 2:31 am, Gianluigi wrote:
> Hi guys,
> 
> I had understood, obviously badly as I usually do, that each line of text
> should contain the maximum possible number of characters indicated (with
> the number), that hyphenation was not needed and that if a word was
> truncated it should end with a hyphen.
> 
> *Attention* the code attached by me must not be used as it is certified "a
> real crap", but rest assured that soon you will have the opportunity to
> take advantage of the Bruce's perfect code (the one with a lowercase
> letter) ;-D
> 
> Regards
> Gianluigi
> 
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

Unfortunately, my "perfext code is in python and consists of a single 
call to textwrap.wrap() See here for more info 
https://docs.python.org/3/library/textwrap.html#textwrap.wrap

I was merely trying to point out that it isn't as simple as it looks.

>> I had understood, obviously badly as I usually do, that each line of text
>> should contain the maximum possible number of characters indicated (with
That is a fair and alternate interpretation of the question and one I 
should have put in my original post!

Perhaps having a look at how the IDE wraps code might be an idea? It 
seems to do quite well with (silly) things like:
   Dim MyName As String = "Mr. Michael Sean O'Reilly-Dogherty III (Jnr)"

cheers
b


More information about the User mailing list