FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Ntocdow(nday)
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Ntocdow(nday)
Posted: Thu Nov 26, 2009 04: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Ntocdow(nday)
Posted: Thu Nov 26, 2009 06:57 PM

Helo Silvio,

You can use :

MsgAlert( CDOW(DATE()) )

Returns the Day as String.

Best Regards
Uwe :lol:

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.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Ntocdow(nday)
Posted: Thu Nov 26, 2009 07: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
Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
Re: Ntocdow(nday)
Posted: Thu Nov 26, 2009 07: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 ? :-)

It took me 10 minutes doing the function:
Code (fw): Select all Collapse
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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: Ntocdow(nday)
Posted: Fri Nov 27, 2009 09: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
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Ntocdow(nday)
Posted: 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

Continue the discussion