Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: The joys of bad code

by jdporter (Canon)
on Oct 28, 2004 at 17:47 UTC ( #403463=note: print w/ replies, xml ) Need Help??


in reply to Re^3: The joys of bad code
in thread The joys of bad code

Actually, there's a pretty nifty native way to do this. Probably less efficient than a hash lookup, but more consistent.

Function MyMonthName(ByVal m As Long, Optional ByVal appr As Boolean = + False) As String Dim v v = CDate("2004-" & m & "-01") Dim fmt As String If appr Then fmt = "MMM" Else fmt = "MMMM" End If MyMonthName = Format(v, fmt) End Function


Comment on Re^4: The joys of bad code
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://403463]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2015-07-31 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls