FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse with Ads
Posts: 65
Joined: Fri Feb 13, 2009 12:03 PM
Xbrowse with Ads
Posted: Wed Mar 25, 2009 03:17 AM

Hi All,

I created xbrowse with database created with ADS 8.5, However, the dates in xBrowse display as @d and not the actual date e.g. 01/01/1001. I tried using DBFCDX and date displays perfectly. Could somebody explain to me why the dates using ADS table does not display correctly in xbrowse, and how to solve this problem?

Thanks,

ryugarai

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse with Ads
Posted: Wed Mar 25, 2009 06:52 AM

It should display dates correctly with ADS also. I have used on ADS 8.1
Can we see a very small table structure and sample code ?

Regards



G. N. Rao.

Hyderabad, India
Posts: 65
Joined: Fri Feb 13, 2009 12:03 PM
Re: Xbrowse with Ads
Posted: Thu Mar 26, 2009 04:02 AM

Hi Nageswararao,

This is my declaration of xbrowse:

  REDEFINE XBROWSE oHXBrow OF oBrowDlg ID 1004 FONT oBrowFont UPDATE;  // browse for transact
                             Alias cAlias_TRANSDB AUTOSORT;
                             FASTEDIT

                          WITH OBJECT oHXBrow

                             :nRowHeight       := oBrowFont:nHeight + 12

                          END

fieldname is 'podate', declared in Ads 8.5 as:

         Data Type                                     :   date
         Index                                            :   no
         Minimum Value
         Maximum Value
         Default Value
         Null Valid                                       :   yes
         Failed Validation Message
         Description


  Hope this helps,

  ryugarai
Posts: 65
Joined: Fri Feb 13, 2009 12:03 PM
Re: Xbrowse with Ads
Posted: Thu Mar 26, 2009 06:01 AM

Dear NageswaraRao,

   I think i just figured out the cause of incorrect display in xbrowse. It seems that when SET EXACT is set to .T., xbrowse display dates as "@d". Does SET EXACT affect the dates when displaying in xbrowse? Should i disable SET EXACT command when using xbrowse?

regards,

ryugarai

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse with Ads
Posted: Thu Mar 26, 2009 07:31 AM
You caught the real problem. This is a bug in \fwh\source\function\valblank.prg.

Line 99 in \fwh\source\function\valblank.prg is :
Code (fw): Select all Collapse
   elseif ValType( uVal ) == 'D' .and. !( cPic = '@' )

This works only when SET EXACT IS OFF and fails when SET EXACT IS ON.
This line should be changed as :
Code (fw): Select all Collapse
   elseif ValType( uVal ) == 'D' .and. Left( cPic, 1 ) != '@'

I request Mr Anotonio to kindly note this mistake and rectify in release 9.03.

Meanwhile you may either modify the above program and recompile with your application or incorporate the modified function cValToStr in your source program.

In case you need any assistance, please post here.
Regards



G. N. Rao.

Hyderabad, India
Posts: 65
Joined: Fri Feb 13, 2009 12:03 PM
Re: Xbrowse with Ads
Posted: Thu Mar 26, 2009 09:06 AM

NageswaraRao,

  Thanks for the modification, xbrowse now display dates correctly.

regards,

ryugarai

Continue the discussion