Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does CMonth() function is sensitive to something??
Message
De
08/09/2002 18:37:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
07/09/2002 21:49:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00697978
Message ID:
00698087
Vues:
15
>>In the IDE CMONTH() uses the language of your VFP version installed.
>>In a compiled EXE it uses the language of the VFP runtime.
>
>hmmm... that was what I suspected... that function is useless for Portuguese-speakers.
>
>Thanks, Armin.

And, even if you had a Portuguese version, you can't be sure that all developers, or all users, use the runtime. Therefore, I find it safer to write my own function. I am sure you, personally, can do this, but for anybody who is watching, I'll include the outline of how this is done (this question is asked quite frequently).

Note that the function accepts both a month, as a number, and any date, to extract its month.

Hilmar.
FUNCTION MyMonthName(tnMonth)
if type("tnMonth") = date()
  tnMonth = month(tnMonth)
endif
do case
case tnMonth = 1
  return "January"
case tnMonth = 2
  return "February"
...
case tnMonth = 12
  return "December"
otherwise
  return "Error calculating month"
endcase
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform