>>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)