FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADS Tips
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
ADS Tips
Posted: Thu Dec 27, 2007 08:07 AM
Hello,

I think that it's goes being the moment that among all we go contributing our knowledge for somehow to be able to optimize the yield of ADS in our applications. I understand that the important thing is optimize the yield in the use of ADS in form Client/Server.

Many functions are not used or they are used bad. Does ADS work well, but can it work well? I believe that if it is possible. Today's tip

Use of a type field it dates.

Usually using the function DToC (), does the system work and are we so wide, but that it happens if we use the function AdsGetDate ()? Do we notice difference?

HB_FUNC( ZADSGETDATE )
{
   ADSAREAP pArea;
   UNSIGNED8  *pucFldName = (UNSIGNED8 *) hb_parc( 1 );
   UNSIGNED8  pucBuf[16];
   UNSIGNED16 pusLen = 16;

   pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer();


/*   ulRetVal = AdsGetServerName( hConnect,pucname,&puslen ) ; */

   AdsGetDate( pArea->hTable, pucFldName, pucBuf, &pusLen );

   if( pusLen > 0 )
   {
      hb_retc( (char *) pucBuf );
   }
    else
   {
      hb_retc(NULL);
   }

}


Y su uso en un browse seria:

@0, 0 LISTBOX oLbx  ;
      FIELDS (cAlias)->order              ,;
             (cAlias)->( ZAdsGetDate( 'mydate' ) )  ;  
      HEADER 'Order', 'Date' ;
      FONT oFont ALIAS cAlias SIZE 200,200 PIXEL OF oWnd


Note: It's interesting to carry out the tests with big tables and against Client/Server

I hope to encourage people to contribute their tips and among all to achieve a bigger yield of ADS
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix

Continue the discussion