Page 1 of 1

How can I use xHarbour Functions?

PostPosted: Tue Apr 14, 2009 5:39 pm
by dutch
Dear All,

I've found the function of xHarbour in xHarbour\tests folder but I cannot use it with FWH? Why?

I try following code but it shows error function EOM(). What's wrong?
Code: Select all  Expand view
#include 'fivewin.ch'
function main
msginfo( eom( date() ) )
return nil 


xHarbour's Date Function
Code: Select all  Expand view
/*
 * $Id: dates4.prg,v 1.1.1.1 2001/12/21 10:45:42 ronpinkas Exp $
 */


// Testing Harbour dates management.
#include "set.ch"

STATIC s_cNewLine

function main()
   LOCAL i
   LOCAL dDate := date()

   s_cNewLine := HB_OSNewLine()

   set( _SET_DATEFORMAT, "dd/mm/yyyy" )

   for i := 7 to 49 step 7
      CheckDate( dDate )
      dDate += i
   next

return nil

function CheckDate( dDate )
   OutStd( "Testing date:", dDate , s_cNewLine )
   OutStd( "Days in month..:", daysinmonth( dDate ), s_cNewLine )
   OutStd( "Day of year....:", doy( dDate ), s_cNewLine )
   OutStd( "Begin of month.:", bom( dDate ), s_cNewLine )
   OutStd( "End of month...:", eom( dDate ), s_cNewLine )
   OutStd( "Week of month..:", wom( dDate ), s_cNewLine )
   OutStd( "Week of year...:", woy( dDate ), s_cNewLine )
   OutStd( "Begin of year..:", boy( dDate ), s_cNewLine )
   OutStd( "End of year....:", eoy( dDate ), s_cNewLine )
   __Accept( "Press ENTER to continue..." )
   OutStd( chr( 10 ), chr( 10 ) )

return nil


Regards,
Dutch

Re: How can I use xHarbour Functions?

PostPosted: Tue Apr 14, 2009 9:06 pm
by Enrico Maria Giordano
Your sample works just fine here.

EMG

Re: How can I use xHarbour Functions?

PostPosted: Wed Apr 15, 2009 1:12 am
by Antonio Linares
Dutch,

You have to link CT.lib

Re: How can I use xHarbour Functions?

PostPosted: Wed Apr 15, 2009 2:55 pm
by dutch
Dear Antonio & EMG.

I work ok now but
How can I know which lib is used for which function?

Regards,
Dutch

Re: How can I use xHarbour Functions?

PostPosted: Wed Apr 15, 2009 4:13 pm
by Antonio Linares
Dutch,

Sometimes it is as simple as to do a file contents search in the libs folder using a tool like the Total Commander :-)

Re: How can I use xHarbour Functions?

PostPosted: Wed Apr 15, 2009 5:45 pm
by dutch
Thanks Antonio,

I've got it.

Regards,
Dutch