Word wrapping and hyphenation for (long) labels

307 views
Skip to first unread message

Jenske

unread,
Oct 6, 2010, 8:13:31 AM10/6/10
to MapInfo-L
Suppose I want to have a field with 200 character width represented as
a label on a map.
Suppose I want the label to be word-wrapped at, say, 72 characters.

Can Mapinfo 9.5 do this?

If not, is there a (simple?) word-wrapping function I could enter as
an expression for labelling?

Bill Thoen

unread,
Oct 6, 2010, 9:40:56 AM10/6/10
to mapi...@googlegroups.com

There is no function to do this in MapInfo and I don't think there's a
workaround, short of writing a mapbasic program and displaying your
layer's labels with that.


--
*Bill Thoen*
GISnet - www.gisnet.com
303-786-9961

Thomas Bacon

unread,
Oct 6, 2010, 9:42:30 AM10/6/10
to mapi...@googlegroups.com
Hi Jenske,

Something like this should work:

Left$(YOURFIELD, InStr(72, YOURFIELD, " "))+ Chr$(13) + Mid$(YOURFIELD,
InStr(72, YOURFIELD, " ")+1, InStr(144, YOURFIELD, " ")-InStr(72,
YOURFIELD, " ")) + Chr$(13) + Mid$(YOURFIELD, InStr(144, YOURFIELD, "
")+1, 56)

A bit complex maybe for what you're looking for, but it should do the
trick!

HTH,

Tom

--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en


The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. Mouchel Limited, Registered in England at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX Registered No : 1686040

Jenske

unread,
Oct 8, 2010, 7:22:17 AM10/8/10
to MapInfo-L
Thanks for these suggestions.

Thomas, your suggestion is very valuable, and probably the only
option.

Problem is that it is not possible to have a "while ... do ... "- loop
as a function in MI, as this would enable the word-wrapping routine to
be applied to text of any length.

It's a pity, though, that, unlike left$, mid$ etcetera, no similar
function is available in MI to just word-wrap a string to a certain
maximum number of characters. Something like

wordwrap(text, 72)

would be very handy.

Thanks anyway.



On 6 okt, 15:42, "Thomas Bacon" <Thomas.Ba...@mouchel.com> wrote:
> HiJenske,
> archives, feature requests, to visit our Wiki, visit the Welcome page athttp://groups.google.com/group/mapinfo-l?hl=en
Reply all
Reply to author
Forward
0 new messages