Antonio,
I just sent an email to Mr. Rao asking him
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( FW_TTOD )
{
hb_retdl( hb_pardl( 1 ) );
}
HB_FUNC( FW_DTOT )
{
#ifdef __XHARBOUR__
hb_retdtl( hb_pardl( 1 ), hb_part( 1 ) );
#else
long lJulian;
long lMilliSecs;
hb_partdt( &lJulian, &lMilliSecs, 1 );
hb_rettdt( lJulian, lMilliSecs );
#endif
}
#pragma ENDDUMP
(calias)->(__dblocate( {|| namefiled->name = cNname} ))
1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem.
2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem?
Antonio Linares wrote:Antonio,2) Locates. Can you check the adordd.prg ado_locate to see what might be the problem?
Surely you need to do a oRecordSet:GoTop() before running the locate code.
<Scope>
This option defines the number of records to scan. It defaults to ALL. The NEXT <nCount> scope scans the next <nCount> records, while REST scans records beginning from the current record to the end of file. The search begins with the first record unless a scope is defined.
STATIC FUNCTION ADO_LOCATE( nWA, lContinue )
LOCAL aWAData := USRRDD_AREADATA( nWA )
LOCAL oRecordSet := aWAData[ WA_RECORDSET ]
IF ADOEMPTYSET(oRecordSet)
RETURN HB_FAILURE
ENDIF
IF !lContinue
oRecordSet:MoveFirst() //START FROM BEGINING
ELSE
oRecordSet:MoveNext() //WE DONT WANT TO FIND THIS ONE AGAIN
ENDIF
CURSORWAIT()
DO WHILE !oRecordSet:EoF()
[b]IF EVAL( aWAData[ WA_SCOPEINFO ][ UR_SI_BFOR ])[/b]
aWAData[ WA_FOUND ] := .T.
EXIT
ENDIF
oRecordSet:MoveNext()
SYSREFRESH()
ENDDO
CURSORARROW()
aWAData[ WA_FOUND ] := ! oRecordSet:EOF
aWAData[ WA_EOF ] := oRecordSet:EOF
RETURN HB_SUCCESS
Antonio Linares wrote:Antonio,1) Fields N without any decimal returning 2 decimals. (xxx.00) Do you have any idea what might be the problem.
Do you use any C code ? if yes then check if hb_retnd() is used somewhere and change it into hb_retnl()
Try to check the size of the field and use int() when its not a decimal
nLen := Max( 19, oField:Precision + 2 )
nLen := Min( 19, oField:Precision ) //
(calias)->(__dblocate( {|| MsgInfo( namefiled->name, cNname ), namefiled->name = cNname} ))
And check what it shows
AHF wrote:Antonio, Mr Rao,Try to check the size of the field and use int() when its not a decimal
Solved!
In adofuncs.prg you have:
- Code: Select all Expand view
nLen := Max( 19, oField:Precision + 2 )
Shouldnt it be:
- Code: Select all Expand view
nLen := Min( 19, oField:Precision ) //
Otherwise we will have all fields much bigger because the minimum it will be 19.
Why not only oField:Precision?
+2 is for ( 1 decimal place and 1 minus sign )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 53 guests