Xbrowse with Ads

Xbrowse with Ads

Postby ryugarai27 » Wed Mar 25, 2009 3: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
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: Xbrowse with Ads

Postby nageswaragunupudi » Wed Mar 25, 2009 6: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
User avatar
nageswaragunupudi
 
Posts: 10502
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse with Ads

Postby ryugarai27 » Thu Mar 26, 2009 4: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
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: Xbrowse with Ads

Postby ryugarai27 » Thu Mar 26, 2009 6: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
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: Xbrowse with Ads

Postby nageswaragunupudi » Thu Mar 26, 2009 7: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: Select all  Expand view

   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  Expand view

   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
nageswaragunupudi
 
Posts: 10502
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse with Ads

Postby ryugarai27 » Thu Mar 26, 2009 9:06 am

NageswaraRao,

Thanks for the modification, xbrowse now display dates correctly.

regards,

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano, Google [Bot] and 52 guests