Dates seem to cause a lot of labeling difficulties since each person prefers
to display the same information differently. In fact, your supervisor or
client may want a specific display. One is forced to employ the Left$, Mid$
and Right$ functions on long strings in order to obtain different date
representions. These strings can consume considerable label window space
and may limit the addition of other table field names in the label. In
turn, this can force one to keep column names short (and non-meaningful) in
order to handle long label strings.
example (others may have better ways of doing this):
"#"+StormNumber+"
"+StormName+Chr$(13)+Mid$("JanFebMarAprMayJunJulAugSepOctNovDec",Month(Date)
*3-2, 3)+" "+Day(Date)+", "+Year(Date)+Chr$(13)+Format$(Hour_UTC,"00")+"
UTC"+Chr$(13)+MaxWind_kts+" knots"
#4 Danielle
Aug 18, 2004
06 UTC
65 knots
A greatly expanded Format$ function along the line of that provided in VB or
VBA would resolve this. One could then format a number or date in any way
the user wanted.
VBA Examples:
Format$(Dt, "mmm dd, yyyy") ' Jan 23, 2001 (Windows language specific)
Format$(Dt, "mmmm dd, yyyy") ' January 23, 2001 (Windows language specific)
Format$(Dt, "mm.dd.yyyy") ' 01.23.2001
Format$(Dt, "dd/mm/yy") ' 23/01/01
etc.
The Format function might even be reworked to provide for strings like:
1st June 2005 as was requested by someone a few weeks ago.
Would others see this as a valuable addition to Mapbasic?
Perhaps it is something that MI would consider if they received enough
requests.
Lorne
-----Original Message-----
From: Cummings, Mike [ <mailto:[EMAIL PROTECTED]>
mailto:[EMAIL PROTECTED]
Sent: July 27, 2005 2:14 PM
To: MapInfo-L (E-mail)
Subject: MI-L date fields in labels
Is there an easy way to change the format of date fields in labels? (i.e.
change from 20040416 to 04/16/2004)
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 17270