Try this neat little label expression

Left$(CLASSIFICATION, (Int(CLASSIFICATION = "mja") * Len(CLASSIFICATION)))

This could also be used to label the roads with the road name if the
classification is "mja":
Left$(ROADNAME, (Int(CLASSIFICATION = "mja") * Len(ROADNAME)))

The trick is that Int() returns the integer value of the expression in side
the parensis. So here you enter a true/false expression.
If the expression is true the Int() will return 1 else it returns 0. The
value returned is used to decide whether the entire label value should be
returned or no string at all. The Left$() function returns n chars starting
from left.

Only your imagination - and MapInfo max length of label expressions - sets
the limit for whats possible.

Here is a neat example I'm using in a special application:
Left$(MARKNR, Len(MARKNR) * Int(MARKNR <> "HJÆLPEOBJEKT")) + Chr$(10) +
Left$(MAALEMETODE, Len(MAALEMETODE) * Int(InStr(1, UCase$(MARKNR),
"FRADRAG") = 0 and MARKNR <> "HJÆLPEOBJEKT" and InStr(1, UCase$(MARKNR),
"**")=0))

Does it make any sence ? ;-)

Peter Horsbøll Møller
GIS Developer
Geographical Information & IT
 
COWI A/S
Rugårdsvej 55
DK-5000 Odense
Denmark
 
Tel     +45 6313 5013
Direct  +45 6313 5008
Mob     +45 5156 1045
Fax     +45 6313 5090
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk


> -----Original Message-----
> From: Michael Smith [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 17, 2003 7:01 PM
> To: MapInfo-L
> Subject: MI-L Labeling
> 
> 
> Is there a way to label in MapInfo 7.0 using some type of if, 
> then (if attribute field equals certain value then label).  
> What I need to do seems simple but I just can't seem to figure it out.
> 
> I have a streets centerline file with an attribute field 
> classifing the type of roadway each segment is.  In this 
> attribute field, I have 4 classifications of data (mja, mna, 
> mjc, mnc).  If I want to label only streets with attribute 
> data of mja and not label the other streets segments how can 
> I do this?
> 
> Thanks in advance.
> 
> Michael Smith, Planner II
> City of San Angelo
> Planning & Development
> 325.657.4210 Fax: 325.481.2648
> Email: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | 
> www.directionsmag.com | To unsubscribe, e-mail: 
> [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
> Message number: 9174
> 
> 

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 9176

Reply via email to