Ntocdow(nday)

Ntocdow(nday)

Postby Silvio » Thu Nov 26, 2009 4:35 pm

on xharbour guide I saw there is a function converts a numeric week day to its name

NtoCDoW( <nDayOfWeek> ) --> cDayName


But with fwh not run ok

How I can converte this function in fwh ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Ntocdow(nday)

Postby ukoenig » Thu Nov 26, 2009 6:57 pm

Helo Silvio,

You can use :

MsgAlert( CDOW(DATE()) )

Returns the Day as String.

Best Regards
Uwe :lol:
Last edited by ukoenig on Thu Nov 26, 2009 8:11 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Ntocdow(nday)

Postby Silvio » Thu Nov 26, 2009 7:23 pm

UWE
before to write READ the real question !!!!!!!!!!!!

I not have a DATE() but I have a number 1,2,3,4,5,6.7
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Ntocdow(nday)

Postby mmercado » Thu Nov 26, 2009 7:34 pm

Hi Silvio:
Silvio wrote:on xharbour guide I saw there is a function converts a numeric week day to its name
NtoCDoW( <nDayOfWeek> ) --> cDayName

Are you tired ? :D

It took me 10 minutes doing the function:
Code: Select all  Expand view
Function NtoCDoW( nNumber )

   Local nEle, nDay, dDate

   If aNames == Nil // aNames could be a static variable to avoid being calculated every call
      aNames := Array( 7 )
      dDate := Date()

      For nEle := 1 To 7
         nDay := Dow( dDate )
         aNames[ nDay ] := cDoW( dDate ++ )
      Next
   EndIf

Return aNames[ nNumber ]

Best regards.
manuelmercado at prodigy dot net dot mx
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Re: Ntocdow(nday)

Postby Silvio » Fri Nov 27, 2009 9:25 am

Dear Manuel ,
No I am not tired, but I thinked there was a function to return that value!!!!!!!!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Ntocdow(nday)

Postby StefanHaupt » Fri Nov 27, 2009 10:14 am

Silvio wrote:on xharbour guide I saw there is a function converts a numeric week day to its name

NtoCDoW( <nDayOfWeek> ) --> cDayName


Silvio,

this function is in ct.lib and is working as exspected.

Take care, that the week starts with sunday !
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 66 guests