Page 1 of 1

Xbrowse with Ads

Posted: Wed Mar 25, 2009 3:17 am
by ryugarai27
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

Re: Xbrowse with Ads

Posted: Wed Mar 25, 2009 6:52 am
by nageswaragunupudi
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 ?

Re: Xbrowse with Ads

Posted: Thu Mar 26, 2009 4:02 am
by ryugarai27
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

Re: Xbrowse with Ads

Posted: Thu Mar 26, 2009 6:01 am
by ryugarai27
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

Re: Xbrowse with Ads

Posted: Thu Mar 26, 2009 7:31 am
by nageswaragunupudi
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: Select all

   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: Select all

   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.

Re: Xbrowse with Ads

Posted: Thu Mar 26, 2009 9:06 am
by ryugarai27
NageswaraRao,

Thanks for the modification, xbrowse now display dates correctly.

regards,

ryugarai