Xbrowse with Ads

Post Reply
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Xbrowse with Ads

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Xbrowse with Ads

Post 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 ?
Regards

G. N. Rao.
Hyderabad, India
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Re: Xbrowse with Ads

Post 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
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Re: Xbrowse with Ads

Post 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
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Xbrowse with Ads

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
ryugarai27
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines
Contact:

Re: Xbrowse with Ads

Post by ryugarai27 »

NageswaraRao,

Thanks for the modification, xbrowse now display dates correctly.

regards,

ryugarai
Post Reply