I agree, those VBA samples could be quite useful.
Another thing that could make the Format$() function better is if it actual
would return the number of decimals that you ask for.
Check these examples:
Print Format$(123.2345, "#.###")
Returns correctly 123.234
Print Format$(123.23, "#.###")
Returns 123.23, should return 123.230
Print Format$(2, "##")
Returns 2, should return 02
Just my 2 cents,
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
COWI har fået ny hjemmeside. Ydelserne GIS og IT, kort, kortlægning, 3D
visualisering og arealforvaltning ligger under SAMFUND. Se mere her :
www.cowi.dk
COWI has changed its homepage. Our services within cadastre and
landadministration, geodataproducts, mapping and GIS can be seen under SOCIETY.
See our services here: www.cowi.com
-----Original Message-----
From: Lorne [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 28, 2005 1:18 PM
To: 'MapInfo-L (E-mail)'
Subject: RE: MI-L date fields in labels
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
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 17287